mirror of
https://github.com/MariaDB/server.git
synced 2025-07-05 12:42:17 +03:00
Bug #54579 Wrong unsafe warning for INSERT DELAYED in SBR
The lock_type is upgrade to TL_WRITE from TL_WRITE_DELAYED for INSERT DELAYED when inserting multi values in one statement. It's safe. But it causes an unsafe warning in SBR. Make INSERT DELAYED safe by logging it as INSERT without DELAYED. mysql-test/extra/binlog_tests/binlog_insert_delayed.test: Updated the test file to test multi INSERT DELAYED statement is no longer causes an unsafe warning and binlogged as INSERT without DELAYED. mysql-test/extra/rpl_tests/create_recursive_construct.inc: Updated for the patch of bug#54579. mysql-test/suite/binlog/r/binlog_row_binlog.result: Updated for the patch of bug#54579. mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result: Test result for BUG#54579. mysql-test/suite/binlog/r/binlog_stm_binlog.result: Updated for the patch of bug#54579. mysql-test/suite/binlog/r/binlog_unsafe.result: Updated for the patch of bug#54579. mysql-test/suite/binlog/t/binlog_unsafe.test: Updated for the patch of bug#54579. sql/sql_insert.cc: Added code to genetate a new query string for removing DELAYED keyword for multi INSERT DEALAYED statement. sql/sql_yacc.yy: Added code to record the DELAYED keyword position and remove the setting of unsafe statement for INSERT DELAYED statement
This commit is contained in:
@ -338,10 +338,21 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) {
|
||||
SHOW BINLOG EVENTS;
|
||||
--die Warnings printed
|
||||
}
|
||||
# The first event is format_description, the second is
|
||||
# Query_event('BEGIN'), and the third should be our Table_map.
|
||||
--let $event_type= query_get_value(SHOW BINLOG EVENTS, Event_type, 3)
|
||||
if (`SELECT '$event_type' != 'Table_map'`) {
|
||||
# The first event is format_description, the second is
|
||||
# Query_event('BEGIN'), and the third should be our Query
|
||||
# for 'INSERT DELAYED' unsafe_type 3, which is safe after
|
||||
# the fix of bug#54579.
|
||||
if (`SELECT $unsafe_type = 3 AND '$event_type' != 'Query'`) {
|
||||
--enable_query_log
|
||||
--echo ******** Failure! Event number 3 was a '$event_type', not a 'Query'. ********
|
||||
SHOW BINLOG EVENTS;
|
||||
--die Wrong events in binlog.
|
||||
}
|
||||
# The first event is format_description, the second is
|
||||
# Query_event('BEGIN'), and the third should be our Table_map
|
||||
# for unsafe statement.
|
||||
if (`SELECT $unsafe_type != 3 AND '$event_type' != 'Table_map'`) {
|
||||
--enable_query_log
|
||||
--echo ******** Failure! Event number 3 was a '$event_type', not a 'Table_map'. ********
|
||||
SHOW BINLOG EVENTS;
|
||||
|
Reference in New Issue
Block a user