Bug #67345 init-file stops getting executed if a long enough line is encountered
Submitted: 24 Oct 2012 0:29 Modified: 7 Jan 2013 5:26
Reporter: Elena Stepanova Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:5.6, 5.7.1 OS:Any
Assigned to: CPU Architecture:Any

[24 Oct 2012 0:29] Elena Stepanova
Description:
If a server is started with the init-file parameter and the file contains long enough lines (for me, the problem starts with 20,000 characters), it looks like the file stops being executed after such a line is encountered. 

The attached file contains 3 lines. 
1) creation of a table with one VARCHAR(100) field;
2) big INSERT (191 values);
3) small INSERT (1 value).

The test in 'How to repeat' section only contains SELECT COUNT(*) from the table created in the init file. On 5.5, it returns 192, as expected. On 5.6, it returns 0.

mysql-server/5.6/
revision-id: iggy.galarza@oracle.com-20120918225427-002qegcnv3bz1o5g
date: 2012-09-18 18:54:27 -0400
revno: 4229

How to repeat:
# Run the test as perl mysql-test-run.pl  --mysqld=--init-file=<path to the attached file> <test name>

SELECT COUNT(*) FROM t1;

# End of test
[24 Oct 2012 0:34] Elena Stepanova
init-file to provide on server startup

Attachment: init.sql (application/octet-stream, text), 19.64 KiB.

[29 Nov 2012 18:32] Elena Stepanova
(in regard to the changed Category field)

Hi, 

are you sure it's a client problem? Please note that init-file is a server option.

Just to clarify, the test case only uses MTR to provide generic steps to reproduce the issue, but the same problem can be observed if you simply start the server with --init-file=<attached file>.

By the way, if the same file is fed to the server through MySQL client, it works just fine.
[29 Nov 2012 21:06] Sveta Smirnova
Thank you for the report.

Verified as described.
[20 Dec 2012 10:34] Vamsikrishna Bhagi
mysql-5.6 supports only up to 20000 characters per line in the init file and the error mentioned in the bug description is as expected. On following the reproduction steps, I got this error message:

ERROR: 1105  Boostrap file error. Query size exceeded 20000 bytes near 'aaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaa');'.

Since a proper error message is returned, I believe this is not a bug.