mysqlslap adds '\0' symbol in the end of autogenerated CREATE TABLE statement

Bug #1531278 reported by Sveta Smirnova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.6
Triaged
Medium
Unassigned
5.7
Triaged
Medium
Unassigned

Bug Description

Description:
mysqlslap adds extra '\0' symbol in the end of the autogenerated CREATE TABLE statement

How to repeat:
1. Start server with binary log enabled, for example, from mysql-test:

./mtr --start alias --mysqld=--plugin-dir=$HOME/build/mysql-5.7/lib/plugin --mysqld=--character-set-server=utf8 --mysqld=--log-bin &

2. Run mysqlslap with --auto-generate-sql option:

../bin/mysqlslap -h127.0.0.1 -P13000 -uroot --concurrency=50 --iterations=200 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql

3. Check binary log content:

$../bin/mysqlbinlog var/mysqld.1/data/0.000005
...
# at 510
#160105 22:54:37 server id 1 end_log_pos 575 CRC32 0x53f2e1e5 Anonymous_GTID last_committed=2 sequence_number=3
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
# at 575
#160105 22:54:37 server id 1 end_log_pos 779 CRC32 0x3cecd4a0 Query thread_id=33812 exec_time=0 error_code=0
use `mysqlslap`/*!*/;
SET TIMESTAMP=1452027277/*!*/;
CREATE TABLE `t1` (intcol1 INT(32) ,intcol2 INT(32) ,charcol1 VARCHAR(128),charcol2 VARCHAR(128),charcol3 VARCHAR(128))^@
/*!*/;

4. Try to import data into test database:

$../bin/mysqlbinlog var/mysqld.1/data/0.000005 | mysqlmtr test
ERROR at line 45: ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: 'CREATE TABLE `t1` (intcol1 INT(32) ,intcol2 INT(32) ,charcol1 VARCHAR(128),charcol2 VARCHAR(128),charcol3 VARCHAR(128))'.

Suggested fix:
Don't add extra character in the end of auto-generated CREATE TABLE statement.

tags: added: upstream
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1688

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.