1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

BUG#13627921 - MISSING FLAGS IN SQL_COMMAND_FLAGS MAY LEAD TO REPLICATION PROBLEMS

merge from MySQL-5.6, revision:

revno: 3677.2.1
committer: Alfranio Correia <alfranio.correia@oracle.com>
timestamp: Tue 2012-02-28 16:26:37 +0000
message:
  BUG#13627921 - MISSING FLAGS IN SQL_COMMAND_FLAGS MAY LEAD TO REPLICATION PROBLEMS

  Flags in sql_command_flags[command] are not correctly set for the following
  commands:

    . SQLCOM_SET_OPTION is missing CF_CAN_GENERATE_ROW_EVENTS;
    . SQLCOM_BINLOG_BASE64_EVENT is missing CF_CAN_GENERATE_ROW_EVENTS;
    . SQLCOM_REVOKE_ALL is missing CF_CHANGES_DATA;
    . SQLCOM_CREATE_FUNCTION is missing CF_AUTO_COMMIT_TRANS;

  This may lead to a wrong sequence of events in the binary log. To fix
  the problem, we correctly set the flags in sql_command_flags[command].
This commit is contained in:
Sergei Golubchik
2014-09-30 15:55:02 +02:00
parent 5e1fad8512
commit 75908fc4ce
18 changed files with 2524 additions and 10 deletions

View File

@@ -113,6 +113,19 @@ if ($commands == 'configure')
RETURN "fc_i_nt_5_suc";
END|
CREATE FUNCTION fc_i_nt_3_tt_3_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
BEGIN
DECLARE in_stmt_id INTEGER;
SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= p_trans_id;
SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
INSERT INTO nt_3(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
SELECT max(stmt_id) INTO in_stmt_id FROM tt_3 WHERE trans_id= p_trans_id;
SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
INSERT INTO tt_3(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
RETURN "fc_i_nt_3_tt_3_suc";
END|
CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
BEGIN
DECLARE in_stmt_id INTEGER;
@@ -186,6 +199,7 @@ if ($commands == 'clean')
DROP PROCEDURE pc_i_nt_5_suc;
DROP FUNCTION fc_i_tt_5_suc;
DROP FUNCTION fc_i_nt_5_suc;
DROP FUNCTION fc_i_nt_3_tt_3_suc;
--disable_query_log
if ($database_name != 'test')
@@ -439,6 +453,21 @@ while ($commands != '')
eval INSERT INTO tt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_nt_5_suc ($trans_id, $stmt_id));
inc $stmt_id;
}
if ($command == 'set-T')
{
--eval SET @var= fc_i_tt_5_suc($trans_id, $stmt_id)
inc $stmt_id;
}
if ($command == 'set-N')
{
--eval SET @var= fc_i_nt_5_suc($trans_id, $stmt_id)
inc $stmt_id;
}
if ($command == 'set-NT')
{
--eval SET @var= fc_i_nt_3_tt_3_suc($trans_id, $stmt_id)
inc $stmt_id;
}
if ($command == 'CS-T->T')
{
--eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=$engine_type SELECT * FROM tt_1;