mysqlbinlog generates SQL which is not parseable by mysql cmdline tool
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Invalid
|
Undecided
|
Unassigned |
Bug Description
mysqlbinlog outputs SQL (containing nulls) which is not parseable/allowed by mysql cmdline tool, in essence you can't make PITR restore without hacking mysql index file and inserting those log files or using your own written mysql client:
Reproduce (see binlog attached, requires test schema), SBR/mixed replication used:
1. mysqlbinlog mysql-bin.000006 | mysql
Result:
ERROR at line 43: 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: 'Insert into test_replica values(_binary ''.
With option (even worse):
2. mysqlbinlog mysql-bin.000006 | mysql --binary-mode
Result:
ERROR 1046 (3D000) at line 31: No database selected
Expected:
No error, value inserted into test_replica table
Python script to generate binary log entry;
```
import MySQLdb
db = MySQLdb.
db.query('create table if not exists test_replica(value varchar(256))')
db.query("Insert into test_replica values(_binary '\0')")
db.query("commit")
```
Percona server version: 5.6.31-
tags: | added: i140906 |
Changed in percona-server: | |
status: | Incomplete → New |
Python script which generate insert with null value.