|
|
@ -10,25 +10,25 @@ INSERT DELAYED INTO t1 VALUES (5);
|
|
|
|
---- Insert directly ----
|
|
|
|
---- Insert directly ----
|
|
|
|
INSERT INTO t1 VALUES (@@global.sync_binlog);
|
|
|
|
INSERT INTO t1 VALUES (@@global.sync_binlog);
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
INSERT INTO t1 VALUES (@@session.insert_id);
|
|
|
|
INSERT INTO t1 VALUES (@@session.insert_id);
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
|
|
|
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
INSERT INTO t2 SELECT UUID();
|
|
|
|
INSERT INTO t2 SELECT UUID();
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
INSERT INTO t2 VALUES (@@session.sql_mode);
|
|
|
|
INSERT INTO t2 VALUES (@@session.sql_mode);
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
INSERT INTO t2 VALUES (@@global.init_slave);
|
|
|
|
INSERT INTO t2 VALUES (@@global.init_slave);
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
INSERT INTO t2 VALUES (@@hostname);
|
|
|
|
INSERT INTO t2 VALUES (@@hostname);
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
---- Insert from stored procedure ----
|
|
|
|
---- Insert from stored procedure ----
|
|
|
|
CREATE PROCEDURE proc()
|
|
|
|
CREATE PROCEDURE proc()
|
|
|
|
BEGIN
|
|
|
|
BEGIN
|
|
|
@ -42,13 +42,13 @@ INSERT INTO t2 VALUES (@@hostname);
|
|
|
|
END|
|
|
|
|
END|
|
|
|
|
CALL proc();
|
|
|
|
CALL proc();
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
---- Insert from stored function ----
|
|
|
|
---- Insert from stored function ----
|
|
|
|
CREATE FUNCTION func()
|
|
|
|
CREATE FUNCTION func()
|
|
|
|
RETURNS INT
|
|
|
|
RETURNS INT
|
|
|
@ -66,13 +66,13 @@ SELECT func();
|
|
|
|
func()
|
|
|
|
func()
|
|
|
|
0
|
|
|
|
0
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
---- Insert from trigger ----
|
|
|
|
---- Insert from trigger ----
|
|
|
|
CREATE TRIGGER trig
|
|
|
|
CREATE TRIGGER trig
|
|
|
|
BEFORE INSERT ON trigger_table
|
|
|
|
BEFORE INSERT ON trigger_table
|
|
|
@ -88,14 +88,14 @@ INSERT INTO t2 VALUES (@@hostname);
|
|
|
|
END|
|
|
|
|
END|
|
|
|
|
INSERT INTO trigger_table VALUES ('bye.');
|
|
|
|
INSERT INTO trigger_table VALUES ('bye.');
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
---- Insert from prepared statement ----
|
|
|
|
---- Insert from prepared statement ----
|
|
|
|
PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)';
|
|
|
|
PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)';
|
|
|
|
PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)';
|
|
|
|
PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)';
|
|
|
@ -106,25 +106,25 @@ PREPARE p6 FROM 'INSERT INTO t2 VALUES (@@global.init_slave)';
|
|
|
|
PREPARE p7 FROM 'INSERT INTO t2 VALUES (@@hostname)';
|
|
|
|
PREPARE p7 FROM 'INSERT INTO t2 VALUES (@@hostname)';
|
|
|
|
EXECUTE p1;
|
|
|
|
EXECUTE p1;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
EXECUTE p2;
|
|
|
|
EXECUTE p2;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
EXECUTE p3;
|
|
|
|
EXECUTE p3;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
EXECUTE p4;
|
|
|
|
EXECUTE p4;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
EXECUTE p5;
|
|
|
|
EXECUTE p5;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
EXECUTE p6;
|
|
|
|
EXECUTE p6;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
EXECUTE p7;
|
|
|
|
EXECUTE p7;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
---- Insert from nested call of triggers / functions / procedures ----
|
|
|
|
---- Insert from nested call of triggers / functions / procedures ----
|
|
|
|
CREATE PROCEDURE proc1()
|
|
|
|
CREATE PROCEDURE proc1()
|
|
|
|
INSERT INTO trigger_table VALUES ('ha!')|
|
|
|
|
INSERT INTO trigger_table VALUES ('ha!')|
|
|
|
@ -154,13 +154,13 @@ EXECUTE prep6;
|
|
|
|
func5()
|
|
|
|
func5()
|
|
|
|
0
|
|
|
|
0
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
==== Variables that should *not* be unsafe ====
|
|
|
|
==== 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.pseudo_thread_id);
|
|
|
|
INSERT INTO t1 VALUES (@@session.pseudo_thread_id);
|
|
|
@ -195,16 +195,16 @@ DROP TABLE t1, t2, t3, trigger_table, trigger_table2;
|
|
|
|
CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b));
|
|
|
|
CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b));
|
|
|
|
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
|
|
|
|
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
|
|
|
|
REPLACE INTO t1 SELECT * FROM t1 LIMIT 1;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
UPDATE t1 SET a=1 LIMIT 1;
|
|
|
|
UPDATE t1 SET a=1 LIMIT 1;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
DELETE FROM t1 LIMIT 1;
|
|
|
|
DELETE FROM t1 LIMIT 1;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
CREATE PROCEDURE p1()
|
|
|
|
CREATE PROCEDURE p1()
|
|
|
|
BEGIN
|
|
|
|
BEGIN
|
|
|
|
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
|
|
|
|
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
|
|
|
@ -214,10 +214,10 @@ DELETE FROM t1 LIMIT 1;
|
|
|
|
END|
|
|
|
|
END|
|
|
|
|
CALL p1();
|
|
|
|
CALL p1();
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
DROP PROCEDURE p1;
|
|
|
|
DROP PROCEDURE p1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
DROP TABLE IF EXISTS t1;
|
|
|
|
DROP TABLE IF EXISTS t1;
|
|
|
@ -225,16 +225,16 @@ CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100));
|
|
|
|
INSERT INTO t1 VALUES ('a','b');
|
|
|
|
INSERT INTO t1 VALUES ('a','b');
|
|
|
|
UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
|
|
|
|
UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
DROP TABLE t1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
DROP TABLE IF EXISTS t1, t2;
|
|
|
|
DROP TABLE IF EXISTS t1, t2;
|
|
|
|
CREATE TABLE t1(i INT PRIMARY KEY);
|
|
|
|
CREATE TABLE t1(i INT PRIMARY KEY);
|
|
|
|
CREATE TABLE t2(i INT PRIMARY KEY);
|
|
|
|
CREATE TABLE t2(i INT PRIMARY KEY);
|
|
|
|
CREATE TABLE t3(i INT, ch CHAR(50));
|
|
|
|
CREATE TABLE t3(i INT, ch CHAR(50));
|
|
|
|
"Should issue message Statement is not safe to log in statement format."
|
|
|
|
"Should issue message Statement may not be safe to log in statement format."
|
|
|
|
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
|
|
|
|
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
CREATE FUNCTION func6()
|
|
|
|
CREATE FUNCTION func6()
|
|
|
|
RETURNS INT
|
|
|
|
RETURNS INT
|
|
|
|
BEGIN
|
|
|
|
BEGIN
|
|
|
@ -243,10 +243,10 @@ INSERT INTO t1 VALUES (11);
|
|
|
|
INSERT INTO t1 VALUES (12);
|
|
|
|
INSERT INTO t1 VALUES (12);
|
|
|
|
RETURN 0;
|
|
|
|
RETURN 0;
|
|
|
|
END|
|
|
|
|
END|
|
|
|
|
"Should issue message Statement is not safe to log in statement format only once"
|
|
|
|
"Should issue message Statement may not be safe to log in statement format only once"
|
|
|
|
INSERT INTO t3 VALUES(func6(), UUID());
|
|
|
|
INSERT INTO t3 VALUES(func6(), UUID());
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
"Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements"
|
|
|
|
"Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements"
|
|
|
|
CREATE FUNCTION fun_check_log_bin() RETURNS INT
|
|
|
|
CREATE FUNCTION fun_check_log_bin() RETURNS INT
|
|
|
|
BEGIN
|
|
|
|
BEGIN
|
|
|
@ -259,7 +259,7 @@ SELECT fun_check_log_bin();
|
|
|
|
fun_check_log_bin()
|
|
|
|
fun_check_log_bin()
|
|
|
|
100
|
|
|
|
100
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
"SQL_LOG_BIN should be ON still"
|
|
|
|
"SQL_LOG_BIN should be ON still"
|
|
|
|
SHOW VARIABLES LIKE "SQL_LOG_BIN";
|
|
|
|
SHOW VARIABLES LIKE "SQL_LOG_BIN";
|
|
|
|
Variable_name Value
|
|
|
|
Variable_name Value
|
|
|
@ -315,16 +315,16 @@ CREATE TABLE t1(i INT PRIMARY KEY);
|
|
|
|
CREATE TABLE t2(i INT PRIMARY KEY);
|
|
|
|
CREATE TABLE t2(i INT PRIMARY KEY);
|
|
|
|
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
|
|
|
|
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
INSERT INTO t1 VALUES(@@global.sync_binlog);
|
|
|
|
INSERT INTO t1 VALUES(@@global.sync_binlog);
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
UPDATE t1 SET i = 999 LIMIT 1;
|
|
|
|
UPDATE t1 SET i = 999 LIMIT 1;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
DELETE FROM t1 LIMIT 1;
|
|
|
|
DELETE FROM t1 LIMIT 1;
|
|
|
|
Warnings:
|
|
|
|
Warnings:
|
|
|
|
Note 1592 Statement is not safe to log in statement format.
|
|
|
|
Note 1592 Statement may not be safe to log in statement format.
|
|
|
|
DROP TABLE t1, t2;
|
|
|
|
DROP TABLE t1, t2;
|
|
|
|
SET @@SESSION.SQL_MODE = @save_sql_mode;
|
|
|
|
SET @@SESSION.SQL_MODE = @save_sql_mode;
|
|
|
|
"End of tests"
|
|
|
|
"End of tests"
|
|
|
|