mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Manual merge
This commit is contained in:
@ -820,3 +820,62 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
# # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
# # Query 1 # COMMIT
|
||||
DROP TABLE t1;
|
||||
|
||||
# BUG#54903 BINLOG statement toggles session variables
|
||||
# ----------------------------------------------------------------------
|
||||
# This test verify that BINLOG statement doesn't change current session's
|
||||
# variables foreign_key_checks and unique_checks.
|
||||
|
||||
CREATE TABLE t1 (c1 INT KEY);
|
||||
SET @@SESSION.foreign_key_checks= ON;
|
||||
SET @@SESSION.unique_checks= ON;
|
||||
# INSERT INTO t1 VALUES (1)
|
||||
# foreign_key_checks=0 and unique_checks=0
|
||||
BINLOG '
|
||||
dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
|
||||
dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA==
|
||||
';
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
# Their values should be ON
|
||||
SHOW SESSION VARIABLES LIKE "%_checks";
|
||||
Variable_name Value
|
||||
foreign_key_checks ON
|
||||
unique_checks ON
|
||||
|
||||
SET @@SESSION.foreign_key_checks= OFF;
|
||||
SET @@SESSION.unique_checks= OFF;
|
||||
# INSERT INTO t1 VALUES(2)
|
||||
# foreign_key_checks=1 and unique_checks=1
|
||||
BINLOG '
|
||||
dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
|
||||
dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
|
||||
';
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
2
|
||||
# Their values should be OFF
|
||||
SHOW SESSION VARIABLES LIKE "%_checks";
|
||||
Variable_name Value
|
||||
foreign_key_checks OFF
|
||||
unique_checks OFF
|
||||
# INSERT INTO t1 VALUES(2)
|
||||
# foreign_key_checks=1 and unique_checks=1
|
||||
# It should not change current session's variables, even error happens
|
||||
BINLOG '
|
||||
dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
|
||||
dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
|
||||
';
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
2
|
||||
# Their values should be OFF
|
||||
SHOW SESSION VARIABLES LIKE "%_checks";
|
||||
Variable_name Value
|
||||
foreign_key_checks OFF
|
||||
unique_checks OFF
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user