Page MenuHomePhabricator

Error 1406: Data too long for column 'gb_reason'
Closed, InvalidPublic

Description

Can we make the column bigger? Our lovely @dmehus managed to go above it with "(Likely web host with a company name like Triple T Internet Company Limited, a Pakkret, Nonthaburi, Thailand-based concern.) Used by nefarious crosswiki spambot accounts for crosswiki spamming (200+ in past two months)"

Event Timeline

Reedy subscribed.

Pretty sure you've not deployed a schema change - T231170: Alter globalblocking tables to allow longer comments brought it up to 767 chars

2019? Is there any easy way to look for schema changes not done?

Pretty sure you've not deployed a schema change - T231170: Alter globalblocking tables to allow longer comments brought it up to 767 chars

We that applied already:

| gb_reason      | varbinary(767) | NO   |     | NULL    |                |
php > var_dump( strlen( '(Likely web host with a company name like Triple T Internet Company Limited, a Pakkret, Nonthaburi, Thailand-based concern.) Used by nefarious crosswiki spambot accounts for crosswiki spamming (200+ in past two months)' ) );
int(218)

Hell, that should've fit in the old version (255)

"Web host or proxy. Contact cvt{{@}}miraheze.org if affected.: (Likely web host with a company name like Triple T Internet Company Limited, a Pakkret, Nonthaburi, Thailand-based concern.) Used by nefarious crosswiki spambot accounts for crosswiki spamming (200+ in past two months)" the full thing it tried to insert.

php > var_dump( strlen( 'Web host or proxy. Contact cvt{{@}}miraheze.org if affected.: (Likely web host with a company name like Triple T Internet Company Limited, a Pakkret, Nonthaburi, Thailand-based concern.) Used by nefarious crosswiki spambot accounts for crosswiki spamming (200+ in past two months)' ) );
int(280)
php > var_dump( mb_strlen( 'Web host or proxy. Contact cvt{{@}}miraheze.org if affected.: (Likely web host with a company name like Triple T Internet Company Limited, a Pakkret, Nonthaburi, Thailand-based concern.) Used by nefarious crosswiki spambot accounts for crosswiki spamming (200+ in past two months)' ) );
int(280)

Are you sure it's using the version of the globalblocking table you think it is?

Still a lot less than 767

Yeh, I checked the db and the schema it shows is:

MariaDB [metawiki]> describe globalblocks;
+----------------+----------------+------+-----+---------+----------------+
| Field          | Type           | Null | Key | Default | Extra          |
+----------------+----------------+------+-----+---------+----------------+
| gb_id          | int(11)        | NO   | PRI | NULL    | auto_increment |
| gb_address     | varchar(255)   | NO   | MUL | NULL    |                |
| gb_by          | varchar(255)   | NO   |     | NULL    |                |
| gb_by_wiki     | varbinary(255) | NO   |     | NULL    |                |
| gb_reason      | varbinary(767) | NO   |     | NULL    |                |
| gb_timestamp   | binary(14)     | NO   | MUL | NULL    |                |
| gb_anon_only   | tinyint(1)     | NO   |     | 0       |                |
| gb_expiry      | varbinary(14)  | NO   | MUL |         |                |
| gb_range_start | varbinary(35)  | NO   | MUL | NULL    |                |
| gb_range_end   | varbinary(35)  | NO   |     | NULL    |                |
+----------------+----------------+------+-----+---------+----------------+
10 rows in set (0.001 sec)

update query is:

UPDATE  `globalblocks` SET gb_address = '....',gb_by = '.....',gb_by_wiki = 'metawiki',gb_reason = 'Web host or proxy. Contact cvt{{@}}miraheze.org if affected.: (Likely web host with a company name like Triple T Internet Company Limited, a Pakkret, Nonthaburi, Thailand-based concern.) Used by nefarious crosswiki spambot accounts for crosswiki spamming (200+ in past two months)',gb_timestamp = '20201229201523',gb_anon_only = 1,gb_expiry = '20251229201523',gb_range_start = '0ECF0000',gb_range_end = '0ECFFFFF' WHERE gb_id = 70793;

some how manually running it worked.

Found it... I was looking at the wrong database.

MariaDB [mhglobal]> describe globalblocks;
+----------------+----------------+------+-----+---------+----------------+
| Field          | Type           | Null | Key | Default | Extra          |
+----------------+----------------+------+-----+---------+----------------+
| gb_id          | int(11)        | NO   | PRI | NULL    | auto_increment |
| gb_address     | varchar(255)   | NO   | MUL | NULL    |                |
| gb_by          | varchar(255)   | NO   |     | NULL    |                |
| gb_by_wiki     | varbinary(255) | NO   |     | NULL    |                |
| gb_reason      | tinyblob       | NO   |     | NULL    |                |
| gb_timestamp   | binary(14)     | NO   | MUL | NULL    |                |
| gb_anon_only   | tinyint(1)     | NO   |     | 0       |                |
| gb_expiry      | varbinary(14)  | NO   | MUL |         |                |
| gb_range_start | varbinary(35)  | NO   | MUL | NULL    |                |
| gb_range_end   | varbinary(35)  | NO   |     | NULL    |                |
+----------------+----------------+------+-----+---------+----------------+
10 rows in set (0.001 sec)

Pretty sure you've not deployed a schema change - T231170: Alter globalblocking tables to allow longer comments brought it up to 767 chars

Thanks, @RhinosF1 and @Paladox for following up on this error. Thanks, @Reedy, for your troubleshooting. So what was the outcome of this, did we have to update our schema, @Paladox?