Bug #46776 MySQL client confused by quotes, treats data as commands
Submitted: 18 Aug 9:42 Modified: 20 Aug 11:53
Reporter: River Tarnell
Status: Verified
Category:Client Severity:S2 (Serious)
Version:5.1.35 OS:Any (Solaris, Linux)
Assigned to: Target Version:5.1+
Tags: regression
Triage: Triaged: D3 (Medium)

[18 Aug 9:42] River Tarnell
Description:
This is a regression from 5.1.33 client, which worked fine.

# gzip -dc commonswiki.image.sql.gz | mysql
ERROR at line 4894595: Unknown command '\\'.

How to repeat:
Send the file "commonswiki.image.sql.gz", which i have uploaded to
ftp.mysql.com:/pub/mysql/incoming/commonswiki.image.sql.gz, as input to the MySQL
command-line client (version 5.1.35).

I tried to produce a smaller test case, but when I isolated 20 lines around the line
producing the error, the data imported fine.

Suggested fix:
Unknown.
[18 Aug 11:07] Sveta Smirnova
Thank you for the report.

This looks like max_allowed_packet is too small. Please increase it, try again and inform
us if problem still exists.
[18 Aug 11:10] River Tarnell
The value of max_allowed_packet is identical on the systems that work (5.1.33) and the
ones that don't (5.1.35).  (Also, importing from a 5.1.33 client to the 5.1.35 server
works fine, with the same configuration.)

I can't increase it at the moment since the servers are in use and cannot be restarted,
but I will try to do so later this week.
[18 Aug 11:38] Sveta Smirnova
Thank you for the feedback.

Please indicate which max_allowed_packet worked in version 5.1.33 Please try 5.1.37
client also.
[20 Aug 11:53] Sveta Smirnova
No feedback needed.

Verified as described using max_allowed_packet=1G. Version 5.1.30 didn't work, then
5.1.33 worked, then next versions don't work again.

To repeat:

1. CREATE TABLE `image` (
  `img_name` varchar(255) binary NOT NULL default '',
  `img_size` int(8) unsigned NOT NULL default '0',
  `img_width` int(5) NOT NULL default '0',
  `img_height` int(5) NOT NULL default '0',
  `img_metadata` mediumblob NOT NULL,
  `img_bits` int(3) NOT NULL default '0',
  `img_media_type`
enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE')
default NULL,
  `img_major_mime`
enum('unknown','application','audio','image','text','video','message','model','multipart')
NOT NULL default 'unknown',
  `img_minor_mime` varchar(32) NOT NULL default 'unknown',
  `img_description` tinyblob NOT NULL,
  `img_user` int(5) unsigned NOT NULL default '0',
  `img_user_text` varchar(255) binary NOT NULL default '',
  `img_timestamp` varchar(14) binary NOT NULL default '',
  `img_sha1` varchar(32) binary NOT NULL default '',
  PRIMARY KEY  (`img_name`),
  KEY `img_size` (`img_size`),
  KEY `img_timestamp` (`img_timestamp`),
  KEY `img_usertext_timestamp` (`img_user_text`,`img_timestamp`),
  KEY `img_sha1` (`img_sha1`)
) ;

2. Load dump provided.