Bug #67878 | Replication failure on loading data into a view with binlog_format=STATEMENT | ||
---|---|---|---|
Submitted: | 11 Dec 2012 21:32 | Modified: | 25 Apr 2013 17:22 |
Reporter: | Elena Stepanova | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 5.1, 5.5, 5.6 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | regression |
[11 Dec 2012 21:32]
Elena Stepanova
[12 Dec 2012 7:51]
Valeriy Kravchuk
This is what we have in 5.6.8: [openxs@chief mysql-test]$ ./mtr bug67878 | more Logging: ./mtr bug67878 121212 9:49:48 [Warning] Changed limits: max_open_files: 1024 max_connections: 151 table_cache: 431 121212 9:49:48 [Note] Plugin 'FEDERATED' is disabled. 121212 9:49:48 [Note] Binlog end 121212 9:49:48 [Note] Shutting down plugin 'MyISAM' 121212 9:49:48 [Note] Shutting down plugin 'CSV' MySQL Version 5.6.8 Checking supported features... - skipping ndbcluster - SSL connections supported Collecting tests... Checking leftover processes... Removing old var directory... Creating var directory '/home/openxs/dbs/5.6/mysql-test/var'... Installing system database... Using server port 35642 ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 main.bug67878 [ fail ] Test ended at 2012-12-12 09:49:59 CURRENT_TEST: main.bug67878 === SHOW MASTER STATUS === ---- 1. ---- File slave-bin.000001 Position 412 Binlog_Do_DB Binlog_Ignore_DB Executed_Gtid_Set ========================== === SHOW SLAVE STATUS === ---- 1. ---- Slave_IO_State Waiting for master to send event Master_Host 127.0.0.1 Master_User root Master_Port 13000 Connect_Retry 1 Master_Log_File master-bin.000001 Read_Master_Log_Pos 888 Relay_Log_File slave-relay-bin.000002 Relay_Log_Pos 592 Relay_Master_Log_File master-bin.000001 Slave_IO_Running Yes Slave_SQL_Running No Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 1054 Last_Error Error 'Unknown column 'j' in 'field list'' on query. Default dat abase: 'test'. Query: 'LOAD DATA INFILE '../../tmp/SQL_LOAD-8631be3b-4430-11e2-b a2d-485b3952834f-1-1.data' IGNORE INTO TABLE `v1` FIELDS TERMINATED BY '\t' ENC LOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`i`, `j`)' ...
[13 Dec 2012 0:01]
Sveta Smirnova
Thank you for the report. Verified as described. Problem is not repeatable with version 5.0
[15 Dec 2012 17:39]
Elena Stepanova
A slightly different and I think somewhat more vicious scenario, which does not even require a different list of fields in the table and the view: --source include/master-slave.inc --source include/have_binlog_format_statement.inc --write_file $MYSQLTEST_VARDIR/l.data 1 EOF CREATE TABLE t1 (i INT); CREATE VIEW v1 AS SELECT i FROM t1; SHOW CREATE VIEW v1; --eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/l.data' INTO TABLE v1 (i) --sync_slave_with_master # End of test case It also fails, because in the binary log the LOAD statement is written as LOAD DATA LOCAL INFILE '/home/elenst/mysql-5.5/mysql-test/var/l.data' IGNORE INTO TABLE `v1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`test`.`t1`.`i`) and replication aborts with Last_Errno 1054 Last_Error Error 'Unknown column 'test.t1.i' in 'field list'' on query.
[25 Apr 2013 17:22]
Jon Stephens
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at http://www.mysql.com/downloads/
[25 Apr 2013 17:23]
Jon Stephens
Documented fix in the 5.7.1 changelog as follows: Replication failed when a replicated LOAD DATA statement inserted rows into a view. Closed.