mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 03:21:53 +01:00
Problem: Pushbuild errors because sql_mode is unsafe but test thinks it is
safe. Fix: Move sql_mode: from the section of the test where safe variables are tested, to the section where unsafe variables are tested.
This commit is contained in:
parent
81b1d712bf
commit
afde9893b1
2 changed files with 25 additions and 8 deletions
|
@ -20,6 +20,9 @@ Warning 1592 Statement is not safe to log in statement format.
|
|||
INSERT INTO t2 SELECT UUID();
|
||||
Warnings:
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||
Warnings:
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
INSERT INTO t2 VALUES (@@global.init_slave);
|
||||
Warnings:
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
|
@ -33,6 +36,7 @@ INSERT INTO t1 VALUES (@@global.sync_binlog);
|
|||
INSERT INTO t1 VALUES (@@session.insert_id);
|
||||
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
||||
INSERT INTO t2 SELECT UUID();
|
||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||
INSERT INTO t2 VALUES (@@global.init_slave);
|
||||
INSERT INTO t2 VALUES (@@hostname);
|
||||
END|
|
||||
|
@ -44,6 +48,7 @@ Warning 1592 Statement is not safe to log in statement format.
|
|||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
---- Insert from stored function ----
|
||||
CREATE FUNCTION func()
|
||||
RETURNS INT
|
||||
|
@ -52,6 +57,7 @@ INSERT INTO t1 VALUES (@@global.sync_binlog);
|
|||
INSERT INTO t1 VALUES (@@session.insert_id);
|
||||
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
||||
INSERT INTO t2 SELECT UUID();
|
||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||
INSERT INTO t2 VALUES (@@global.init_slave);
|
||||
INSERT INTO t2 VALUES (@@hostname);
|
||||
RETURN 0;
|
||||
|
@ -66,6 +72,7 @@ Warning 1592 Statement is not safe to log in statement format.
|
|||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
---- Insert from trigger ----
|
||||
CREATE TRIGGER trig
|
||||
BEFORE INSERT ON trigger_table
|
||||
|
@ -75,6 +82,7 @@ INSERT INTO t1 VALUES (@@global.sync_binlog);
|
|||
INSERT INTO t1 VALUES (@@session.insert_id);
|
||||
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
||||
INSERT INTO t2 SELECT UUID();
|
||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||
INSERT INTO t2 VALUES (@@global.init_slave);
|
||||
INSERT INTO t2 VALUES (@@hostname);
|
||||
END|
|
||||
|
@ -87,13 +95,15 @@ Warning 1592 Statement is not safe to log in statement format.
|
|||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
---- Insert from prepared statement ----
|
||||
PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)';
|
||||
PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)';
|
||||
PREPARE p3 FROM 'INSERT INTO t1 VALUES (@@global.auto_increment_increment)';
|
||||
PREPARE p4 FROM 'INSERT INTO t2 SELECT UUID()';
|
||||
PREPARE p5 FROM 'INSERT INTO t2 VALUES (@@global.init_slave)';
|
||||
PREPARE p6 FROM 'INSERT INTO t2 VALUES (@@hostname)';
|
||||
PREPARE p5 FROM 'INSERT INTO t2 VALUES (@@session.sql_mode)';
|
||||
PREPARE p6 FROM 'INSERT INTO t2 VALUES (@@global.init_slave)';
|
||||
PREPARE p7 FROM 'INSERT INTO t2 VALUES (@@hostname)';
|
||||
EXECUTE p1;
|
||||
Warnings:
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
|
@ -112,6 +122,9 @@ Warning 1592 Statement is not safe to log in statement format.
|
|||
EXECUTE p6;
|
||||
Warnings:
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
EXECUTE p7;
|
||||
Warnings:
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
---- Insert from nested call of triggers / functions / procedures ----
|
||||
CREATE PROCEDURE proc1()
|
||||
INSERT INTO trigger_table VALUES ('ha!')|
|
||||
|
@ -147,13 +160,13 @@ Warning 1592 Statement is not safe to log in statement format.
|
|||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
Warning 1592 Statement is not safe to log in statement format.
|
||||
==== Variables that should *not* be unsafe ====
|
||||
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
|
||||
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
|
||||
INSERT INTO t1 VALUES (@@session.foreign_key_checks);
|
||||
INSERT INTO t1 VALUES (@@session.sql_auto_is_null);
|
||||
INSERT INTO t1 VALUES (@@session.unique_checks);
|
||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||
INSERT INTO t1 VALUES (@@session.auto_increment_increment);
|
||||
INSERT INTO t1 VALUES (@@session.auto_increment_offset);
|
||||
INSERT INTO t2 VALUES (@@session.character_set_client);
|
||||
|
@ -179,4 +192,3 @@ DROP PROCEDURE proc4;
|
|||
DROP FUNCTION func5;
|
||||
DROP PREPARE prep6;
|
||||
DROP TABLE t1, t2, t3, trigger_table, trigger_table2;
|
||||
DROP VIEW v1;
|
||||
|
|
|
@ -81,6 +81,7 @@ INSERT INTO t1 VALUES (@@global.sync_binlog);
|
|||
INSERT INTO t1 VALUES (@@session.insert_id);
|
||||
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
||||
INSERT INTO t2 SELECT UUID();
|
||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||
INSERT INTO t2 VALUES (@@global.init_slave);
|
||||
INSERT INTO t2 VALUES (@@hostname);
|
||||
|
||||
|
@ -93,6 +94,7 @@ BEGIN
|
|||
INSERT INTO t1 VALUES (@@session.insert_id);
|
||||
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
||||
INSERT INTO t2 SELECT UUID();
|
||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||
INSERT INTO t2 VALUES (@@global.init_slave);
|
||||
INSERT INTO t2 VALUES (@@hostname);
|
||||
END|
|
||||
|
@ -110,6 +112,7 @@ BEGIN
|
|||
INSERT INTO t1 VALUES (@@session.insert_id);
|
||||
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
||||
INSERT INTO t2 SELECT UUID();
|
||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||
INSERT INTO t2 VALUES (@@global.init_slave);
|
||||
INSERT INTO t2 VALUES (@@hostname);
|
||||
RETURN 0;
|
||||
|
@ -129,6 +132,7 @@ BEGIN
|
|||
INSERT INTO t1 VALUES (@@session.insert_id);
|
||||
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
||||
INSERT INTO t2 SELECT UUID();
|
||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||
INSERT INTO t2 VALUES (@@global.init_slave);
|
||||
INSERT INTO t2 VALUES (@@hostname);
|
||||
END|
|
||||
|
@ -142,10 +146,12 @@ PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)';
|
|||
PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)';
|
||||
PREPARE p3 FROM 'INSERT INTO t1 VALUES (@@global.auto_increment_increment)';
|
||||
PREPARE p4 FROM 'INSERT INTO t2 SELECT UUID()';
|
||||
PREPARE p5 FROM 'INSERT INTO t2 VALUES (@@global.init_slave)';
|
||||
PREPARE p6 FROM 'INSERT INTO t2 VALUES (@@hostname)';
|
||||
PREPARE p5 FROM 'INSERT INTO t2 VALUES (@@session.sql_mode)';
|
||||
PREPARE p6 FROM 'INSERT INTO t2 VALUES (@@global.init_slave)';
|
||||
PREPARE p7 FROM 'INSERT INTO t2 VALUES (@@hostname)';
|
||||
|
||||
EXECUTE p1; EXECUTE p2; EXECUTE p3; EXECUTE p4; EXECUTE p5; EXECUTE p6;
|
||||
EXECUTE p1; EXECUTE p2; EXECUTE p3; EXECUTE p4; EXECUTE p5;
|
||||
EXECUTE p6; EXECUTE p7;
|
||||
|
||||
--echo ---- Insert from nested call of triggers / functions / procedures ----
|
||||
|
||||
|
@ -200,7 +206,6 @@ INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
|
|||
INSERT INTO t1 VALUES (@@session.foreign_key_checks);
|
||||
INSERT INTO t1 VALUES (@@session.sql_auto_is_null);
|
||||
INSERT INTO t1 VALUES (@@session.unique_checks);
|
||||
INSERT INTO t2 VALUES (@@session.sql_mode);
|
||||
INSERT INTO t1 VALUES (@@session.auto_increment_increment);
|
||||
INSERT INTO t1 VALUES (@@session.auto_increment_offset);
|
||||
INSERT INTO t2 VALUES (@@session.character_set_client);
|
||||
|
|
Loading…
Add table
Reference in a new issue