List:Commits« Previous MessageNext Message »
From:He Zhenxing Date:December 11 2010 4:32am
Subject:bzr commit into mysql-5.1-bugteam branch (zhenxing.he:3513) Bug#51638
View as plain text  
#At file:///media/sdb2/hezx/work/mysql/bzr/b51638/5.1-bugteam/ based on revid:luis.soares@stripped

 3513 He Zhenxing	2010-12-11
      BUG#51638 SBR logging warning messages for primary key updates with a LIMIT of 1
      
      UPDATE/DELETE/INSERT..SELECT with LIMIT were marked unsafe
      unconditionally, but if there is a where condition or order by clause
      that can make the result row unique or ordered, then they are
      safe with LIMIT clause.
      
      This patch fixed the the problem of UPDATE/DELETE and INSERT..SELECT
      from single table for the following simple cases:
       - LIMIT 0 will always be safe
       - there is a WHERE condition that can only result in one row,
         for example the condition requires the primary key or a non-
         null unique key to be some constant value.
       - ORDER BY primary key or non-null unique key, and all fields
         length of the key are not longer than MAX_SORT_LENGTH.
      
      The problem of INSERT...SELECT from JOINed tables with LIMIT are
      not fixed in this patch, it will be fixed by patch for BUG#42415.

    added:
      mysql-test/suite/binlog/r/binlog_unsafe_limit.result
      mysql-test/suite/binlog/t/binlog_unsafe_limit.test
    modified:
      mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
      sql/sql_delete.cc
      sql/sql_insert.cc
      sql/sql_select.cc
      sql/sql_select.h
      sql/sql_update.cc
=== modified file 'mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result'
--- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result	2009-07-31 13:00:35 +0000
+++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result	2010-12-11 04:32:35 +0000
@@ -3,11 +3,7 @@ DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 (a int, b int, primary key (a));
 INSERT INTO t1 VALUES (1,2), (2,3);
 UPDATE t1 SET b='4' WHERE a=1 LIMIT 1;
-Warnings:
-Note	1592	Statement may not be safe to log in statement format.
 UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1;
-Warnings:
-Note	1592	Statement may not be safe to log in statement format.
 DROP TABLE t1;
 ### NOT filtered database => assertion: binlog disabled and warnings ARE NOT shown
 SET SQL_LOG_BIN= 0;

=== added file 'mysql-test/suite/binlog/r/binlog_unsafe_limit.result'
--- a/mysql-test/suite/binlog/r/binlog_unsafe_limit.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/binlog/r/binlog_unsafe_limit.result	2010-12-11 04:32:35 +0000
@@ -0,0 +1,2414 @@
+CREATE TABLE t (nokey INT, pk INT PRIMARY KEY, nnuk INT NOT NULL UNIQUE KEY, nuk INT UNIQUE KEY,
+nnuk1 INT NOT NULL, nnuk2 INT NOT NULL, UNIQUE KEY(nnuk1, nnuk2),
+nnuk_str_long VARCHAR(512) NOT NULL UNIQUE KEY,
+nnuk_str_short VARCHAR(50) NOT NULL UNIQUE KEY);
+CREATE TABLE t1 LIKE t;
+CREATE TABLE t2 LIKE t;
+CREATE TABLE t3 LIKE t;
+CREATE TABLE t4 LIKE t;
+CREATE TABLE queries (query VARCHAR(1024) NOT NULL, unsafeness1 INT, unsafeness2 INT);
+CREATE TABLE result_queries (id INT AUTO_INCREMENT PRIMARY KEY,
+query VARCHAR(1024) NOT NULL, unsafe1 BOOL, unsafe2 BOOL DEFAULT FALSE);
+CREATE TABLE limits (`limit` VARCHAR(256) NOT NULL, safeness INT DEFAULT 0);
+INSERT INTO queries VALUES
+('UPDATE t SET nokey = nokey + 10 [LIMIT_1]', 1, 0),
+('UPDATE t SET nokey = nokey + 10 WHERE nokey=1 [LIMIT_1]', 1, 0),
+('UPDATE t SET nokey = nokey + 10 WHERE nuk=1   [LIMIT_1]', 1, 0),
+('UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  [LIMIT_1]', 0, 0),
+('UPDATE t SET nokey = nokey + 10 WHERE pk=1    [LIMIT_1]', 0, 0),
+('DELETE FROM t [LIMIT_1]', 1, 0),
+('DELETE FROM t WHERE nokey=1 [LIMIT_1]', 1, 0),
+('DELETE FROM t WHERE nuk=1   [LIMIT_1]', 1, 0),
+('DELETE FROM t WHERE nnuk=1  [LIMIT_1]', 0, 0),
+('DELETE FROM t WHERE pk=1    [LIMIT_1]', 0, 0),
+('REPLACE INTO t SELECT * FROM t1 [LIMIT_1]', 1, 0),
+('REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 [LIMIT_1]', 1, 0),
+('REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   [LIMIT_1]', 1, 0),
+('REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  [LIMIT_1]', 0, 0),
+('REPLACE INTO t SELECT * FROM t1 WHERE pk=1    [LIMIT_1]', 0, 0),
+('INSERT INTO t SELECT * FROM t1 [LIMIT_1]', 1, 0),
+('INSERT INTO t SELECT * FROM t1 WHERE nokey=1 [LIMIT_1]', 1, 0),
+('INSERT INTO t SELECT * FROM t1 WHERE nuk=1   [LIMIT_1]', 1, 0),
+('INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  [LIMIT_1]', 0, 0),
+('INSERT INTO t SELECT * FROM t1 WHERE pk=1    [LIMIT_1]', 0, 0),
+('INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) [LIMIT_1]', 2, 0),
+('INSERT INTO t (SELECT * FROM t1 [LIMIT_1]) UNION (SELECT * FROM t2)', 1, 0),
+('INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 [LIMIT_1])', 1, 0),
+('INSERT INTO t (SELECT * FROM t1 [LIMIT_1]) UNION (SELECT * FROM t2 [LIMIT_2])', 1, 1),
+('INSERT INTO t (SELECT * FROM t1 [LIMIT_1]) UNION (SELECT * FROM t2) [LIMIT_2]', 1, 2),
+('INSERT INTO t SELECT * FROM (SELECT * FROM t1 [LIMIT_1]) AS subselect [LIMIT_2]', 1, 2);
+INSERT INTO limits (`limit`, safeness) VALUES
+('LIMIT 0', 2),
+('LIMIT 1', 0),
+('ORDER BY nokey LIMIT 1', 0),
+('ORDER BY nuk LIMIT 1', 0),
+('ORDER BY nnuk1 LIMIT 1', 0),
+('ORDER BY nnuk LIMIT 1', 1),
+('ORDER BY nnuk_str_short LIMIT 1', 1),
+('ORDER BY nnuk_str_long LIMIT 1', 0),
+('ORDER BY pk LIMIT 1', 1),
+('ORDER BY nnuk1, nnuk2 LIMIT 1', 1),
+('ORDER BY nnuk1, nnuk2, nokey LIMIT 1', 1),
+('ORDER BY nnuk1, nokey, nnuk2 LIMIT 1', 1);
+CREATE PROCEDURE gen_queries()
+BEGIN
+DECLARE done INT DEFAULT 0;
+DECLARE q VARCHAR(1024);
+DECLARE unsafeness1, unsafeness2 INT;
+DECLARE limit1, limit2 VARCHAR(256);
+DECLARE limit1_safeness, limit2_safeness INT;
+DECLARE qcur CURSOR FOR SELECT * FROM queries;
+DECLARE lcur1 CURSOR FOR SELECT * FROM limits;
+DECLARE lcur2 CURSOR FOR SELECT * FROM limits;
+DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=1;
+OPEN qcur;
+FETCH qcur INTO q, unsafeness1, unsafeness2;
+WHILE done <> 1 DO
+OPEN lcur1;
+FETCH lcur1 INTO limit1, limit1_safeness;
+WHILE done <> 1 DO
+IF LOCATE('[LIMIT_2]', q) > 0 THEN
+OPEN lcur2;
+FETCH lcur2 INTO limit2, limit2_safeness;
+WHILE done <> 1 DO
+SELECT REPLACE(REPLACE(q, '[LIMIT_1]', limit1), '[LIMIT_2]', limit2) INTO @query;
+INSERT INTO result_queries (query, unsafe1, unsafe2) VALUES
+(@query, limit1_safeness < unsafeness1, limit2_safeness < unsafeness2);
+FETCH lcur2 INTO limit2, limit2_safeness;
+END WHILE;
+CLOSE lcur2;
+SET done = 0;
+ELSE
+SELECT REPLACE(q, '[LIMIT_1]', limit1) INTO @query;
+INSERT INTO result_queries (query, unsafe1) VALUES (@query, limit1_safeness < unsafeness1);
+END IF;
+FETCH lcur1 INTO limit1, limit1_safeness;
+END WHILE;
+CLOSE lcur1;
+SET done = 0;
+FETCH qcur INTO q, unsafeness1, unsafeness2;
+END WHILE;
+CLOSE qcur;
+END|
+call gen_queries();
+SET MAX_SORT_LENGTH=50;
+UPDATE t SET nokey = nokey + 10 LIMIT 0;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 LIMIT 0;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nokey=1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   LIMIT 0;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nuk=1   ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  LIMIT 0;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  ORDER BY nokey LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  ORDER BY nuk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  ORDER BY nnuk1 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  ORDER BY nnuk_str_long LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    LIMIT 0;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    ORDER BY nokey LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    ORDER BY nuk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    ORDER BY nnuk1 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    ORDER BY nnuk_str_long LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+UPDATE t SET nokey = nokey + 10 WHERE pk=1    ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+DELETE FROM t LIMIT 0;
+ROWS in table t: 2
+DELETE FROM t LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t ORDER BY nnuk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t ORDER BY pk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 LIMIT 0;
+ROWS in table t: 2
+DELETE FROM t WHERE nokey=1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 ORDER BY nnuk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 ORDER BY pk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nokey=1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   LIMIT 0;
+ROWS in table t: 2
+DELETE FROM t WHERE nuk=1   LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   ORDER BY nnuk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   ORDER BY pk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nuk=1   ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  LIMIT 0;
+ROWS in table t: 2
+DELETE FROM t WHERE nnuk=1  LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  ORDER BY nokey LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  ORDER BY nuk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  ORDER BY nnuk1 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  ORDER BY nnuk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  ORDER BY nnuk_str_long LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  ORDER BY pk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE nnuk=1  ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    LIMIT 0;
+ROWS in table t: 2
+DELETE FROM t WHERE pk=1    LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    ORDER BY nokey LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    ORDER BY nuk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    ORDER BY nnuk1 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    ORDER BY nnuk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    ORDER BY nnuk_str_long LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    ORDER BY pk LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 1
+DELETE FROM t WHERE pk=1    ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 1
+REPLACE INTO t SELECT * FROM t1 LIMIT 0;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 ORDER BY nnuk LIMIT 1;
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 ORDER BY pk LIMIT 1;
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 3
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 LIMIT 0;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   LIMIT 0;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  LIMIT 0;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nokey LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nuk LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk1 LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk_str_long LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    LIMIT 0;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nokey LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nuk LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk1 LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk_str_long LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+REPLACE INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 ORDER BY nnuk LIMIT 1;
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 ORDER BY pk LIMIT 1;
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nokey=1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nuk=1   ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nokey LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nuk LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk1 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk_str_long LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nokey LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nuk LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk1 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk_str_short LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk_str_long LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY pk LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk1, nnuk2 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM t1 WHERE pk=1    ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 LIMIT 0);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+ROWS in table t: 5
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 LIMIT 0);
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 LIMIT 0);
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nokey LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nuk LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1 LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_short LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk_str_long LIMIT 1);
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY pk LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nnuk2, nokey LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1);
+ROWS in table t: 4
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 0) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY pk LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) UNION (SELECT * FROM t2) ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 0) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect LIMIT 0;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect LIMIT 0;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nokey LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect LIMIT 0;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nuk LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect LIMIT 0;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1 LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_short LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect LIMIT 0;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk_str_long LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY pk LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nnuk2, nokey LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect LIMIT 0;
+ROWS in table t: 2
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect ORDER BY nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect ORDER BY nuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk1 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk_str_short LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk_str_long LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect ORDER BY pk LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk1, nnuk2, nokey LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+INSERT INTO t SELECT * FROM (SELECT * FROM t1 ORDER BY nnuk1, nokey, nnuk2 LIMIT 1) AS subselect ORDER BY nnuk1, nokey, nnuk2 LIMIT 1;
+Warnings:
+Note	1592	Statement may not be safe to log in statement format.
+ROWS in table t: 3
+SET MAX_SORT_LENGTH=DEFAULT;
+DROP TABLE t, t1, t2, t3, t4;
+DROP TABLE queries, result_queries, limits;
+DROP PROCEDURE gen_queries;

=== added file 'mysql-test/suite/binlog/t/binlog_unsafe_limit.test'
--- a/mysql-test/suite/binlog/t/binlog_unsafe_limit.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/binlog/t/binlog_unsafe_limit.test	2010-12-11 04:32:35 +0000
@@ -0,0 +1,241 @@
+# ==== Purpose ====
+#
+# Test under what circumstances there is a warning for unsafe
+# statements on the following form:
+#
+# [INSERT...SELECT | REPLACE...SELECT | DELETE | UPDATE] ... ORDER BY ... LIMIT
+#
+# INSERT...SELECT...LIMIT should give a warning because the order of
+# rows may differ between master and slave, so the LIMIT may select a
+# different set of rows on master and slave.  However, if there is an
+# 'ORDER BY primary_key', then the order is known and there should not
+# be any warning.  The same is true for REPLACE...SELECT, DELETE, and
+# UPDATE.  In REPLACE...SELECT and INSERT...SELECT, the select may be
+# compound using UNION or JOIN or subqueries in the FROM clause.  So
+# we test LIMIT in various places in the subqueries.
+#
+# We also test various forms of ORDER BY ... LIMIT. If there is one
+# ORDER BY column and it is a PRIMARY KEY or NOT NULL UNIQUE KEY, then
+# the order is deterministic.  If there is one ORDER BY column and it
+# is neither a PRIMARY KEY nor a NOT NULL UNIQUE KEY, then the order
+# is not deterministic.  If the ORDER BY consists of several columns,
+# and a prefix of the ORDER BY columns is a PRIMARY KEY or NOT NULL
+# UNIQUE KEY, then the order is deterministic.  If the ORDER BY
+# consists of several columns, and no prefix of the ORDER BY COLUMNS
+# is a PRIMARY KEY or NOT NULL UNIQUE KEY, then the order is not
+# deterministic.
+
+source include/have_log_bin.inc;
+source include/have_binlog_format_statement.inc;
+
+#
+# Create the tables for test
+# Where:
+#    - nokey is a column not part of key
+#    - pk is column of the primary key
+#    - nuk is a column of UNIQUE KEY, which can be NULL.
+#    - nnuk is a column of NOT NULL UNIQUE KEY
+#    - nnuk1 and nnuk2 are NOT NULL columns, and togather forms a UNIQUE KEY.
+#    - nnuk_str_long is a VARCHAR UNIQUE KEY column that is longer than MAX_LENGTH_SORT in this test.
+#    - nnuk_str_short is a VARCHAR UNIQUE KEY column that is shorter than MAX_LENGTH_SORT in this test.
+#
+CREATE TABLE t (nokey INT, pk INT PRIMARY KEY, nnuk INT NOT NULL UNIQUE KEY, nuk INT UNIQUE KEY,
+                nnuk1 INT NOT NULL, nnuk2 INT NOT NULL, UNIQUE KEY(nnuk1, nnuk2),
+		nnuk_str_long VARCHAR(512) NOT NULL UNIQUE KEY,
+		nnuk_str_short VARCHAR(50) NOT NULL UNIQUE KEY);
+CREATE TABLE t1 LIKE t;
+CREATE TABLE t2 LIKE t;
+CREATE TABLE t3 LIKE t;
+CREATE TABLE t4 LIKE t;
+
+
+# unsafeness
+#   0: always safe
+#   1: safe when ORDER BY primary key or non-null unique key
+#   2: safe when limit 0
+#
+# unsafeness1/2 is the unsafeness value for the the first and the
+# second (if not exists, the value is 0) SELECT/UPDATE/DELETE/UNION
+# that have LIMIT clause, the safeness of the limit clause must be
+# higher than the unsafeness of the SELECT/UPDATE/DELETE/UNION part.
+
+CREATE TABLE queries (query VARCHAR(1024) NOT NULL, unsafeness1 INT, unsafeness2 INT);
+CREATE TABLE result_queries (id INT AUTO_INCREMENT PRIMARY KEY,
+       	     		     query VARCHAR(1024) NOT NULL, unsafe1 BOOL, unsafe2 BOOL DEFAULT FALSE);
+# safeness
+#   0: ORDER BY normal columns
+#   1: ORDER BY primary key or non-null unique key
+#   2: limit 0
+CREATE TABLE limits (`limit` VARCHAR(256) NOT NULL, safeness INT DEFAULT 0);
+
+#
+# Iterate through the following queries
+#
+# [LIMIT_1] and [LIMIT_2] will iterate over the strings in table `limits`
+#
+INSERT INTO queries VALUES
+	('UPDATE t SET nokey = nokey + 10 [LIMIT_1]', 1, 0),
+	('UPDATE t SET nokey = nokey + 10 WHERE nokey=1 [LIMIT_1]', 1, 0),
+	('UPDATE t SET nokey = nokey + 10 WHERE nuk=1   [LIMIT_1]', 1, 0),
+	('UPDATE t SET nokey = nokey + 10 WHERE nnuk=1  [LIMIT_1]', 0, 0),
+	('UPDATE t SET nokey = nokey + 10 WHERE pk=1    [LIMIT_1]', 0, 0),
+
+	('DELETE FROM t [LIMIT_1]', 1, 0),
+	('DELETE FROM t WHERE nokey=1 [LIMIT_1]', 1, 0),
+	('DELETE FROM t WHERE nuk=1   [LIMIT_1]', 1, 0),
+	('DELETE FROM t WHERE nnuk=1  [LIMIT_1]', 0, 0),
+	('DELETE FROM t WHERE pk=1    [LIMIT_1]', 0, 0),
+
+	('REPLACE INTO t SELECT * FROM t1 [LIMIT_1]', 1, 0),
+	('REPLACE INTO t SELECT * FROM t1 WHERE nokey=1 [LIMIT_1]', 1, 0),
+	('REPLACE INTO t SELECT * FROM t1 WHERE nuk=1   [LIMIT_1]', 1, 0),
+	('REPLACE INTO t SELECT * FROM t1 WHERE nnuk=1  [LIMIT_1]', 0, 0),
+	('REPLACE INTO t SELECT * FROM t1 WHERE pk=1    [LIMIT_1]', 0, 0),
+					 
+	('INSERT INTO t SELECT * FROM t1 [LIMIT_1]', 1, 0),
+	('INSERT INTO t SELECT * FROM t1 WHERE nokey=1 [LIMIT_1]', 1, 0),
+	('INSERT INTO t SELECT * FROM t1 WHERE nuk=1   [LIMIT_1]', 1, 0),
+	('INSERT INTO t SELECT * FROM t1 WHERE nnuk=1  [LIMIT_1]', 0, 0),
+	('INSERT INTO t SELECT * FROM t1 WHERE pk=1    [LIMIT_1]', 0, 0),
+
+	('INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2) [LIMIT_1]', 2, 0),
+	('INSERT INTO t (SELECT * FROM t1 [LIMIT_1]) UNION (SELECT * FROM t2)', 1, 0),
+	('INSERT INTO t (SELECT * FROM t1) UNION (SELECT * FROM t2 [LIMIT_1])', 1, 0),
+	('INSERT INTO t (SELECT * FROM t1 [LIMIT_1]) UNION (SELECT * FROM t2 [LIMIT_2])', 1, 1),
+	('INSERT INTO t (SELECT * FROM t1 [LIMIT_1]) UNION (SELECT * FROM t2) [LIMIT_2]', 1, 2),
+
+	('INSERT INTO t SELECT * FROM (SELECT * FROM t1 [LIMIT_1]) AS subselect [LIMIT_2]', 1, 2);
+
+
+#
+# Let the LIMIT cluase ([LIMIT_1] and [LIMIT_2]) iterate through the following strings:
+#
+INSERT INTO limits (`limit`, safeness) VALUES
+	('LIMIT 0', 2),
+	('LIMIT 1', 0),
+	('ORDER BY nokey LIMIT 1', 0),
+	('ORDER BY nuk LIMIT 1', 0),
+	('ORDER BY nnuk1 LIMIT 1', 0),
+	('ORDER BY nnuk LIMIT 1', 1),
+	('ORDER BY nnuk_str_short LIMIT 1', 1),
+	('ORDER BY nnuk_str_long LIMIT 1', 0),
+	('ORDER BY pk LIMIT 1', 1),
+	('ORDER BY nnuk1, nnuk2 LIMIT 1', 1),
+	('ORDER BY nnuk1, nnuk2, nokey LIMIT 1', 1),
+	('ORDER BY nnuk1, nokey, nnuk2 LIMIT 1', 1);
+	
+
+DELIMITER |;
+
+#
+# This function is used to generate the queries by replace [LIMIT_1]
+# and [LIMIT_2] with values in table `limits` for values in table
+# `queries`. And the result will be save in table `result_queries`.
+#
+
+CREATE PROCEDURE gen_queries()
+BEGIN
+  DECLARE done INT DEFAULT 0;
+  DECLARE q VARCHAR(1024);
+  DECLARE unsafeness1, unsafeness2 INT;
+  DECLARE limit1, limit2 VARCHAR(256);
+  DECLARE limit1_safeness, limit2_safeness INT;
+  DECLARE qcur CURSOR FOR SELECT * FROM queries;
+  DECLARE lcur1 CURSOR FOR SELECT * FROM limits;
+  DECLARE lcur2 CURSOR FOR SELECT * FROM limits;
+  DECLARE CONTINUE HANDLER FOR NOT FOUND SET done=1;
+
+  OPEN qcur;
+
+  FETCH qcur INTO q, unsafeness1, unsafeness2;
+  WHILE done <> 1 DO
+    OPEN lcur1;
+    FETCH lcur1 INTO limit1, limit1_safeness;
+    WHILE done <> 1 DO
+      IF LOCATE('[LIMIT_2]', q) > 0 THEN
+        OPEN lcur2;
+        FETCH lcur2 INTO limit2, limit2_safeness;
+        WHILE done <> 1 DO
+	  SELECT REPLACE(REPLACE(q, '[LIMIT_1]', limit1), '[LIMIT_2]', limit2) INTO @query;
+          INSERT INTO result_queries (query, unsafe1, unsafe2) VALUES
+	  	      		     (@query, limit1_safeness < unsafeness1, limit2_safeness < unsafeness2);
+          FETCH lcur2 INTO limit2, limit2_safeness;
+	END WHILE;
+	CLOSE lcur2;
+	SET done = 0;
+      ELSE
+        SELECT REPLACE(q, '[LIMIT_1]', limit1) INTO @query;
+        INSERT INTO result_queries (query, unsafe1) VALUES (@query, limit1_safeness < unsafeness1);
+      END IF;
+      FETCH lcur1 INTO limit1, limit1_safeness;
+    END WHILE;
+    CLOSE lcur1;
+    SET done = 0;
+    FETCH qcur INTO q, unsafeness1, unsafeness2;
+  END WHILE;
+  CLOSE qcur;
+END|
+
+DELIMITER ;|
+
+call gen_queries();
+
+#
+# Execute the generated queries
+#
+let $count= `SELECT COUNT(*) FROM result_queries`;
+let $id=1;
+SET MAX_SORT_LENGTH=50;
+while (`SELECT $id <= $count`)
+{
+  disable_query_log;
+  TRUNCATE t;
+  TRUNCATE t1;
+  TRUNCATE t2;
+  TRUNCATE t3;
+  TRUNCATE t4;
+
+  # INSERT INTO t VALUES  (1, 1, 1, 1, 1, 1), (2, 2, 2, 2, 2, 2);
+  # INSERT INTO t1 VALUES (3, 3, 3, 3, 3, 3), (4, 4, 4, 4, 4, 4);
+  # INSERT INTO t2 VALUES (5, 5, 5, 5, 5, 5), (6, 6, 6, 6, 6, 6);
+  # INSERT INTO t3 VALUES (7, 7, 7, 7, 7, 7), (8, 8, 8, 8, 8, 8);
+  # INSERT INTO t4 VALUES (9, 9, 9, 9, 9, 9), (10, 10, 10, 10, 10, 10);
+
+  INSERT INTO t VALUES  (1, 1, 1, 1, 1, 1, "a", "a"), (2, 2, 2, 2, 2, 2, "b", "b");
+  INSERT INTO t1 VALUES (3, 3, 3, 3, 3, 3, "c", "c"), (4, 4, 4, 4, 4, 4, "d", "d");
+  INSERT INTO t2 VALUES (5, 5, 5, 5, 5, 5, "e", "e"), (6, 6, 6, 6, 6, 6, "f", "f");
+  INSERT INTO t3 VALUES (7, 7, 7, 7, 7, 7, "g", "g"), (8, 8, 8, 8, 8, 8, "h", "h");
+  INSERT INTO t4 VALUES (9, 9, 9, 9, 9, 9, "i", "i"), (10, 10, 10, 10, 10, 10, "j", "j");
+
+  let $query= `SELECT query FROM result_queries WHERE id=$id`;
+  let $query_unsafe= `SELECT unsafe1 OR unsafe2 FROM result_queries WHERE id=$id`;
+  enable_query_log;
+
+  eval $query;
+  let $warning_count= `SELECT @@warning_count`;
+  if ($query_unsafe)
+  {
+    if (!$warning_count)
+    {
+      die Expect unsafe warnings;
+    }
+  }
+  if (!$query_unsafe)
+  {
+    if ($warning_count)
+    {
+      die Unexpected unsafe warnings;
+    }
+  }
+  let $rows= `SELECT COUNT(*) FROM t`;
+  echo ROWS in table t: $rows;
+  inc $id;
+}
+SET MAX_SORT_LENGTH=DEFAULT;
+
+#
+# Cleanup
+#
+DROP TABLE t, t1, t2, t3, t4;
+DROP TABLE queries, result_queries, limits;
+DROP PROCEDURE gen_queries;

=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc	2010-07-19 09:03:52 +0000
+++ b/sql/sql_delete.cc	2010-12-11 04:32:35 +0000
@@ -93,6 +93,19 @@ bool mysql_delete(THD *thd, TABLE_LIST *
     }
   }
 
+  /*
+    Statement-based replication of DELETE ... LIMIT is not safe as
+    order of rows is not defined unless ORDER BY primary_key, so in
+    mixed mode we go to row-based.
+  */
+  if (thd->lex->current_select->select_limit &&
+      select_lex->select_limit->val_int() &&
+      !is_order_deterministic(table_list, conds, (ORDER*)order->first))
+  {
+    thd->lex->set_stmt_unsafe();
+    thd->set_current_stmt_binlog_row_based_if_mixed();
+  }
+
   const_cond= (!conds || conds->const_item());
   safe_update=test(thd->options & OPTION_SAFE_UPDATES);
   if (safe_update && const_cond)
@@ -476,19 +489,6 @@ int mysql_prepare_delete(THD *thd, TABLE
   DBUG_ENTER("mysql_prepare_delete");
   List<Item> all_fields;
 
-  /*
-    Statement-based replication of DELETE ... LIMIT is not safe as order of
-    rows is not defined, so in mixed mode we go to row-based.
-
-    Note that we may consider a statement as safe if ORDER BY primary_key
-    is present. However it may confuse users to see very similiar statements
-    replicated differently.
-  */
-  if (thd->lex->current_select->select_limit)
-  {
-    thd->lex->set_stmt_unsafe();
-    thd->set_current_stmt_binlog_row_based_if_mixed();
-  }
   thd->lex->allow_sum_func= 0;
   if (setup_tables_and_check_access(thd, &thd->lex->select_lex.context,
                                     &thd->lex->select_lex.top_join_list,

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2010-10-07 08:13:11 +0000
+++ b/sql/sql_insert.cc	2010-12-11 04:32:35 +0000
@@ -2879,19 +2879,6 @@ bool mysql_insert_select_prepare(THD *th
   DBUG_ENTER("mysql_insert_select_prepare");
 
   /*
-    Statement-based replication of INSERT ... SELECT ... LIMIT is not safe
-    as order of rows is not defined, so in mixed mode we go to row-based.
-
-    Note that we may consider a statement as safe if ORDER BY primary_key
-    is present or we SELECT a constant. However it may confuse users to
-    see very similiar statements replicated differently.
-  */
-  if (lex->current_select->select_limit)
-  {
-    lex->set_stmt_unsafe();
-    thd->set_current_stmt_binlog_row_based_if_mixed();
-  }
-  /*
     SELECT_LEX do not belong to INSERT statement, so we can't add WHERE
     clause if table is VIEW
   */

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-11-26 12:51:48 +0000
+++ b/sql/sql_select.cc	2010-12-11 04:32:35 +0000
@@ -918,6 +918,22 @@ JOIN::optimize()
     }
   }
 
+  if (thd->lex->sql_command == SQLCOM_INSERT_SELECT ||
+      thd->lex->sql_command == SQLCOM_REPLACE_SELECT)
+  {
+    /*
+      Statement-based replication of INSERT ... SELECT ... LIMIT is
+      not safe if the order of the result is not deterministic.
+    */
+    if (!thd->lex->is_stmt_unsafe() && select_lex->select_limit &&
+        select_lex->select_limit->val_int() &&
+        !is_order_deterministic(join_list, conds, order))
+    {
+      thd->lex->set_stmt_unsafe();
+      thd->set_current_stmt_binlog_row_based_if_mixed();
+    }
+  }
+
 #ifdef WITH_PARTITION_STORAGE_ENGINE
   {
     TABLE_LIST *tbl;
@@ -17269,6 +17285,236 @@ bool JOIN::change_result(select_result *
   DBUG_RETURN(FALSE);
 }
 
+bool is_cond_equal(COND *cond)
+{
+  if (cond->type() == Item::FUNC_ITEM &&
+      (((Item_func*)cond)->functype() == Item_func::EQ_FUNC ||
+       ((Item_func*)cond)->functype() == Item_func::EQUAL_FUNC))
+    return TRUE;
+  return FALSE;
+}
+
+bool is_cond_mult_equal(COND *cond)
+{
+  if (cond->type() == Item::FUNC_ITEM &&
+      (((Item_func*)cond)->functype() == Item_func::MULT_EQUAL_FUNC))
+    return TRUE;
+  return FALSE;
+}
+
+class Result {
+public:
+  Result(TABLE_LIST* table, COND* cond, ORDER* order);
+  bool is_ordered();
+private:
+  bool is_column_const(Field* field);
+  bool is_column_ordered(Field* field);
+  void add_ordered_columns(ORDER* order);
+  void add_const_equi_columns(COND* cond);
+  void add_const_column(Field* field);
+  void add_ordered_column(Field* field);
+  void add_const_columns(MY_BITMAP* bitmap);
+  void add_ordered_columns(MY_BITMAP* bitmap);
+  bool is_unique_key_const_ordered();
+private:
+  TABLE* table;
+  ulong max_sort_length;
+  MY_BITMAP const_bitmap;
+  MY_BITMAP ordered_bitmap;
+};
+
+inline Result::Result(TABLE_LIST* table_list, COND* cond, ORDER* order)
+{
+  table= table_list->table;
+  bitmap_init(&const_bitmap, NULL, table->s->fields, FALSE);
+  bitmap_init(&ordered_bitmap, NULL, table->s->fields, FALSE);
+  max_sort_length= current_thd->variables.max_sort_length;
+  add_ordered_columns(order);
+  add_const_equi_columns(cond);
+}
+
+inline bool Result::is_column_const(Field* field)
+{
+  return bitmap_is_set(&const_bitmap, field->field_index);
+}
+
+inline bool Result::is_column_ordered(Field* field)
+{
+  return bitmap_is_set(&ordered_bitmap, field->field_index);
+}
+
+inline void Result::add_const_column(Field* field)
+{
+  bitmap_set_bit(&const_bitmap, field->field_index);
+}
+
+inline void Result::add_const_columns(MY_BITMAP* bitmap)
+{
+  bitmap_union(&const_bitmap, bitmap);
+}
+
+inline void Result::add_ordered_column(Field* field)
+{
+  bitmap_set_bit(&ordered_bitmap, field->field_index);
+}
+
+inline void Result::add_ordered_columns(MY_BITMAP* bitmap)
+{
+  bitmap_union(&ordered_bitmap, bitmap);
+}
+
+void Result::add_const_equi_columns(COND* cond)
+{
+  if (!cond)
+    return;
+  if (is_cond_or(cond))
+    return;
+  if (is_cond_and(cond))
+  {
+    List<Item> *args= ((Item_cond*) cond)->argument_list();
+    List_iterator<COND> it(*args);
+    COND *c;
+    while ((c= it++))
+      add_const_equi_columns(c);
+    return;
+  }
+  if (is_cond_equal(cond))
+  {
+    uint i;
+    Field *first_field= NULL;
+    Field *second_field= NULL;
+    Item **args= ((Item_func*)cond)->arguments();
+    uint arg_count= ((Item_func*)cond)->argument_count();
+    bool const_value= FALSE;
+
+    DBUG_ASSERT(arg_count == 2);
+
+    for (i=0; i<arg_count; i++)
+    {
+      if (args[i]->real_item()->type() == Item::FIELD_ITEM)
+      {
+        if (!first_field)
+          first_field= ((Item_field*)args[i]->real_item())->field;
+        else
+          second_field= ((Item_field*)args[i]->real_item())->field;
+      }
+      else if (args[i]->real_item()->basic_const_item())
+      {
+        const_value = TRUE;
+      }
+    }
+    if (first_field && const_value)
+      add_const_column(first_field);
+    return;
+  }
+  if (is_cond_mult_equal(cond))
+  {
+    bool has_const= ((Item_equal*)cond)->get_const();
+    Item_equal_iterator it(*((Item_equal*)cond));
+    Item_field *item;
+    if (has_const)
+    {
+      while ((item= it++))
+        add_const_column(item->field);
+    }
+  }
+  return;
+}
+
+void Result::add_ordered_columns(ORDER* order_arg)
+{
+  ORDER* order= order_arg;
+  for (; order; order=order->next)
+  {
+    if ((*order->item)->real_item()->type() == Item::FIELD_ITEM)
+    {
+      Field *field=((Item_field*) (*order->item)->real_item())->field;
+      /*
+        If the field length is larger than the max_sort_length, then
+        ORDER BY the field will not be guaranteed to be deterministic.
+       */
+      if (field->field_length > max_sort_length)
+        continue;
+      add_ordered_column(field);
+    }
+  }
+}
+
+inline bool Result::is_unique_key_const_ordered()
+{
+  uint key;
+  MY_BITMAP key_set;
+  bitmap_init(&key_set, NULL, table->s->fields, FALSE);
+  for (key=0; key < table->s->keys; key++)
+  {
+    if ((table->s->key_info[key].flags & (HA_NOSAME | HA_NULL_PART_KEY)) == HA_NOSAME)
+    {
+      table->mark_columns_used_by_index_no_reset(key, &key_set);
+      if (bitmap_is_subset(&key_set, &const_bitmap) ||
+          bitmap_is_subset(&key_set, &ordered_bitmap))
+      {
+        bitmap_free(&key_set);
+        return TRUE;
+      }
+      bitmap_clear_all(&key_set);
+    }
+  }
+  bitmap_free(&key_set);
+  return FALSE;
+}
+
+bool Result::is_ordered()
+{
+  if (table->s->primary_key == MAX_KEY && !table->s->uniques)
+    return FALSE;
+  return is_unique_key_const_ordered();
+}
+
+/*
+  Test if the result order is deterministic for a JOIN table list.
+
+  NOTE: this function only handles single table case, does not handler
+  JOIN tables, which will be fixed in BUG#42415.
+
+  @retval FALSE not deterministic
+  @retval TRUE deterministic
+ */
+bool is_order_deterministic(List<TABLE_LIST>* join_list,
+                            COND* cond, ORDER* order)
+{
+  /*
+    join_list->is_empty() means this is a UNION with a global LIMIT,
+    always mark such statements as non-deterministic, although it
+    might be deterministic for some cases (for example, UNION DISTINCT
+    with ORDER BY a unique key of both side of the UNION).
+  */
+  if (join_list->is_empty())
+    return FALSE;
+
+  /* JOINs will be handled in the patch for BUG#42415 */
+  if (join_list->elements > 1)
+    return FALSE;
+  
+  Result result(join_list->head(), cond, order);
+  return result.is_ordered();
+}
+
+/*
+  Test if the result order is deterministic for a single table.
+
+  @retval FALSE not deterministic
+  @retval TRUE deterministic
+ */
+bool is_order_deterministic(TABLE_LIST *table,
+                            COND *cond, ORDER *order)
+{
+  if (order == NULL && cond == NULL)
+    return FALSE;
+
+  Result result(table, cond, order);
+  return result.is_ordered();
+}
+
 /**
   @} (end of group Query_Optimizer)
 */

=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h	2010-08-24 10:44:15 +0000
+++ b/sql/sql_select.h	2010-12-11 04:32:35 +0000
@@ -795,3 +795,5 @@ inline bool optimizer_flag(THD *thd, uin
   return (thd->variables.optimizer_switch & flag);
 }
 
+bool is_order_deterministic(TABLE_LIST *table_list, COND *cond, ORDER *order);
+bool is_order_deterministic(List<TABLE_LIST> *join_list, COND *cond, ORDER *order);

=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc	2010-10-07 08:13:11 +0000
+++ b/sql/sql_update.cc	2010-12-11 04:32:35 +0000
@@ -304,6 +304,19 @@ int mysql_update(THD *thd,
   if (mysql_prepare_update(thd, table_list, &conds, order_num, order))
     DBUG_RETURN(1);
 
+  /*
+    Statement-based replication of UPDATE ... LIMIT is not safe as
+    order of rows is not defined unless ORDER BY primary_key, so in
+    mixed mode we go to row-based.
+  */
+  if (thd->lex->current_select->select_limit &&
+      select_lex->select_limit->val_int() &&
+      !is_order_deterministic(table_list, conds, order))
+  {
+    thd->lex->set_stmt_unsafe();
+    thd->set_current_stmt_binlog_row_based_if_mixed();
+  }
+
   old_covering_keys= table->covering_keys;		// Keys used in WHERE
   /* Check the fields we are going to modify */
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -930,19 +943,6 @@ bool mysql_prepare_update(THD *thd, TABL
   SELECT_LEX *select_lex= &thd->lex->select_lex;
   DBUG_ENTER("mysql_prepare_update");
 
-  /*
-    Statement-based replication of UPDATE ... LIMIT is not safe as order of
-    rows is not defined, so in mixed mode we go to row-based.
-
-    Note that we may consider a statement as safe if ORDER BY primary_key
-    is present. However it may confuse users to see very similiar statements
-    replicated differently.
-  */
-  if (thd->lex->current_select->select_limit)
-  {
-    thd->lex->set_stmt_unsafe();
-    thd->set_current_stmt_binlog_row_based_if_mixed();
-  }
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
   table_list->grant.want_privilege= table->grant.want_privilege= 
     (SELECT_ACL & ~table->grant.privilege);


Attachment: [text/bzr-bundle] bzr/zhenxing.he@sun.com-20101211043235-wxzv4wzt3xby9130.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (zhenxing.he:3513) Bug#51638He Zhenxing11 Dec
  • Re: bzr commit into mysql-5.1-bugteam branch (zhenxing.he:3513) Bug#51638Sven Sandberg18 Jan
    • Re: bzr commit into mysql-5.1-bugteam branch (zhenxing.he:3513)Bug#51638He Zhenxing19 Jan
      • Re: bzr commit into mysql-5.1-bugteam branch (zhenxing.he:3513) Bug#51638Sven Sandberg20 Jan
        • Re: bzr commit into mysql-5.1-bugteam branch (zhenxing.he:3513)Bug#51638He Zhenxing20 Jan