List:Commits« Previous MessageNext Message »
From:Mayank Prasad Date:February 15 2012 3:54pm
Subject:bzr push into mysql-trunk-wl5767 branch (mayank.prasad:3436 to 3437) WL#5767
View as plain text  
 3437 Mayank Prasad	2012-02-15 [merge]
      WL#5767 : Performance Schema, Statements Digest.
      
      Merge : mysql-trunk->mysql-trunk-wl5767

    added:
      mysql-test/suite/innodb/r/innodb_bug-13628249.result
      mysql-test/suite/innodb/t/innodb_bug-13628249.test
      mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result
      mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test
      mysql-test/t/subquery_sj_all-master.opt
      mysql-test/t/subquery_sj_all_bka-master.opt
      mysql-test/t/subquery_sj_all_bka_nixbnl-master.opt
      mysql-test/t/subquery_sj_all_bkaunique-master.opt
      mysql-test/t/subquery_sj_dupsweed-master.opt
      mysql-test/t/subquery_sj_dupsweed_bka-master.opt
      mysql-test/t/subquery_sj_dupsweed_bka_nixbnl-master.opt
      mysql-test/t/subquery_sj_dupsweed_bkaunique-master.opt
      mysql-test/t/subquery_sj_firstmatch-master.opt
      mysql-test/t/subquery_sj_firstmatch_bka-master.opt
      sql/global_threads.h
    modified:
      client/mysqldump.c
      include/violite.h
      mysql-test/include/icp_tests.inc
      mysql-test/r/create-big.result
      mysql-test/r/derived.result
      mysql-test/r/group_by.result
      mysql-test/r/innodb_icp.result
      mysql-test/r/innodb_icp_all.result
      mysql-test/r/innodb_icp_none.result
      mysql-test/r/lock.result
      mysql-test/r/multi_update.result
      mysql-test/r/myisam_icp.result
      mysql-test/r/myisam_icp_all.result
      mysql-test/r/myisam_icp_none.result
      mysql-test/r/query_cache.result
      mysql-test/r/sp-code.result
      mysql-test/r/type_blob.result
      mysql-test/suite/engines/funcs/r/datetime_function.result
      mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result
      mysql-test/suite/funcs_1/r/myisam_views-big.result
      mysql-test/suite/innodb/r/innodb_monitor.result
      mysql-test/suite/innodb/t/innodb_bug53756.test
      mysql-test/suite/opt_trace/include/general.inc
      mysql-test/suite/opt_trace/include/general2.inc
      mysql-test/suite/opt_trace/include/subquery.inc
      mysql-test/suite/opt_trace/r/general2_no_prot.result
      mysql-test/suite/opt_trace/r/general2_ps_prot.result
      mysql-test/suite/opt_trace/r/general_no_prot_all.result
      mysql-test/suite/opt_trace/r/general_no_prot_none.result
      mysql-test/suite/opt_trace/r/general_ps_prot_all.result
      mysql-test/suite/opt_trace/r/general_ps_prot_none.result
      mysql-test/suite/opt_trace/r/subquery_no_prot.result
      mysql-test/suite/opt_trace/r/subquery_ps_prot.result
      mysql-test/suite/perfschema/r/threads_innodb.result
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
      mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
      mysql-test/suite/rpl/r/rpl_parallel_temp_query.result
      mysql-test/suite/rpl/t/rpl_parallel_temp_query.test
      mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
      mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
      mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
      mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
      mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
      mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
      mysql-test/t/create-big.test
      mysql-test/t/derived.test
      mysql-test/t/disabled.def
      mysql-test/t/group_by.test
      mysql-test/t/lock.test
      mysql-test/t/multi_update.test
      mysql-test/t/query_cache.test
      mysql-test/t/type_blob.test
      sql-common/my_time.c
      sql/event_scheduler.cc
      sql/keycaches.cc
      sql/keycaches.h
      sql/lex.h
      sql/mysqld.cc
      sql/mysqld.h
      sql/rpl_master.cc
      sql/signal_handler.cc
      sql/sql_base.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_insert.cc
      sql/sql_list.h
      sql/sql_optimizer.cc
      sql/sql_parse.cc
      sql/sql_select.cc
      sql/sql_show.cc
      sql/sql_test.cc
      sql/sql_tmp_table.cc
      sql/sql_yacc.yy
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/srv0mon.h
      storage/innobase/include/srv0srv.h
      storage/innobase/include/trx0purge.h
      storage/innobase/lock/lock0lock.cc
      storage/innobase/log/log0log.cc
      storage/innobase/log/log0recv.cc
      storage/innobase/srv/srv0mon.cc
      storage/innobase/srv/srv0srv.cc
      storage/innobase/srv/srv0start.cc
      storage/innobase/trx/trx0purge.cc
      storage/innobase/trx/trx0roll.cc
      storage/innobase/trx/trx0sys.cc
      storage/innobase/trx/trx0trx.cc
      tests/mysql_client_test.c
      unittest/gunit/sql_list-t.cc
      vio/vio.c
      vio/viosocket.c
 3436 Mayank Prasad	2012-02-15
      WL#5767 : Performance Schema, Statements Digest.
      
      Details:
       - Added code to collect digest only for successful statements.
       - Modified table events_statements_summary_by_digest definition 
         as per modifed specs.
       - Modified test result accordingly.

    modified:
      mysql-test/suite/perfschema/r/table_schema.result
      scripts/mysql_system_tables.sql
      storage/perfschema/pfs.cc
=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2012-01-17 03:54:44 +0000
+++ b/client/mysqldump.c	2012-02-13 15:23:37 +0000
@@ -2501,7 +2501,7 @@ static uint get_table_structure(char *ta
   verbose_msg("-- Retrieving table structure for table %s...\n", table);
 
   len= my_snprintf(query_buff, sizeof(query_buff),
-                   "SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
+                   "SET SQL_QUOTE_SHOW_CREATE=%d",
                    (opt_quoted || opt_keywords));
   if (!create_options)
     strmov(query_buff+len,
@@ -5172,7 +5172,7 @@ static my_bool get_view_structure(char *
   verbose_msg("-- Retrieving view structure for table %s...\n", table);
 
 #ifdef NOT_REALLY_USED_YET
-  sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
+  sprintf(insert_pat,"SET SQL_QUOTE_SHOW_CREATE=%d",
           (opt_quoted || opt_keywords));
 #endif
 

=== modified file 'include/violite.h'
--- a/include/violite.h	2011-08-19 15:18:57 +0000
+++ b/include/violite.h	2012-02-15 07:20:32 +0000
@@ -54,6 +54,7 @@ enum enum_vio_io_event
 #define VIO_LOCALHOST 1                         /* a localhost connection */
 #define VIO_BUFFERED_READ 2                     /* use buffered read */
 #define VIO_READ_BUFFER_SIZE 16384              /* size of read buffer */
+#define VIO_DESCRIPTION_SIZE 30                 /* size of description */
 
 Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
 Vio*  mysql_socket_vio_new(MYSQL_SOCKET mysql_socket, enum enum_vio_type type, uint flags);
@@ -214,7 +215,11 @@ struct st_vio
   struct sockaddr_storage	remote;		/* Remote internet address */
   int addrLen;                          /* Length of remote address */
   enum enum_vio_type	type;		/* Type of connection */
-  char			desc[30];	/* String description */
+  char			desc[VIO_DESCRIPTION_SIZE]; /* Description string. This
+                                                      member MUST NOT be
+                                                      used directly, but only
+                                                      via function
+                                                      "vio_description" */
   char                  *read_buffer;   /* buffer for vio_read_buff */
   char                  *read_pos;      /* start of unfetched data in the
                                            read buffer */

=== modified file 'mysql-test/include/icp_tests.inc'
--- a/mysql-test/include/icp_tests.inc	2012-02-08 15:25:17 +0000
+++ b/mysql-test/include/icp_tests.inc	2012-02-14 14:42:12 +0000
@@ -1119,3 +1119,34 @@ CALL proc1(15);
 DROP PROCEDURE proc1;
 
 DROP TABLE t1, t2;
+
+--echo #
+--echo # Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+--echo #
+
+CREATE TABLE t1 (
+  i1 INTEGER NOT NULL,
+  i2 INTEGER NOT NULL,
+  KEY (i1)
+);
+
+INSERT INTO t1 VALUES (4,4), (5,5);
+
+CREATE TABLE t2 (
+  pk INTEGER NOT NULL,
+  PRIMARY KEY (pk)
+);
+
+INSERT INTO t2 VALUES (1);
+
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+
+let query=
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+
+eval EXPLAIN $query;
+eval $query;
+
+DROP FUNCTION f1;
+DROP TABLE t1, t2;

=== modified file 'mysql-test/r/create-big.result'
--- a/mysql-test/r/create-big.result	2011-11-22 10:57:11 +0000
+++ b/mysql-test/r/create-big.result	2012-02-13 10:45:46 +0000
@@ -53,8 +53,8 @@ set debug_sync='create_table_select_befo
 create table t1 select 1 as i;;
 set debug_sync='now WAIT_FOR parked';
 alter table t3 rename to t1;
-ERROR 42S01: Table 't1' already exists
 set debug_sync='now SIGNAL go';
+ERROR 42S01: Table 't1' already exists
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
@@ -65,8 +65,8 @@ set debug_sync='create_table_select_befo
 create table t1 select 1 as i;;
 set debug_sync='now WAIT_FOR parked';
 alter table t3 rename to t1, add k int;
-ERROR 42S01: Table 't1' already exists
 set debug_sync='now SIGNAL go';
+ERROR 42S01: Table 't1' already exists
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (

=== modified file 'mysql-test/r/derived.result'
--- a/mysql-test/r/derived.result	2012-01-30 13:13:15 +0000
+++ b/mysql-test/r/derived.result	2012-02-13 10:42:27 +0000
@@ -1949,3 +1949,16 @@ ORDER BY grandparent.col_varchar_nokey;
 g1
 r
 DROP TABLE t1, t2, t3;
+#
+# Bug#13457552: Crash on instantiating a derived table in a query with
+#               empty result.
+#
+CREATE TABLE t1 ( pk INT, col_blob BLOB ) ENGINE = MyISAM;
+CREATE TABLE t2 ( pk INT, col_blob BLOB ) ENGINE = InnoDB;
+SELECT pk FROM ( SELECT col_blob, pk FROM t2 ) AS A NATURAL JOIN t1;
+pk
+EXPLAIN SELECT pk FROM ( SELECT col_blob, pk FROM t2 ) AS A NATURAL JOIN t1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+2	DERIVED	t2	ALL	NULL	NULL	NULL	NULL	1	
+DROP TABLE t1,t2;

=== modified file 'mysql-test/r/group_by.result'
--- a/mysql-test/r/group_by.result	2012-02-06 12:47:30 +0000
+++ b/mysql-test/r/group_by.result	2012-02-13 15:23:37 +0000
@@ -512,7 +512,7 @@ a	count(*)
 NULL	9
 	3
 b	1
-set option big_tables=1;
+set big_tables=1;
 select a,count(*) from t1 group by a;
 a	count(*)
 NULL	9

=== modified file 'mysql-test/r/innodb_icp.result'
--- a/mysql-test/r/innodb_icp.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/innodb_icp.result	2012-02-14 14:42:12 +0000
@@ -1041,5 +1041,29 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set default_storage_engine= @save_storage_engine;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/innodb_icp_all.result'
--- a/mysql-test/r/innodb_icp_all.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/innodb_icp_all.result	2012-02-14 14:42:12 +0000
@@ -1041,5 +1041,29 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set default_storage_engine= @save_storage_engine;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/innodb_icp_none.result'
--- a/mysql-test/r/innodb_icp_none.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/innodb_icp_none.result	2012-02-14 14:42:12 +0000
@@ -1040,5 +1040,29 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set default_storage_engine= @save_storage_engine;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/lock.result'
--- a/mysql-test/r/lock.result	2011-01-26 22:06:30 +0000
+++ b/mysql-test/r/lock.result	2012-02-13 09:45:43 +0000
@@ -457,5 +457,18 @@ UNLOCK TABLES;
 UNLOCK TABLES;
 DROP TABLE t1, t2;
 #
+# Bug#13586314 - RUNTIME - HIBISCUS: ISSUE DEPRECATION
+# WARNING FOR LOW_PRIORITY MODIFIER
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT);
+# Below statement should return a deprecation warning
+LOCK TABLES t1 LOW_PRIORITY WRITE;
+Warnings:
+Warning	1287	'LOW_PRIORITY WRITE' is deprecated and will be removed in a future release. Please use WRITE instead
+UNLOCK TABLES;
+DROP TABLE t1;
+# End of Bug#13586314
+#
 # End of 6.0 tests.
 #

=== modified file 'mysql-test/r/multi_update.result'
--- a/mysql-test/r/multi_update.result	2011-12-13 14:10:33 +0000
+++ b/mysql-test/r/multi_update.result	2012-02-13 10:12:55 +0000
@@ -1,3 +1,4 @@
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
 drop table if exists t1,t2,t3;
 drop database if exists mysqltest;
 drop view if exists v1;
@@ -605,7 +606,8 @@ a	b
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE t2,t1 SET t2.a=t1.a+2
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
 delete from t1;
 delete from t2;
@@ -617,7 +619,8 @@ ERROR 23000: Duplicate entry '4' for key
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; UPDATE t2,t1  SET t2.a=t2.b where t2.a=t1.a
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
+master-bin.000001	#	Update_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
 drop table t1, t2;
 set @@session.binlog_format= @sav_binlog_format;

=== modified file 'mysql-test/r/myisam_icp.result'
--- a/mysql-test/r/myisam_icp.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/myisam_icp.result	2012-02-14 14:42:12 +0000
@@ -1036,4 +1036,28 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/myisam_icp_all.result'
--- a/mysql-test/r/myisam_icp_all.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/myisam_icp_all.result	2012-02-14 14:42:12 +0000
@@ -1036,4 +1036,28 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/myisam_icp_none.result'
--- a/mysql-test/r/myisam_icp_none.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/myisam_icp_none.result	2012-02-14 14:42:12 +0000
@@ -1035,4 +1035,28 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/query_cache.result'
--- a/mysql-test/r/query_cache.result	2011-11-10 06:37:03 +0000
+++ b/mysql-test/r/query_cache.result	2012-02-13 15:23:37 +0000
@@ -650,14 +650,14 @@ select * from t1;
 a
 1
 2
-SET OPTION SQL_SELECT_LIMIT=1;
+SET SQL_SELECT_LIMIT=1;
 select * from t1;
 a
 1
 show status like "Qcache_queries_in_cache";
 Variable_name	Value
 Qcache_queries_in_cache	2
-SET OPTION SQL_SELECT_LIMIT=DEFAULT;
+SET SQL_SELECT_LIMIT=DEFAULT;
 drop table t1;
 flush query cache;
 reset query cache;

=== modified file 'mysql-test/r/sp-code.result'
--- a/mysql-test/r/sp-code.result	2011-09-20 12:13:07 +0000
+++ b/mysql-test/r/sp-code.result	2012-02-13 15:23:37 +0000
@@ -847,7 +847,7 @@ drop procedure if exists p_20906_b;
 create procedure p_20906_a() SET @a=@a+1, @b=@b+1;
 show procedure code p_20906_a;
 Pos	Instruction
-0	stmt 31 "SET @a=@a+1"
+0	stmt 31 "SET  @a=@a+1"
 1	stmt 31 "SET  @b=@b+1"
 set @a=1;
 set @b=1;
@@ -858,7 +858,7 @@ select @a, @b;
 create procedure p_20906_b() SET @a=@a+1, @b=@b+1, @c=@c+1;
 show procedure code p_20906_b;
 Pos	Instruction
-0	stmt 31 "SET @a=@a+1"
+0	stmt 31 "SET  @a=@a+1"
 1	stmt 31 "SET  @b=@b+1"
 2	stmt 31 "SET  @c=@c+1"
 set @a=1;

=== modified file 'mysql-test/r/type_blob.result'
--- a/mysql-test/r/type_blob.result	2011-07-19 15:11:15 +0000
+++ b/mysql-test/r/type_blob.result	2012-02-13 15:23:37 +0000
@@ -232,7 +232,7 @@ HELLO
 HELLO MY
 a
 hello
-set option big_tables=1;
+set big_tables=1;
 select distinct t from t1;
 t
 NULL
@@ -313,7 +313,7 @@ HELLO
 HELLO MY
 a
 hello
-set option big_tables=0;
+set big_tables=0;
 select distinct * from t1;
 t	c	b	d
 NULL	NULL	NULL	NULL

=== modified file 'mysql-test/suite/engines/funcs/r/datetime_function.result'
--- a/mysql-test/suite/engines/funcs/r/datetime_function.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/datetime_function.result	2012-02-14 07:44:23 +0000
@@ -25,7 +25,15 @@ INSERT INTO t3 VALUES('2008-02-29 13:13:
 DROP TABLE t3;
 CREATE TABLE t3(c1 TIME NOT NULL);
 INSERT INTO t3 VALUES('1000-01-01 00:00:00');
+Warnings:
+Note	1265	Data truncated for column 'c1' at row 1
 INSERT INTO t3 VALUES('1999-12-31 23:59:59');
+Warnings:
+Note	1265	Data truncated for column 'c1' at row 1
 INSERT INTO t3 VALUES('2000-01-01 00:00:00');
+Warnings:
+Note	1265	Data truncated for column 'c1' at row 1
 INSERT INTO t3 VALUES('2008-02-29 13:13:13');
+Warnings:
+Note	1265	Data truncated for column 'c1' at row 1
 DROP TABLE t3;

=== modified file 'mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result'
--- a/mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/ld_all_number_string_calendar_types.result	2012-02-14 07:44:23 +0000
@@ -61,6 +61,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -77,6 +81,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -93,6 +101,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -325,6 +337,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -341,6 +357,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -357,6 +377,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -589,6 +613,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -605,6 +633,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -621,6 +653,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -853,6 +889,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -869,6 +909,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -885,6 +929,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1117,6 +1165,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1133,6 +1185,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1149,6 +1205,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1381,6 +1441,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1397,6 +1461,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1413,6 +1481,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1645,6 +1717,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1661,6 +1737,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1677,6 +1757,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1909,6 +1993,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1925,6 +2013,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -1941,6 +2033,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2173,6 +2269,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2189,6 +2289,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2205,6 +2309,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2437,6 +2545,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2453,6 +2565,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2469,6 +2585,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2701,6 +2821,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2717,6 +2841,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2733,6 +2861,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2965,6 +3097,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2981,6 +3117,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -2997,6 +3137,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -3229,6 +3373,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -3245,6 +3393,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -3261,6 +3413,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -3493,6 +3649,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -3509,6 +3669,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -3525,6 +3689,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 CHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -3757,6 +3925,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -3773,6 +3945,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -3789,6 +3965,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4021,6 +4201,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4037,6 +4221,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4053,6 +4241,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4285,6 +4477,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4301,6 +4497,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4317,6 +4517,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4549,6 +4753,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4565,6 +4773,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4581,6 +4793,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4813,6 +5029,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4829,6 +5049,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -4845,6 +5069,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5077,6 +5305,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5093,6 +5325,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5109,6 +5345,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5341,6 +5581,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5357,6 +5601,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5373,6 +5621,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5605,6 +5857,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5621,6 +5877,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5637,6 +5897,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5869,6 +6133,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5885,6 +6153,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -5901,6 +6173,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6133,6 +6409,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6149,6 +6429,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6165,6 +6449,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6397,6 +6685,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6413,6 +6705,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6429,6 +6725,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6661,6 +6961,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6677,6 +6981,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6693,6 +7001,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6925,6 +7237,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6941,6 +7257,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -6957,6 +7277,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7189,6 +7513,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7205,6 +7533,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7221,6 +7553,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARCHAR(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7453,6 +7789,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7469,6 +7809,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7485,6 +7829,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7717,6 +8065,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7733,6 +8085,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7749,6 +8105,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7981,6 +8341,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -7997,6 +8361,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -8013,6 +8381,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -8245,6 +8617,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -8261,6 +8637,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -8277,6 +8657,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -8509,6 +8893,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -8525,6 +8913,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -8541,6 +8933,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -8773,6 +9169,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -8789,6 +9189,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -8805,6 +9209,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9037,6 +9445,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9053,6 +9465,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9069,6 +9485,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9301,6 +9721,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9317,6 +9741,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9333,6 +9761,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9565,6 +9997,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9581,6 +10017,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9597,6 +10037,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9829,6 +10273,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9845,6 +10293,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -9861,6 +10313,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10093,6 +10549,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10109,6 +10569,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10125,6 +10589,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10357,6 +10825,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10373,6 +10845,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10389,6 +10865,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10621,6 +11101,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10637,6 +11121,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10653,6 +11141,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10885,6 +11377,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10901,6 +11397,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -10917,6 +11417,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 BINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11149,6 +11653,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11165,6 +11673,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11181,6 +11693,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11413,6 +11929,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11429,6 +11949,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11445,6 +11969,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11677,6 +12205,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11693,6 +12225,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11709,6 +12245,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11941,6 +12481,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11957,6 +12501,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -11973,6 +12521,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -12205,6 +12757,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -12221,6 +12777,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -12237,6 +12797,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -12469,6 +13033,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -12485,6 +13053,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -12501,6 +13073,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -12733,6 +13309,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -12749,6 +13329,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -12765,6 +13349,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DECIMAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -12997,6 +13585,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13013,6 +13605,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13029,6 +13625,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DEC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13261,6 +13861,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13277,6 +13881,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13293,6 +13901,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FIXED NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13525,6 +14137,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13541,6 +14157,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13557,6 +14177,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 NUMERIC NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13789,6 +14413,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13805,6 +14433,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -13821,6 +14453,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -14053,6 +14689,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -14069,6 +14709,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -14085,6 +14729,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 REAL NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -14317,6 +14965,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -14333,6 +14985,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -14349,6 +15005,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 DOUBLE PRECISION NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -14581,6 +15241,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -14597,6 +15261,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3
@@ -14613,6 +15281,10 @@ c1	c2	c3
 DROP TABLE t1;
 CREATE TABLE t1 (c1 FLOAT NOT NULL PRIMARY KEY, c2 VARBINARY(10), c3 TIME);
 LOAD DATA LOCAL INFILE 'suite/engines/funcs/t/load_simple.inc' INTO TABLE t1 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+Warnings:
+Note	1265	Data truncated for column 'c3' at row 1
+Note	1265	Data truncated for column 'c3' at row 2
+Note	1265	Data truncated for column 'c3' at row 3
 SELECT * INTO OUTFILE '../../tmp/t1.dat' FIELDS ENCLOSED BY '"' OPTIONALLY ENCLOSED BY ':' LINES TERMINATED BY '\r\n' FROM t1;
 SELECT * FROM t1 ORDER BY c1;
 c1	c2	c3

=== modified file 'mysql-test/suite/funcs_1/r/myisam_views-big.result'
--- a/mysql-test/suite/funcs_1/r/myisam_views-big.result	2010-12-31 13:04:32 +0000
+++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result	2012-02-13 11:59:41 +0000
@@ -16091,456 +16091,456 @@ DELETE FROM t1;
 DROP VIEW v3;
 DROP VIEW v2;
 DROP VIEW v1;
-SELECT * FROM t1_results ORDER BY v3_to_v1_options;
+SELECT * FROM t1_results ORDER BY v3_to_v1_options, statement, v3_to_v1_violation, errno;
 v3_to_v1_options	statement	v3_to_v1_violation	errno
-        <nothing>          -         <nothing>          -         <nothing>         	UPDATE	  _v2_  	0
-        <nothing>          -         <nothing>          -         <nothing>         	INSERT	  _v2_  	0
+        <nothing>          -         <nothing>          -         <nothing>         	INSERT	  _  _  	0
         <nothing>          -         <nothing>          -         <nothing>         	INSERT	  _  _v1	0
+        <nothing>          -         <nothing>          -         <nothing>         	INSERT	  _v2_  	0
         <nothing>          -         <nothing>          -         <nothing>         	UPDATE	  _  _  	0
         <nothing>          -         <nothing>          -         <nothing>         	UPDATE	  _  _v1	0
+        <nothing>          -         <nothing>          -         <nothing>         	UPDATE	  _v2_  	0
         <nothing>          -         <nothing>          -         <nothing>         	UPDATE	v3_  _  	0
-        <nothing>          -         <nothing>          -         <nothing>         	INSERT	  _  _  	0
-        <nothing>          -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _v2_  	0
         <nothing>          -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _  	0
-        <nothing>          -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _v1	0
+        <nothing>          -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _v1	0
+        <nothing>          -         <nothing>          - WITH          CHECK OPTION	INSERT	  _v2_  	0
         <nothing>          -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _  	0
+        <nothing>          -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _v1	0
+        <nothing>          -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _v2_  	0
         <nothing>          -         <nothing>          - WITH          CHECK OPTION	UPDATE	v3_  _  	0
-        <nothing>          -         <nothing>          - WITH          CHECK OPTION	INSERT	  _v2_  	0
-        <nothing>          -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _v1	0
-        <nothing>          -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
         <nothing>          -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
         <nothing>          -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	0
+        <nothing>          -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
         <nothing>          -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
         <nothing>          -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
         <nothing>          -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
         <nothing>          -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	0
-        <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	0
-        <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
-        <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
         <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
-        <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	0
-        <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
+        <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
+        <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
         <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
-        <nothing>          - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	0
+        <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	0
+        <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
+        <nothing>          -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	0
+        <nothing>          - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
+        <nothing>          - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _v1	0
         <nothing>          - WITH          CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
-        <nothing>          - WITH          CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	0
-        <nothing>          - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	0
         <nothing>          - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
-        <nothing>          - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _v1	0
-        <nothing>          - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
-        <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	0
-        <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	0
-        <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
+        <nothing>          - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	0
+        <nothing>          - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	0
+        <nothing>          - WITH          CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	0
+        <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
         <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	0
         <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	0
-        <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
+        <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
         <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	0
+        <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	0
+        <nothing>          - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	0
         <nothing>          - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
-        <nothing>          - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
-        <nothing>          - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
-        <nothing>          - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
         <nothing>          - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	0
         <nothing>          - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
+        <nothing>          - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
+        <nothing>          - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
+        <nothing>          - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
         <nothing>          - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	0
-        <nothing>          - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	0
         <nothing>          - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
-        <nothing>          - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
         <nothing>          - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
+        <nothing>          - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
         <nothing>          - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
         <nothing>          - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	0
         <nothing>          - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
+        <nothing>          - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	0
+        <nothing>          - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
         <nothing>          - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _v1	0
+        <nothing>          - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
+        <nothing>          - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
         <nothing>          - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	0
         <nothing>          - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	0
-        <nothing>          - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
         <nothing>          - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	0
-        <nothing>          - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
-        <nothing>          - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
-        <nothing>          - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	0
-        <nothing>          - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
+        <nothing>          - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	0
-        <nothing>          - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
+        <nothing>          - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	0
-        <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	0
-        <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
-        <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
+        <nothing>          - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
-        <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
-        <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	0
-        <nothing>          - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
+        <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
+        <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
+        <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
+        <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
+        <nothing>          - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
+        <nothing>          - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
+        <nothing>          - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
         <nothing>          - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	0
-        <nothing>          - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	0
         <nothing>          - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
         <nothing>          - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _v1	0
+        <nothing>          - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
         <nothing>          - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
         <nothing>          - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	0
         <nothing>          - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	0
+        <nothing>          - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	0
         <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
         <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	0
         <nothing>          - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	0
         <nothing>          - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
         <nothing>          - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
         <nothing>          - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
         <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
         <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
-        <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
         <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	0
-WITH          CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	v3_  _  	1369
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
+        <nothing>          - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	0
 WITH          CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _  _  	0
-WITH          CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _v2_  	1369
 WITH          CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _  _v1	1369
-WITH          CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _v2_  	1369
-WITH          CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _  _v1	1369
+WITH          CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _v2_  	1369
 WITH          CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _  _  	0
-WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
-WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
-WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _v2_  	1369
+WITH          CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _  _v1	1369
+WITH          CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _v2_  	1369
+WITH          CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	v3_  _  	1369
+WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _  	0
 WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _v1	1369
+WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _v2_  	1369
 WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _  	0
 WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
-WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _  	0
-WITH          CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
+WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
+WITH          CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
 WITH          CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
-WITH          CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
-WITH          CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
 WITH          CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
+WITH          CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
 WITH          CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
 WITH          CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
+WITH          CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
+WITH          CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
 WITH          CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
-WITH          CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
-WITH          CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
-WITH          CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
 WITH          CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	1369
 WITH          CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	1369
+WITH          CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
+WITH          CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
+WITH          CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
 WITH          CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
+WITH          CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
 WITH          CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _v1	1369
 WITH          CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _v2_  	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
+WITH          CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
 WITH          CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
 WITH          CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	1369
+WITH          CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	1369
 WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	1369
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
 WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
 WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
 WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
 WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
 WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	1369
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
 WITH          CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	1369
 WITH          CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
 WITH          CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
-WITH          CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
+WITH          CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
 WITH          CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
 WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _v1	1369
 WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _v2_  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
 WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	1369
 WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
 WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
 WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
 WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
 WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	1369
 WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
 WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	1369
-WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
+WITH          CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _v1	1369
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _v2_  	1369
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	1369
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _v2_  	1369
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	1369
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	1369
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	1369
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	1369
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	1369
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	1369
-WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
 WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
-WITH CASCADED CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _v2_  	1369
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
+WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
 WITH CASCADED CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _  _  	0
+WITH CASCADED CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _  _v1	1369
+WITH CASCADED CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _v2_  	1369
 WITH CASCADED CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _  _  	0
 WITH CASCADED CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _  _v1	1369
 WITH CASCADED CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _v2_  	1369
 WITH CASCADED CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _  _v1	1369
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _  	0
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _v1	1369
 WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _v2_  	1369
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
 WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _  	0
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _v1	1369
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _  	0
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
 WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
 WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
 WITH CASCADED CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	1369
 WITH CASCADED CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	1369
 WITH CASCADED CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
 WITH CASCADED CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
 WITH CASCADED CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	1369
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _v1	1369
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	1369
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
-WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	1369
 WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	1369
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	1369
+WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
 WITH LOCAL    CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _  _  	0
-WITH LOCAL    CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _v2_  	0
-WITH LOCAL    CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _  _v1	0
-WITH LOCAL    CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _  _v1	0
 WITH LOCAL    CHECK OPTION -         <nothing>          -         <nothing>         	INSERT	  _v2_  	0
+WITH LOCAL    CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _  _  	0
+WITH LOCAL    CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _  _v1	0
+WITH LOCAL    CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	  _v2_  	0
 WITH LOCAL    CHECK OPTION -         <nothing>          -         <nothing>         	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _  	0
-WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _v2_  	0
-WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _v1	0
+WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _  	0
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _v1	0
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _v2_  	0
-WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	INSERT	  _  _  	0
-WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
+WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _  	0
+WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _  _v1	0
+WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	  _v2_  	0
+WITH LOCAL    CHECK OPTION -         <nothing>          - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	0
-WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
-WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
+WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
+WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
+WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
+WITH LOCAL    CHECK OPTION -         <nothing>          - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
-WITH LOCAL    CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	0
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
 WITH LOCAL    CHECK OPTION -         <nothing>          - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	0
-WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
 WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	0
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	0
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _  	0
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _  _v1	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION -         <nothing>         	INSERT	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _  _v1	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	INSERT	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _  	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _  _v1	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH          CHECK OPTION	UPDATE	v3_  _  	1369
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	INSERT	  _v2_  	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _  _v1	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	0
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH CASCADED CHECK OPTION	UPDATE	v3_  _  	1369
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _  	0
-WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _  _v1	0
 WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	INSERT	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _  	0
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _  _v1	0
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	  _v2_  	0
+WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION - WITH LOCAL    CHECK OPTION	UPDATE	v3_  _  	1369
 
 Plausibility checks for INSERTs and UPDATEs ( 4. and 5. above).
 All following SELECTs must give ROW NOT FOUND 

=== added file 'mysql-test/suite/innodb/r/innodb_bug-13628249.result'
--- a/mysql-test/suite/innodb/r/innodb_bug-13628249.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug-13628249.result	2012-02-14 06:30:44 +0000
@@ -0,0 +1,13 @@
+CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES(1), (2), (3), (4);
+SET SESSION debug="+d,crash_commit_before";
+COMMIT;
+ERROR HY000: Lost connection to MySQL server during query
+SELECT * FROM t1;
+c1
+SELECT * FROM t1;
+c1
+SELECT * FROM t1;
+c1
+DROP TABLE t1;

=== modified file 'mysql-test/suite/innodb/r/innodb_monitor.result'
--- a/mysql-test/suite/innodb/r/innodb_monitor.result	2012-02-02 10:48:36 +0000
+++ b/mysql-test/suite/innodb/r/innodb_monitor.result	2012-02-14 06:27:03 +0000
@@ -138,6 +138,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -342,6 +344,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -548,6 +552,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -752,6 +758,8 @@ purge_upd_exist_or_extern_records	0	disa
 purge_invoked	0	disabled
 purge_undo_log_pages	0	disabled
 purge_dml_delay_usec	0	disabled
+purge_stop_count	0	disabled
+purge_resume_count	0	disabled
 log_checkpoints	0	disabled
 log_lsn_last_flush	0	disabled
 log_lsn_last_checkpoint	0	disabled
@@ -1010,6 +1018,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -1214,6 +1224,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -1418,6 +1430,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -1622,6 +1636,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -1826,6 +1842,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled

=== added file 'mysql-test/suite/innodb/t/innodb_bug-13628249.test'
--- a/mysql-test/suite/innodb/t/innodb_bug-13628249.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug-13628249.test	2012-02-15 14:50:33 +0000
@@ -0,0 +1,64 @@
+# This is the test case for bug#13628249. Make sure that InnoDB starts
+# up correctly and is able to shutdown with --innodb-force-recovery >= 3
+# after a crash with active user tranactions.
+
+#
+# Not supported in embedded
+--source include/not_embedded.inc
+
+#
+# This test case needs to crash the server. Needs a debug server.
+--source include/have_debug.inc
+#
+# Don't test this under valgrind, memory leaks will occur.
+--source include/not_valgrind.inc
+#
+# This test case needs InnoDB.
+-- source include/have_innodb.inc
+
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
+
+#
+# Create test data.
+#
+CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES(1), (2), (3), (4);
+
+# Request a crash on next execution of commit.
+SET SESSION debug="+d,crash_commit_before";
+
+# Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart:--innodb-force-recovery=3" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Execute the statement that causes the crash.
+--error 2013
+COMMIT;
+
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+
+SELECT * FROM t1;
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:--innodb-force-recovery=5" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+
+SELECT * FROM t1;
+
+# Restart the server in normal mode now, otherwise the DROP TABLE t1;
+# will cause an assertion failure because essentially it is in read-only
+# mode. For -innodb-force-recovery >= 3 a transaction is not assigned a
+# rollback segment.
+-- source include/restart_mysqld.inc
+
+SELECT * FROM t1;
+
+DROP TABLE t1;

=== modified file 'mysql-test/suite/innodb/t/innodb_bug53756.test'
--- a/mysql-test/suite/innodb/t/innodb_bug53756.test	2011-03-15 15:11:17 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug53756.test	2012-02-15 14:37:06 +0000
@@ -139,6 +139,9 @@ INSERT INTO bug_53756 VALUES (666,666);
 # Request a crash on next execution of commit.
 SET SESSION debug="+d,crash_commit_before";
 #
+# Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+#
 # Execute the statement that causes the crash.
 --error 2013
 COMMIT;
@@ -154,9 +157,6 @@ COMMIT;
 --echo #
 --echo # Restart server.
 #
-# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-#
 # Turn on reconnect
 --enable_reconnect
 #

=== modified file 'mysql-test/suite/opt_trace/include/general.inc'
--- a/mysql-test/suite/opt_trace/include/general.inc	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/include/general.inc	2012-02-14 15:07:11 +0000
@@ -311,7 +311,7 @@ select * from information_schema.OPTIMIZ
 # HAVING
 select t1.a,avg(t2.c) as moyenne from t1, t2 where t2.c>-1
   group by t1.a having moyenne<>0;
---replace_regex /("sort_buffer_size":) [0-9]+/\1 NNN/
+--replace_regex /("sort_buffer_size":) [0-9]+/\1 "NNN"/
 select trace from information_schema.OPTIMIZER_TRACE;
 # impossible HAVING
 select t1.a,avg(t2.c) as moyenne from t1, t2 where t2.c>-1

=== modified file 'mysql-test/suite/opt_trace/include/general2.inc'
--- a/mysql-test/suite/opt_trace/include/general2.inc	2012-01-03 11:04:14 +0000
+++ b/mysql-test/suite/opt_trace/include/general2.inc	2012-02-14 15:07:11 +0000
@@ -156,7 +156,7 @@ SELECT t1.f2 FROM t1
 STRAIGHT_JOIN (t2 JOIN t3 ON t3.f2  = t2.f2  ) ON t3 .f2  = t2 .f2
 HAVING ('v', 'i') NOT IN (SELECT f2, MIN(f2) FROM t1)
 ORDER BY f2;
---replace_regex /("sort_buffer_size":) [0-9]+/\1 NNN/
+--replace_regex /("sort_buffer_size":) [0-9]+/\1 "NNN"/
 select TRACE from information_schema.OPTIMIZER_TRACE;
 
 DROP TABLES t1,t2,t3;
@@ -169,7 +169,7 @@ DROP TABLES t1,t2,t3;
 create table t1 (a int, b int);
 insert into t1 values (1,1), (2,null), (3, 4);
 select max(x) from (select sum(a) as x from t1 group by b) as teeone;
---replace_regex /("sort_buffer_size":) [0-9]+/\1 NNN/
+--replace_regex /("sort_buffer_size":) [0-9]+/\1 "NNN"/
 select TRACE from information_schema.OPTIMIZER_TRACE;
 drop table t1;
 
@@ -613,7 +613,7 @@ SELECT SUM(alias2.col_varchar_nokey) , a
 STRAIGHT_JOIN t2 AS alias2 ON alias2.pk = alias1.col_int_key WHERE alias1.pk
 GROUP BY field2 ORDER BY alias1.col_int_key,alias2.pk ;
 eval $query;
---replace_regex /("sort_buffer_size":) [0-9]+/\1 NNN/
+--replace_regex /("sort_buffer_size":) [0-9]+/\1 "NNN"/
 SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
 
 DROP TABLE t1,t2;

=== modified file 'mysql-test/suite/opt_trace/include/subquery.inc'
--- a/mysql-test/suite/opt_trace/include/subquery.inc	2011-11-18 12:17:45 +0000
+++ b/mysql-test/suite/opt_trace/include/subquery.inc	2012-02-14 15:07:11 +0000
@@ -175,7 +175,7 @@ sq4_alias3.`col_varchar_nokey` <> alias1
 alias1.`col_int_key` not in (214) group by field1,field2,field3,
 field4,field5,field6; 
 
---replace_regex /("sort_buffer_size":) [0-9]+/\1 NNN/
+--replace_regex /("sort_buffer_size":) [0-9]+/\1 "NNN"/
 select * from information_schema.optimizer_trace;
 set optimizer_switch=@old_opt_switch;
 drop table t1,t2,t3,t4,t5;

=== modified file 'mysql-test/suite/opt_trace/r/general2_no_prot.result'
--- a/mysql-test/suite/opt_trace/r/general2_no_prot.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general2_no_prot.result	2012-02-14 15:07:11 +0000
@@ -1164,7 +1164,7 @@ TRACE
               "rows": 4,
               "examined_rows": 4,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }
@@ -1424,7 +1424,7 @@ TRACE
                     "rows": 3,
                     "examined_rows": 3,
                     "number_of_tmp_files": 0,
-                    "sort_buffer_size": NNN,
+                    "sort_buffer_size": "NNN",
                     "sort_mode": "<sort_key, rowid>"
                   } /* filesort_summary */
                 }
@@ -1669,7 +1669,7 @@ insert into t1 values(3)	{
   "steps": [
   ] /* steps */
 }	0	0
-SET @a=(select count(a) from t1 where a>0)	{
+SET  @a=(select count(a) from t1 where a>0)	{
   "steps": [
     {
       "join_preparation": {
@@ -1927,7 +1927,7 @@ jump_if_not 11(15) (case_expr@0 = 2)	{
   "steps": [
   ] /* steps */
 }	0	0
-SET @b=2	{
+SET  @b=2	{
   "steps": [
   ] /* steps */
 }	0	0
@@ -4950,7 +4950,7 @@ GROUP BY field2 ORDER BY alias1.col_int_
               "rows": 8,
               "examined_rows": 8,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/general2_ps_prot.result'
--- a/mysql-test/suite/opt_trace/r/general2_ps_prot.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general2_ps_prot.result	2012-02-14 15:07:11 +0000
@@ -1180,7 +1180,7 @@ TRACE
               "rows": 4,
               "examined_rows": 4,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }
@@ -1440,7 +1440,7 @@ TRACE
                     "rows": 3,
                     "examined_rows": 3,
                     "number_of_tmp_files": 0,
-                    "sort_buffer_size": NNN,
+                    "sort_buffer_size": "NNN",
                     "sort_mode": "<sort_key, rowid>"
                   } /* filesort_summary */
                 }
@@ -1685,7 +1685,7 @@ insert into t1 values(3)	{
   "steps": [
   ] /* steps */
 }	0	0
-SET @a=(select count(a) from t1 where a>0)	{
+SET  @a=(select count(a) from t1 where a>0)	{
   "steps": [
     {
       "join_preparation": {
@@ -1943,7 +1943,7 @@ jump_if_not 11(15) (case_expr@0 = 2)	{
   "steps": [
   ] /* steps */
 }	0	0
-SET @b=2	{
+SET  @b=2	{
   "steps": [
   ] /* steps */
 }	0	0
@@ -5001,7 +5001,7 @@ GROUP BY field2 ORDER BY alias1.col_int_
               "rows": 8,
               "examined_rows": 8,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/general_no_prot_all.result'
--- a/mysql-test/suite/opt_trace/r/general_no_prot_all.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general_no_prot_all.result	2012-02-14 15:07:11 +0000
@@ -6624,7 +6624,7 @@ trace
               "rows": 2,
               "examined_rows": 2,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/general_no_prot_none.result'
--- a/mysql-test/suite/opt_trace/r/general_no_prot_none.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general_no_prot_none.result	2012-02-14 15:07:11 +0000
@@ -5764,7 +5764,7 @@ trace
               "rows": 2,
               "examined_rows": 2,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/general_ps_prot_all.result'
--- a/mysql-test/suite/opt_trace/r/general_ps_prot_all.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general_ps_prot_all.result	2012-02-14 15:07:11 +0000
@@ -6590,7 +6590,7 @@ trace
               "rows": 2,
               "examined_rows": 2,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/general_ps_prot_none.result'
--- a/mysql-test/suite/opt_trace/r/general_ps_prot_none.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general_ps_prot_none.result	2012-02-14 15:07:11 +0000
@@ -5722,7 +5722,7 @@ trace
               "rows": 2,
               "examined_rows": 2,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/subquery_no_prot.result'
--- a/mysql-test/suite/opt_trace/r/subquery_no_prot.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/subquery_no_prot.result	2012-02-14 15:07:11 +0000
@@ -1781,7 +1781,7 @@ field4,field5,field6	{
               "rows": 0,
               "examined_rows": 0,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/subquery_ps_prot.result'
--- a/mysql-test/suite/opt_trace/r/subquery_ps_prot.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/subquery_ps_prot.result	2012-02-14 15:07:11 +0000
@@ -1759,7 +1759,7 @@ field4,field5,field6	{
               "rows": 0,
               "examined_rows": 0,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/perfschema/r/threads_innodb.result'
--- a/mysql-test/suite/perfschema/r/threads_innodb.result	2010-12-06 07:28:45 +0000
+++ b/mysql-test/suite/perfschema/r/threads_innodb.result	2012-02-15 02:19:04 +0000
@@ -11,3 +11,4 @@ thread/innodb/srv_error_monitor_thread	B
 thread/innodb/srv_lock_timeout_thread	BACKGROUND	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	YES
 thread/innodb/srv_master_thread	BACKGROUND	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	YES
 thread/innodb/srv_monitor_thread	BACKGROUND	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	YES
+thread/innodb/srv_purge_thread	BACKGROUND	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	YES

=== modified file 'mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result'
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result	2011-11-19 08:08:03 +0000
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result	2012-02-13 08:50:03 +0000
@@ -864,7 +864,8 @@ master-bin.000001	#	Table_map	#	#	table_
 master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test_rpl`; INSERT INTO t2 SELECT * FROM t1
+master-bin.000001	#	Table_map	#	#	table_id: # (test_rpl.t2)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test_rpl`; INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1'

=== modified file 'mysql-test/suite/rpl/r/rpl_known_bugs_detection.result'
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result	2011-12-26 17:21:34 +0000
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result	2012-02-13 08:50:03 +0000
@@ -49,6 +49,7 @@ ON DUPLICATE KEY UPDATE
 t1.field_3 = t2.field_c;
 Warnings:
 Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.
+Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
 INSERT INTO t2 (field_a, field_b, field_c) VALUES (6, 'f', '6f');
 INSERT INTO t1 (field_1, field_2, field_3)
 SELECT t2.field_a, t2.field_b, t2.field_c
@@ -57,6 +58,7 @@ ON DUPLICATE KEY UPDATE
 t1.field_3 = t2.field_c;
 Warnings:
 Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.
+Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
 SELECT * FROM t1;
 id	field_1	field_2	field_3
 1	1	a	1a

=== modified file 'mysql-test/suite/rpl/r/rpl_parallel_temp_query.result'
--- a/mysql-test/suite/rpl/r/rpl_parallel_temp_query.result	2011-11-19 08:08:03 +0000
+++ b/mysql-test/suite/rpl/r/rpl_parallel_temp_query.result	2012-02-14 06:53:45 +0000
@@ -3,7 +3,7 @@ Warnings:
 Note	1756	Sending passwords in plain text without SSL/TLS is extremely insecure.
 Note	1757	Storing MySQL user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MySQL Manual for more about this issue and possible alternatives.
 [connection master]
-call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table.*');
+call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
 flush status;
 include/stop_slave.inc
 set @save.slave_parallel_workers= @@global.slave_parallel_workers;
@@ -13,18 +13,26 @@ create database d2;
 use d2;
 create table d2.t1 (a int auto_increment primary key, b int) engine=innodb;
 insert into d2.t1 (b) select count(*) from tt_##;
+Warnings:
+Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
 create database d1;
 use d1;
 create table d1.t1 (a int auto_increment primary key, b int) engine=innodb;
 insert into d1.t1 (b) select count(*) from tt_##;
+Warnings:
+Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
 create database d4;
 use d4;
 create table d4.t1 (a int auto_increment primary key, b int) engine=innodb;
 insert into d4.t1 (b) select count(*) from tt_##;
+Warnings:
+Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
 create database d3;
 use d3;
 create table d3.t1 (a int auto_increment primary key, b int) engine=innodb;
 insert into d3.t1 (b) select count(*) from tt_##;
+Warnings:
+Note	1592	Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
 include/diff_tables.inc [master:d4.t1, slave:d4.t1]
 include/diff_tables.inc [master:d3.t1, slave:d3.t1]
 include/diff_tables.inc [master:d2.t1, slave:d2.t1]

=== modified file 'mysql-test/suite/rpl/t/rpl_parallel_temp_query.test'
--- a/mysql-test/suite/rpl/t/rpl_parallel_temp_query.test	2011-08-19 13:04:28 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel_temp_query.test	2012-02-14 06:53:45 +0000
@@ -7,7 +7,7 @@
 --source include/master-slave.inc
 --source include/have_binlog_format_statement.inc
 
-call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table.*');
+call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
 
 let $temp_tables= 16;
 let $workers= 4;

=== added file 'mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result	2012-02-15 04:58:01 +0000
@@ -0,0 +1,43 @@
+SELECT @@GLOBAL.innodb_max_purge_lag_delay;
+@@GLOBAL.innodb_max_purge_lag_delay
+0
+0 Expected
+SET @@GLOBAL.innodb_max_purge_lag_delay=1;
+SELECT COUNT(@@GLOBAL.innodb_max_purge_lag_delay);
+COUNT(@@GLOBAL.innodb_max_purge_lag_delay)
+1
+1 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_purge_lag_delay';
+VARIABLE_VALUE
+1
+1 Expected
+SELECT @@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay;
+@@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay
+1
+1 Expected
+SELECT COUNT(@@innodb_max_purge_lag_delay);
+COUNT(@@innodb_max_purge_lag_delay)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_max_purge_lag_delay);
+ERROR HY000: Variable 'innodb_max_purge_lag_delay' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_max_purge_lag_delay);
+ERROR HY000: Variable 'innodb_max_purge_lag_delay' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT innodb_max_purge_lag_delay = @@SESSION.innodb_max_purge_lag_delay;
+ERROR 42S22: Unknown column 'innodb_max_purge_lag_delay' in 'field list'
+set global innodb_max_purge_lag_delay = -1;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_purge_lag_delay value: '-1'
+set global innodb_max_purge_lag_delay = 1000000;
+set global innodb_max_purge_lag_delay = 10000000;
+set global innodb_max_purge_lag_delay = 100000000;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_purge_lag_delay value: '100000000'
+set global innodb_max_purge_lag_delay = 100000001;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_purge_lag_delay value: '100000001'
+set global innodb_max_purge_lag_delay = 0;

=== modified file 'mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result	2012-02-02 12:26:05 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result	2012-02-14 07:32:57 +0000
@@ -138,6 +138,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -342,6 +344,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -548,6 +552,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -752,6 +758,8 @@ purge_upd_exist_or_extern_records	0	disa
 purge_invoked	0	disabled
 purge_undo_log_pages	0	disabled
 purge_dml_delay_usec	0	disabled
+purge_stop_count	0	disabled
+purge_resume_count	0	disabled
 log_checkpoints	0	disabled
 log_lsn_last_flush	0	disabled
 log_lsn_last_checkpoint	0	disabled
@@ -1010,6 +1018,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -1214,6 +1224,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -1418,6 +1430,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -1622,6 +1636,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -1826,6 +1842,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled

=== modified file 'mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result	2012-02-02 12:26:05 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result	2012-02-14 07:44:56 +0000
@@ -138,6 +138,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -342,6 +344,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -548,6 +552,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -752,6 +758,8 @@ purge_upd_exist_or_extern_records	0	disa
 purge_invoked	0	disabled
 purge_undo_log_pages	0	disabled
 purge_dml_delay_usec	0	disabled
+purge_stop_count	0	disabled
+purge_resume_count	0	disabled
 log_checkpoints	0	disabled
 log_lsn_last_flush	0	disabled
 log_lsn_last_checkpoint	0	disabled
@@ -1010,6 +1018,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -1214,6 +1224,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -1418,6 +1430,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -1622,6 +1636,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -1826,6 +1842,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled

=== modified file 'mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result	2012-02-02 12:26:05 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result	2012-02-14 07:44:56 +0000
@@ -138,6 +138,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -342,6 +344,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -548,6 +552,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -752,6 +758,8 @@ purge_upd_exist_or_extern_records	0	disa
 purge_invoked	0	disabled
 purge_undo_log_pages	0	disabled
 purge_dml_delay_usec	0	disabled
+purge_stop_count	0	disabled
+purge_resume_count	0	disabled
 log_checkpoints	0	disabled
 log_lsn_last_flush	0	disabled
 log_lsn_last_checkpoint	0	disabled
@@ -1010,6 +1018,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -1214,6 +1224,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -1418,6 +1430,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -1622,6 +1636,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -1826,6 +1842,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled

=== modified file 'mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result	2012-02-02 12:26:05 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result	2012-02-14 07:44:56 +0000
@@ -138,6 +138,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -342,6 +344,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -548,6 +552,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -752,6 +758,8 @@ purge_upd_exist_or_extern_records	0	disa
 purge_invoked	0	disabled
 purge_undo_log_pages	0	disabled
 purge_dml_delay_usec	0	disabled
+purge_stop_count	0	disabled
+purge_resume_count	0	disabled
 log_checkpoints	0	disabled
 log_lsn_last_flush	0	disabled
 log_lsn_last_checkpoint	0	disabled
@@ -1010,6 +1018,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -1214,6 +1224,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -1418,6 +1430,8 @@ purge_upd_exist_or_extern_records	enable
 purge_invoked	enabled
 purge_undo_log_pages	enabled
 purge_dml_delay_usec	enabled
+purge_stop_count	enabled
+purge_resume_count	enabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled
@@ -1622,6 +1636,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	disabled
 log_lsn_last_flush	disabled
 log_lsn_last_checkpoint	disabled
@@ -1826,6 +1842,8 @@ purge_upd_exist_or_extern_records	disabl
 purge_invoked	disabled
 purge_undo_log_pages	disabled
 purge_dml_delay_usec	disabled
+purge_stop_count	disabled
+purge_resume_count	disabled
 log_checkpoints	enabled
 log_lsn_last_flush	enabled
 log_lsn_last_checkpoint	enabled

=== modified file 'mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result	2010-04-29 17:43:10 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result	2012-02-15 01:12:54 +0000
@@ -1,53 +1,41 @@
-'#---------------------BS_STVARS_035_01----------------------#'
 SELECT COUNT(@@GLOBAL.innodb_purge_threads);
 COUNT(@@GLOBAL.innodb_purge_threads)
 1
 1 Expected
-'#---------------------BS_STVARS_035_02----------------------#'
-SET @@GLOBAL.innodb_purge_threads=1;
-ERROR HY000: Variable 'innodb_purge_threads' is a read only variable
-Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
-COUNT(@@GLOBAL.innodb_purge_threads)
+SELECT COUNT(@@innodb_purge_threads);
+COUNT(@@innodb_purge_threads)
 1
 1 Expected
-'#---------------------BS_STVARS_035_03----------------------#'
+SET @@GLOBAL.innodb_purge_threads=1;
+ERROR HY000: Variable 'innodb_purge_threads' is a read only variable
+Expected error 'Read-only variable'
+SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
+ERROR 42S22: Unknown column 'innodb_purge_threads' in 'field list'
+Expected error 'Read-only variable'
 SELECT @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_purge_threads';
 @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE
 1
 1 Expected
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
-COUNT(@@GLOBAL.innodb_purge_threads)
-1
-1 Expected
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_purge_threads';
 COUNT(VARIABLE_VALUE)
 1
 1 Expected
-'#---------------------BS_STVARS_035_04----------------------#'
 SELECT @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads;
 @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads
 1
 1 Expected
-'#---------------------BS_STVARS_035_05----------------------#'
-SELECT COUNT(@@innodb_purge_threads);
-COUNT(@@innodb_purge_threads)
-1
-1 Expected
 SELECT COUNT(@@local.innodb_purge_threads);
 ERROR HY000: Variable 'innodb_purge_threads' is a GLOBAL variable
 Expected error 'Variable is a GLOBAL variable'
 SELECT COUNT(@@SESSION.innodb_purge_threads);
 ERROR HY000: Variable 'innodb_purge_threads' is a GLOBAL variable
 Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
-COUNT(@@GLOBAL.innodb_purge_threads)
-1
-1 Expected
-SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
-ERROR 42S22: Unknown column 'innodb_purge_threads' in 'field list'
-Expected error 'Readonly variable'
+SELECT VARIABLE_NAME, VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME = 'innodb_purge_threads';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_PURGE_THREADS	1

=== added file 'mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test'
--- a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test	2012-02-15 04:58:01 +0000
@@ -0,0 +1,43 @@
+# Variable Name: innodb_max_purge_lag_delay
+# Scope: Global                                                               #
+# Access Type: Static                                                         #
+# Data Type: numeric                                                          #
+
+--source include/have_innodb.inc
+
+SELECT @@GLOBAL.innodb_max_purge_lag_delay;
+--echo 0 Expected
+
+SET @@GLOBAL.innodb_max_purge_lag_delay=1;
+
+SELECT COUNT(@@GLOBAL.innodb_max_purge_lag_delay);
+--echo 1 Expected
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_purge_lag_delay';
+--echo 1 Expected
+
+SELECT @@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay;
+--echo 1 Expected
+
+SELECT COUNT(@@innodb_max_purge_lag_delay);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_max_purge_lag_delay);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_max_purge_lag_delay);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_max_purge_lag_delay = @@SESSION.innodb_max_purge_lag_delay;
+
+set global innodb_max_purge_lag_delay = -1;
+set global innodb_max_purge_lag_delay = 1000000;
+set global innodb_max_purge_lag_delay = 10000000;
+set global innodb_max_purge_lag_delay = 100000000;
+set global innodb_max_purge_lag_delay = 100000001;
+set global innodb_max_purge_lag_delay = 0;

=== modified file 'mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test'
--- a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test	2010-04-29 17:43:10 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test	2012-02-15 01:12:54 +0000
@@ -1,89 +1,37 @@
-
-
-################## mysql-test\t\innodb_log_purge_threads_basic.test ###########
-#                                                                             #
-# Variable Name: innodb_purge_threads                                         #
-# Scope: Global                                                               #
-# Access Type: Static                                                         #
-# Data Type: numeric                                                          #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author : Sharique Abdullah                                                      #
-#                                                                             #
-#                                                                             #
-# Description:Test Cases of Dynamic System Variable innodb_purge_threads      #
-#             that checks the behavior of this variable in the following ways #
-#              * Value Check                                                  #
-#              * Scope Check                                                  #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
+# Variable name: innodb_purge_threads
+# Scope: Global
+# Access type: Static
+# Data type: numeric
 
 --source include/have_innodb.inc
 
---echo '#---------------------BS_STVARS_035_01----------------------#'
-####################################################################
-#   Displaying default value                                       #
-####################################################################
 SELECT COUNT(@@GLOBAL.innodb_purge_threads);
 --echo 1 Expected
 
-
---echo '#---------------------BS_STVARS_035_02----------------------#'
-####################################################################
-#   Check if Value can set                                         #
-####################################################################
+SELECT COUNT(@@innodb_purge_threads);
+--echo 1 Expected
 
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
 SET @@GLOBAL.innodb_purge_threads=1;
---echo Expected error 'Read only variable'
-
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
---echo 1 Expected
+--echo Expected error 'Read-only variable'
 
-
-
-
---echo '#---------------------BS_STVARS_035_03----------------------#'
-#################################################################
-# Check if the value in GLOBAL Table matches value in variable  #
-#################################################################
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
+--echo Expected error 'Read-only variable'
 
 SELECT @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_purge_threads';
 --echo 1 Expected
 
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
---echo 1 Expected
-
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_purge_threads';
 --echo 1 Expected
 
-
-
---echo '#---------------------BS_STVARS_035_04----------------------#'
-################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable  #
-################################################################################
 SELECT @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads;
 --echo 1 Expected
 
-
-
---echo '#---------------------BS_STVARS_035_05----------------------#'
-################################################################################
-#   Check if innodb_purge_threads can be accessed with and without @@ sign     #
-################################################################################
-
-SELECT COUNT(@@innodb_purge_threads);
---echo 1 Expected
-
 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
 SELECT COUNT(@@local.innodb_purge_threads);
 --echo Expected error 'Variable is a GLOBAL variable'
@@ -92,11 +40,8 @@ SELECT COUNT(@@local.innodb_purge_thread
 SELECT COUNT(@@SESSION.innodb_purge_threads);
 --echo Expected error 'Variable is a GLOBAL variable'
 
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
---echo 1 Expected
-
---Error ER_BAD_FIELD_ERROR
-SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
---echo Expected error 'Readonly variable'
-
+# Check the default value
+SELECT VARIABLE_NAME, VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME = 'innodb_purge_threads';
 

=== modified file 'mysql-test/t/create-big.test'
--- a/mysql-test/t/create-big.test	2011-11-22 10:57:11 +0000
+++ b/mysql-test/t/create-big.test	2012-02-13 10:45:46 +0000
@@ -132,11 +132,20 @@ set debug_sync='create_table_select_befo
 --send create table t1 select 1 as i;
 connection addconroot1;
 set debug_sync='now WAIT_FOR parked';
---error ER_TABLE_EXISTS_ERROR
-alter table t3 rename to t1;
+--send alter table t3 rename to t1
+connection addconroot2;
+# Wait until the above ALTER TABLE RENAME is blocked due to CREATE
+let $wait_condition=
+    select count(*) = 1 from information_schema.processlist
+    where state = "Waiting for table metadata lock" and
+          info = "alter table t3 rename to t1";
+--source include/wait_condition.inc
 set debug_sync='now SIGNAL go';
 connection default;
 --reap
+connection addconroot1;
+--error ER_TABLE_EXISTS_ERROR
+--reap
 connection default;
 show create table t1;
 drop table t1;
@@ -146,11 +155,21 @@ set debug_sync='create_table_select_befo
 --send create table t1 select 1 as i;
 connection addconroot1;
 set debug_sync='now WAIT_FOR parked';
---error ER_TABLE_EXISTS_ERROR
-alter table t3 rename to t1, add k int;
+--send alter table t3 rename to t1, add k int
+connection addconroot2;
+# Wait until the above ALTER TABLE RENAME is blocked due to CREATE
+let $wait_condition=
+    select count(*) = 1 from information_schema.processlist
+    where state = "Waiting for table metadata lock" and
+          info = "alter table t3 rename to t1, add k int";
+--source include/wait_condition.inc
 set debug_sync='now SIGNAL go';
 connection default;
 --reap
+connection addconroot1;
+--error ER_TABLE_EXISTS_ERROR
+--reap
+connection default;
 show create table t1;
 drop table t1,t3;
 

=== modified file 'mysql-test/t/derived.test'
--- a/mysql-test/t/derived.test	2011-11-30 11:36:14 +0000
+++ b/mysql-test/t/derived.test	2012-02-13 10:42:27 +0000
@@ -1307,3 +1307,14 @@ eval $query;
 
 DROP TABLE t1, t2, t3;
 
+--echo #
+--echo # Bug#13457552: Crash on instantiating a derived table in a query with
+--echo #               empty result.
+--echo #
+CREATE TABLE t1 ( pk INT, col_blob BLOB ) ENGINE = MyISAM;
+CREATE TABLE t2 ( pk INT, col_blob BLOB ) ENGINE = InnoDB;
+SELECT pk FROM ( SELECT col_blob, pk FROM t2 ) AS A NATURAL JOIN t1;
+EXPLAIN SELECT pk FROM ( SELECT col_blob, pk FROM t2 ) AS A NATURAL JOIN t1;
+DROP TABLE t1,t2;
+
+

=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2011-12-05 12:01:10 +0000
+++ b/mysql-test/t/disabled.def	2012-02-15 11:09:43 +0000
@@ -14,3 +14,4 @@ read_many_rows_innodb    : Bug#11748886
 sum_distinct-big         : Bug#11764126 2010-11-15 mattiasj was not tested
 archive-big              : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc
 log_tables-big           : Bug#11756699 2010-11-15 mattiasj report already exists
+events_restart @windows  : Bug#11748899 2012-02-15 agopi The test started failing on windows after the fix for bug#11748899

=== modified file 'mysql-test/t/group_by.test'
--- a/mysql-test/t/group_by.test	2012-01-30 13:57:08 +0000
+++ b/mysql-test/t/group_by.test	2012-02-13 15:23:37 +0000
@@ -390,7 +390,7 @@ drop table t1,t2,t3;
 create table t1 (a blob null);
 insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(""),(""),(""),("b");
 select a,count(*) from t1 group by a;
-set option big_tables=1;
+set big_tables=1;
 select a,count(*) from t1 group by a;
 drop table t1;
 

=== modified file 'mysql-test/t/lock.test'
--- a/mysql-test/t/lock.test	2011-10-19 10:15:25 +0000
+++ b/mysql-test/t/lock.test	2012-02-13 09:45:43 +0000
@@ -550,6 +550,23 @@ UNLOCK TABLES;
 DROP TABLE t1, t2;
 disconnect con2;
 
+--echo #
+--echo # Bug#13586314 - RUNTIME - HIBISCUS: ISSUE DEPRECATION
+--echo # WARNING FOR LOW_PRIORITY MODIFIER
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT);
+--echo # Below statement should return a deprecation warning
+LOCK TABLES t1 LOW_PRIORITY WRITE;
+UNLOCK TABLES;
+DROP TABLE t1;
+
+--echo # End of Bug#13586314
+
 
 --echo #
 --echo # End of 6.0 tests.

=== modified file 'mysql-test/t/multi_update.test'
--- a/mysql-test/t/multi_update.test	2012-02-09 20:26:08 +0000
+++ b/mysql-test/t/multi_update.test	2012-02-13 10:12:55 +0000
@@ -6,6 +6,8 @@
 source include/not_embedded.inc;
 source include/have_log_bin.inc;
 
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+
 --disable_warnings
 drop table if exists t1,t2,t3;
 drop database if exists mysqltest;
@@ -138,6 +140,7 @@ INSERT INTO t2(ParId) VALUES(1), (2), (3
 
 select * from t2;
 
+--disable_warnings ONCE
 UPDATE t2, t1 SET t2.tst = t1.tst, t2.tst1 = t1.tst1 WHERE t2.ParId = t1.Id;
 
 select * from t2;
@@ -295,6 +298,7 @@ drop table t1,t2;
 
 create table t1 (a int not null auto_increment primary key, b int not null);
 insert into t1 (b) values (1),(2),(3),(4);
+--disable_warnings ONCE
 update t1, t1 as t2 set t1.b=t2.b+1 where t1.a=t2.a;
 select * from t1;
 drop table t1;

=== modified file 'mysql-test/t/query_cache.test'
--- a/mysql-test/t/query_cache.test	2011-11-10 06:37:03 +0000
+++ b/mysql-test/t/query_cache.test	2012-02-13 15:23:37 +0000
@@ -438,10 +438,10 @@ create table t1 (a int);
 insert into t1 values (1),(2);
 show status like "Qcache_queries_in_cache";
 select * from t1;
-SET OPTION SQL_SELECT_LIMIT=1;
+SET SQL_SELECT_LIMIT=1;
 select * from t1;
 show status like "Qcache_queries_in_cache";
-SET OPTION SQL_SELECT_LIMIT=DEFAULT;
+SET SQL_SELECT_LIMIT=DEFAULT;
 drop table t1;
 
 #

=== added file 'mysql-test/t/subquery_sj_all-master.opt'
--- a/mysql-test/t/subquery_sj_all-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_all-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_all_bka-master.opt'
--- a/mysql-test/t/subquery_sj_all_bka-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_all_bka-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_all_bka_nixbnl-master.opt'
--- a/mysql-test/t/subquery_sj_all_bka_nixbnl-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_all_bka_nixbnl-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_all_bkaunique-master.opt'
--- a/mysql-test/t/subquery_sj_all_bkaunique-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_all_bkaunique-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_dupsweed-master.opt'
--- a/mysql-test/t/subquery_sj_dupsweed-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_dupsweed-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_dupsweed_bka-master.opt'
--- a/mysql-test/t/subquery_sj_dupsweed_bka-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_dupsweed_bka-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_dupsweed_bka_nixbnl-master.opt'
--- a/mysql-test/t/subquery_sj_dupsweed_bka_nixbnl-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_dupsweed_bka_nixbnl-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_dupsweed_bkaunique-master.opt'
--- a/mysql-test/t/subquery_sj_dupsweed_bkaunique-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_dupsweed_bkaunique-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_firstmatch-master.opt'
--- a/mysql-test/t/subquery_sj_firstmatch-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_firstmatch-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_firstmatch_bka-master.opt'
--- a/mysql-test/t/subquery_sj_firstmatch_bka-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_firstmatch_bka-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== modified file 'mysql-test/t/type_blob.test'
--- a/mysql-test/t/type_blob.test	2010-11-01 09:52:05 +0000
+++ b/mysql-test/t/type_blob.test	2012-02-13 15:23:37 +0000
@@ -112,7 +112,7 @@ select distinct t from t1 order by t;
 select distinct b from t1 order by b;
 select t from t1 group by t;
 select b from t1 group by b;
-set option big_tables=1;
+set big_tables=1;
 select distinct t from t1;
 select distinct b from t1;
 select distinct t from t1 order by t;
@@ -123,7 +123,7 @@ select distinct c from t1 order by c;
 select distinct d from t1 order by d;
 select c from t1 group by c;
 select d from t1 group by d;
-set option big_tables=0;
+set big_tables=0;
 select distinct * from t1;
 select t,count(*) from t1 group by t;
 select b,count(*) from t1 group by b;

=== modified file 'sql-common/my_time.c'
--- a/sql-common/my_time.c	2012-01-24 11:57:25 +0000
+++ b/sql-common/my_time.c	2012-02-14 20:35:05 +0000
@@ -909,6 +909,9 @@ void my_init_time(void)
   my_time.hour=		(uint) l_time->tm_hour;
   my_time.minute=	(uint) l_time->tm_min;
   my_time.second=	(uint) l_time->tm_sec;
+  my_time.time_type= MYSQL_TIMESTAMP_DATETIME;
+  my_time.neg= 0;
+  my_time.second_part= 0;
   my_system_gmt_sec(&my_time, &my_time_zone, &not_used); /* Init my_time_zone */
 }
 

=== modified file 'sql/event_scheduler.cc'
--- a/sql/event_scheduler.cc	2011-10-06 11:06:34 +0000
+++ b/sql/event_scheduler.cc	2012-02-15 13:57:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
 #include "event_db_repository.h"
 #include "sql_connect.h"         // init_new_connection_handler_thread
 #include "sql_acl.h"             // SUPER_ACL
+#include "global_threads.h"
 
 /**
   @addtogroup Event_Scheduler

=== added file 'sql/global_threads.h'
--- a/sql/global_threads.h	1970-01-01 00:00:00 +0000
+++ b/sql/global_threads.h	2012-02-15 13:57:17 +0000
@@ -0,0 +1,28 @@
+/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA */
+
+#ifndef GLOBAL_THREADS_INCLUDED
+#define GLOBAL_THREADS_INCLUDED
+
+/*
+  TODO: Make a proper interface for keeping track of global threads.
+ */
+#include "sql_list.h"
+#include "sql_class.h"
+
+extern I_List<THD> threads;
+extern uint volatile thread_count;
+
+#endif  // GLOBAL_THREADS_INCLUDED

=== modified file 'sql/keycaches.cc'
--- a/sql/keycaches.cc	2011-06-30 15:50:45 +0000
+++ b/sql/keycaches.cc	2012-02-15 13:57:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,33 +21,6 @@
 
 NAMED_ILIST key_caches;
 
-/**
-  ilink (intrusive list element) with a name
-*/
-class NAMED_ILINK :public ilink
-{
-public:
-  const char *name;
-  uint name_length;
-  uchar* data;
-
-  NAMED_ILINK(I_List<NAMED_ILINK> *links, const char *name_arg,
-             uint name_length_arg, uchar* data_arg)
-    :name_length(name_length_arg), data(data_arg)
-  {
-    name= my_strndup(name_arg, name_length, MYF(MY_WME));
-    links->push_back(this);
-  }
-  inline bool cmp(const char *name_cmp, uint length)
-  {
-    return length == name_length && !memcmp(name, name_cmp, length);
-  }
-  ~NAMED_ILINK()
-  {
-    my_free((void *) name);
-  }
-};
-
 uchar* find_named(I_List<NAMED_ILINK> *list, const char *name, uint length,
                 NAMED_ILINK **found)
 {

=== modified file 'sql/keycaches.h'
--- a/sql/keycaches.h	2011-06-30 15:50:45 +0000
+++ b/sql/keycaches.h	2012-02-15 13:57:17 +0000
@@ -24,7 +24,34 @@ extern "C"
   typedef int (*process_key_cache_t) (const char *, KEY_CACHE *);
 }
 
-class NAMED_ILINK;
+/**
+  ilink (intrusive list element) with a name
+*/
+class NAMED_ILINK :public ilink<NAMED_ILINK>
+{
+public:
+  const char *name;
+  uint name_length;
+  uchar* data;
+
+  NAMED_ILINK(I_List<NAMED_ILINK> *links, const char *name_arg,
+             uint name_length_arg, uchar* data_arg)
+    :name_length(name_length_arg), data(data_arg)
+  {
+    name= my_strndup(name_arg, name_length, MYF(MY_WME));
+    links->push_back(this);
+  }
+
+  bool cmp(const char *name_cmp, uint length)
+  {
+    return length == name_length && !memcmp(name, name_cmp, length);
+  }
+
+  ~NAMED_ILINK()
+  {
+    my_free((void *) name);
+  }
+};
 
 class NAMED_ILIST: public I_List<NAMED_ILINK>
 {

=== modified file 'sql/lex.h'
--- a/sql/lex.h	2011-11-04 16:07:37 +0000
+++ b/sql/lex.h	2012-02-13 15:23:37 +0000
@@ -396,7 +396,6 @@ static SYMBOL symbols[] = {
   { "OLD_PASSWORD",	SYM(OLD_PASSWORD)},
   { "ON",		SYM(ON)},
   { "ONE",              SYM(ONE_SYM)},
-  { "ONE_SHOT",		SYM(ONE_SHOT_SYM)},
   { "OPEN",		SYM(OPEN_SYM)},
   { "OPTIMIZE",		SYM(OPTIMIZE)},
   { "OPTIONS",		SYM(OPTIONS_SYM)},

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2012-01-30 05:34:32 +0000
+++ b/sql/mysqld.cc	2012-02-15 13:57:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -71,6 +71,9 @@
 #include "sql_callback.h"
 #include "opt_trace_context.h"
 
+#include "global_threads.h"
+#include "mysqld.h"
+
 #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
 #include "../storage/perfschema/pfs_server.h"
 #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */

=== modified file 'sql/mysqld.h'
--- a/sql/mysqld.h	2012-01-25 10:07:23 +0000
+++ b/sql/mysqld.h	2012-02-15 13:57:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -107,7 +107,6 @@ extern bool opt_ignore_builtin_innodb;
 extern my_bool opt_character_set_client_handshake;
 extern bool volatile abort_loop;
 extern bool in_bootstrap;
-extern uint volatile thread_count;
 extern uint connection_count;
 extern my_bool opt_safe_user_create;
 extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
@@ -233,7 +232,6 @@ extern MYSQL_FILE *bootstrap_file;
 extern my_bool old_mode;
 extern LEX_STRING opt_init_connect, opt_init_slave;
 extern int bootstrap_error;
-extern I_List<THD> threads;
 extern char err_shared_dir[];
 extern TYPELIB thread_handling_typelib;
 extern my_decimal decimal_zero;

=== modified file 'sql/rpl_master.cc'
--- a/sql/rpl_master.cc	2012-01-22 17:00:21 +0000
+++ b/sql/rpl_master.cc	2012-02-15 13:57:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -17,6 +17,7 @@
 #include "sql_priv.h"
 #include "unireg.h"
 #include "sql_parse.h"                          // check_access
+#include "global_threads.h"
 #ifdef HAVE_REPLICATION
 
 #include "sql_acl.h"                            // SUPER_ACL

=== modified file 'sql/signal_handler.cc'
--- a/sql/signal_handler.cc	2011-12-02 13:33:08 +0000
+++ b/sql/signal_handler.cc	2012-02-15 13:57:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
 
 #include "sys_vars.h"
 #include "my_stacktrace.h"
+#include "global_threads.h"
 
 #ifdef __WIN__
 #include <crtdbg.h>

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2012-02-09 20:26:08 +0000
+++ b/sql/sql_base.cc	2012-02-13 08:50:03 +0000
@@ -5854,20 +5854,20 @@ bool lock_tables(THD *thd, TABLE_LIST *t
 	*(ptr++)= table->table;
     }
 
+    /*
+    DML statements that modify a table with an auto_increment column based on
+    rows selected from a table are unsafe as the order in which the rows are
+    fetched fron the select tables cannot be determined and may differ on
+    master and slave.
+    */
+    if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables &&
+        has_write_table_with_auto_increment_and_select(tables))
+      thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT);
+
     /* We have to emulate LOCK TABLES if we are statement needs prelocking. */
     if (thd->lex->requires_prelocking())
     {
 
-    /*
-      DML statements that modify a table with an auto_increment column based on
-      rows selected from a table are unsafe as the order in which the rows are
-      fetched fron the select tables cannot be determined and may differ on
-      master and slave.
-    */
-      if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables &&
-          has_write_table_with_auto_increment_and_select(tables))
-        thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT);
-
       /*
         A query that modifies autoinc column in sub-statement can make the 
         master and slave inconsistent.
@@ -9362,7 +9362,7 @@ has_write_table_with_auto_increment(TABL
 }
 
 /*
-   checks if the tables have select tables in the table list and write tables
+   checks if we have select tables in the table list and write tables
    with auto-increment column.
 
   SYNOPSIS

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2012-02-08 15:25:17 +0000
+++ b/sql/sql_class.cc	2012-02-15 13:57:17 +0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -57,6 +57,8 @@
 #include "sql_parse.h"                          // is_update_query
 #include "sql_callback.h"
 #include "lock.h"
+#include "global_threads.h"
+#include "mysqld.h"
 
 #include <mysql/psi/mysql_statement.h>
 
@@ -2069,17 +2071,6 @@ void THD::close_active_vio()
 #endif
 
 
-struct Item_change_record: public ilink
-{
-  Item **place;
-  Item *old_value;
-  /* Placement new was hidden by `new' in ilink (TODO: check): */
-  static void *operator new(size_t size, void *mem) { return mem; }
-  static void operator delete(void *ptr, size_t size) {}
-  static void operator delete(void *ptr, void *mem) { /* never called */ }
-};
-
-
 /*
   Register an item tree tree transformation, performed by the query
   optimizer. We need a pointer to runtime_memroot because it may be !=

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2012-01-31 15:16:16 +0000
+++ b/sql/sql_class.h	2012-02-15 13:57:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -1052,7 +1052,7 @@ class Server_side_cursor;
   be used explicitly.
 */
 
-class Statement: public ilink, public Query_arena
+class Statement: public Query_arena
 {
   Statement(const Statement &rhs);              /* not implemented: */
   Statement &operator=(const Statement &rhs);   /* non-copyable */
@@ -1205,6 +1205,7 @@ public:
     Close all cursors of this connection that use tables of a storage
     engine that has transaction-specific state and therefore can not
     survive COMMIT or ROLLBACK. Currently all but MyISAM cursors are closed.
+    CURRENTLY NOT IMPLEMENTED!
   */
   void close_transient_cursors();
   void erase(Statement *statement);
@@ -1214,7 +1215,6 @@ public:
 private:
   HASH st_hash;
   HASH names_hash;
-  I_List<Statement> transient_cursor_list;
   Statement *last_found_statement;
 };
 
@@ -1655,7 +1655,12 @@ extern Log_throttle log_throttle_qni;
   yet another time.
 */
 
-struct Item_change_record;
+struct Item_change_record: public ilink<Item_change_record>
+{
+  Item **place;
+  Item *old_value;
+};
+
 typedef I_List<Item_change_record> Item_change_list;
 
 
@@ -2149,7 +2154,8 @@ my_micro_time_to_timeval(ulonglong micro
   a thread/connection descriptor
 */
 
-class THD :public Statement,
+class THD :public ilink<THD>,
+           public Statement,
            public Open_tables_state,
            public MDL_context_owner
 {

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2012-01-31 15:16:16 +0000
+++ b/sql/sql_insert.cc	2012-02-15 13:57:17 +0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -81,6 +81,7 @@
 #include "delayable_insert_operation.h"
 #include "sql_tmp_table.h"    // tmp tables
 #include "sql_optimizer.h"    // JOIN
+#include "global_threads.h"
 
 #include "debug_sync.h"
 
@@ -1838,7 +1839,7 @@ int check_that_all_fields_are_given_valu
 
    @note that custom operator new/delete are inherited from the ilink class.
 */
-class delayed_row :public ilink {
+class delayed_row :public ilink<delayed_row> {
 public:
   char *record;
   enum_duplicates dup;
@@ -1980,7 +1981,7 @@ bool delayed_row::copy_context(THD *thd,
 
    @note that custom operator new/delete are inherited from the ilink class.
 */
-class Delayed_insert :public ilink {
+class Delayed_insert :public ilink<Delayed_insert> {
   uint locks_in_memory;
   thr_lock_type delayed_lock;
 public:

=== modified file 'sql/sql_list.h'
--- a/sql/sql_list.h	2011-10-06 11:06:34 +0000
+++ b/sql/sql_list.h	2012-02-15 13:57:17 +0000
@@ -1,6 +1,6 @@
 #ifndef INCLUDES_MYSQL_SQL_LIST_H
 #define INCLUDES_MYSQL_SQL_LIST_H
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -573,41 +573,43 @@ public:
 };
 
 
+template <typename T> class base_ilist;
+template <typename T> class base_ilist_iterator;
+
 /*
   A simple intrusive list which automaticly removes element from list
   on delete (for THD element)
+  NOTE: this inherently unsafe, since we rely on <T> to have
+  the same layout as ilink<T> (see base_ilist::sentinel).
+  Please consider using a different strategy for linking objects.
 */
 
-struct ilink
+template <typename T>
+class ilink
 {
-  struct ilink **prev,*next;
-  static void *operator new(size_t size) throw ()
-  {
-    return (void*)my_malloc((uint)size, MYF(MY_WME | MY_FAE | ME_FATALERROR));
-  }
-  static void operator delete(void* ptr_arg, size_t size)
-  {
-     my_free(ptr_arg);
-  }
+  T **prev, *next;
+public:
+  ilink() : prev(NULL), next(NULL) {}
 
-  inline ilink()
-  {
-    prev=0; next=0;
-  }
-  inline void unlink()
+  void unlink()
   {
     /* Extra tests because element doesn't have to be linked */
     if (prev) *prev= next;
     if (next) next->prev=prev;
-    prev=0 ; next=0;
+    prev= NULL;
+    next= NULL;
   }
+
   virtual ~ilink() { unlink(); }		/*lint -e1740 */
+
+  friend class base_ilist<T>;
+  friend class base_ilist_iterator<T>;
 };
 
 
 /* Needed to be able to have an I_List of char* strings in mysqld.cc. */
 
-class i_string: public ilink
+class i_string: public ilink<i_string>
 {
 public:
   const char* ptr;
@@ -616,7 +618,7 @@ public:
 };
 
 /* needed for linked list of two strings for replicate-rewrite-db */
-class i_string_pair: public ilink
+class i_string_pair: public ilink<i_string_pair>
 {
 public:
   const char* key;
@@ -630,38 +632,48 @@ public:
 template <class T> class I_List_iterator;
 
 
+template<typename T>
 class base_ilist
 {
-  struct ilink *first;
-  struct ilink last;
+  T *first;
+  ilink<T> sentinel;
 public:
-  inline void empty() { first= &last; last.prev= &first; }
+  void empty() {
+    first= static_cast<T*>(&sentinel);
+    sentinel.prev= &first;
+  }
   base_ilist() { empty(); }
-  inline bool is_empty() {  return first == &last; }
-  inline void push_front(ilink *a)
+  bool is_empty() { return first == static_cast<T*>(&sentinel); }
+
+  /// Pushes new element in front of list.
+  void push_front(T *a)
   {
     first->prev= &a->next;
-    a->next=first; a->prev= &first; first=a;
+    a->next= first;
+    a->prev= &first;
+    first= a;
   }
-  inline void push_back(ilink *a)
+
+  /// Pushes new element to the end of the list, i.e. in front of the sentinel.
+  void push_back(T *a)
   {
-    *last.prev= a;
-    a->next= &last;
-    a->prev= last.prev;
-    last.prev= &a->next;
+    *sentinel.prev= a;
+    a->next= static_cast<T*>(&sentinel);
+    a->prev= sentinel.prev;
+    sentinel.prev= &a->next;
   }
-  inline struct ilink *get()
+
+  // Unlink first element, and return it.
+  T *get()
   {
-    struct ilink *first_link=first;
-    if (first_link == &last)
-      return 0;
-    first_link->unlink();			// Unlink from list
+    if (is_empty())
+      return NULL;
+    T *first_link= first;
+    first_link->unlink();
     return first_link;
   }
-  inline struct ilink *head()
-  {
-    return (first != &last) ? first : 0;
-  }
+
+  T *head() { return is_empty() ? NULL : first; }
 
   /**
     Moves list elements to new owner, and empties current owner (i.e. this).
@@ -674,11 +686,11 @@ public:
   {
     DBUG_ASSERT(new_owner->is_empty());
     new_owner->first= first;
-    new_owner->last= last;
+    new_owner->sentinel= sentinel;
     empty();
   }
 
-  friend class base_ilist_iterator;
+  friend class base_ilist_iterator<T>;
  private:
   /*
     We don't want to allow copying of this class, as that would give us
@@ -690,18 +702,24 @@ public:
 };
 
 
+template<typename T>
 class base_ilist_iterator
 {
-  base_ilist *list;
-  struct ilink **el,*current;
+  base_ilist<T> *list;
+  T **el, *current;
 public:
-  base_ilist_iterator(base_ilist &list_par) :list(&list_par),
-    el(&list_par.first),current(0) {}
-  void *next(void)
+  base_ilist_iterator(base_ilist<T> &list_par) :
+    list(&list_par),
+    el(&list_par.first),
+    current(NULL)
+  {}
+
+  T *next(void)
   {
     /* This is coded to allow push_back() while iterating */
     current= *el;
-    if (current == &list->last) return 0;
+    if (current == static_cast<T*>(&list->sentinel))
+      return NULL;
     el= &current->next;
     return current;
   }
@@ -709,18 +727,17 @@ public:
 
 
 template <class T>
-class I_List :private base_ilist
+class I_List :private base_ilist<T>
 {
 public:
-  I_List() :base_ilist()	{}
-  inline void empty()		{ base_ilist::empty(); }
-  inline bool is_empty()        { return base_ilist::is_empty(); } 
-  inline void push_front(T* a)	{ base_ilist::push_front(a); }
-  inline void push_back(T* a)	{ base_ilist::push_back(a); }
-  inline T* get()		{ return (T*) base_ilist::get(); }
-  inline T* head()		{ return (T*) base_ilist::head(); }
-  inline void move_elements_to(I_List<T>* new_owner) {
-    base_ilist::move_elements_to(new_owner);
+  using base_ilist<T>::empty;
+  using base_ilist<T>::is_empty;
+  using base_ilist<T>::get;
+  using base_ilist<T>::push_front;
+  using base_ilist<T>::push_back;
+  using base_ilist<T>::head;
+  void move_elements_to(I_List<T>* new_owner) {
+    base_ilist<T>::move_elements_to(new_owner);
   }
 #ifndef _lint
   friend class I_List_iterator<T>;
@@ -728,11 +745,12 @@ public:
 };
 
 
-template <class T> class I_List_iterator :public base_ilist_iterator
+template <class T> 
+class I_List_iterator :public base_ilist_iterator<T>
 {
 public:
-  I_List_iterator(I_List<T> &a) : base_ilist_iterator(a) {}
-  inline T* operator++(int) { return (T*) base_ilist_iterator::next(); }
+  I_List_iterator(I_List<T> &a) : base_ilist_iterator<T>(a) {}
+  inline T* operator++(int) { return base_ilist_iterator<T>::next(); }
 };
 
 /**

=== modified file 'sql/sql_optimizer.cc'
--- a/sql/sql_optimizer.cc	2012-02-09 17:07:12 +0000
+++ b/sql/sql_optimizer.cc	2012-02-15 13:57:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -944,7 +944,7 @@ void reset_nj_counters(List<TABLE_LIST>
   Return in cond_value FALSE if condition is impossible (1 = 2)
 *****************************************************************************/
 
-class COND_CMP :public ilink {
+class COND_CMP :public ilink<COND_CMP> {
 public:
   static void *operator new(size_t size)
   {
@@ -3739,24 +3739,31 @@ bool uses_index_fields_only(Item *item,
 
   const Item::Type item_type= item->type();
 
-  /* 
-    Don't push down the triggered conditions. Nested outer joins execution 
-    code may need to evaluate a condition several times (both triggered and
-    untriggered), and there is no way to put thi
-    TODO: Consider cloning the triggered condition and using the copies for:
-      1. push the first copy down, to have most restrictive index condition
-         possible
-      2. Put the second copy into tab->m_condition. 
-  */
-  if (item_type == Item::FUNC_ITEM && 
-      ((Item_func*)item)->functype() == Item_func::TRIG_COND_FUNC)
-    return FALSE;
-
   switch (item_type) {
   case Item::FUNC_ITEM:
     {
-      /* This is a function, apply condition recursively to arguments */
       Item_func *item_func= (Item_func*)item;
+      const Item_func::Functype func_type= item_func->functype();
+
+      /*
+        Avoid some function types from being pushed down to storage engine:
+        - Don't push down the triggered conditions. Nested outer joins
+          execution code may need to evaluate a condition several times
+          (both triggered and untriggered).
+          TODO: Consider cloning the triggered condition and using the
+                copies for: 
+                 1. push the first copy down, to have most restrictive
+                    index condition possible.
+                 2. Put the second copy into tab->m_condition.
+        - Stored functions contain a statement that might start new operations
+          against the storage engine. This does not work against all storage
+          engines.
+      */
+      if (func_type == Item_func::TRIG_COND_FUNC ||
+          func_type == Item_func::FUNC_SP)
+        return false;
+
+      /* This is a function, apply condition recursively to arguments */
       if (item_func->argument_count() > 0)
       {        
         Item **item_end= (item_func->arguments()) + item_func->argument_count();

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2012-02-08 10:30:58 +0000
+++ b/sql/sql_parse.cc	2012-02-15 15:53:33 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -97,6 +97,7 @@
 #include "sql_bootstrap.h"
 #include "opt_explain.h"
 #include "sql_rewrite.h"
+#include "global_threads.h"
 
 #include <algorithm>
 using std::max;

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2012-02-08 15:25:17 +0000
+++ b/sql/sql_select.cc	2012-02-15 10:47:01 +0000
@@ -783,7 +783,8 @@ bool JOIN::prepare_result(List<Item> **c
 
   error= 0;
   /* Create result tables for materialized views. */
-  if (select_lex->handle_derived(thd->lex, &mysql_derived_create))
+  if (!zero_result_cause &&
+      select_lex->handle_derived(thd->lex, &mysql_derived_create))
     goto err;
 
   (void) result->prepare2(); // Currently, this cannot fail.

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2012-02-08 12:49:33 +0000
+++ b/sql/sql_show.cc	2012-02-15 14:01:06 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -57,6 +57,7 @@
 #include "opt_trace.h"     // Optimizer trace information schema tables
 #include "sql_tmp_table.h" // Tmp tables
 #include "sql_optimizer.h" // JOIN
+#include "global_threads.h"
 
 #include <algorithm>
 using std::max;
@@ -1995,7 +1996,7 @@ view_store_create_info(THD *thd, TABLE_L
   returns for each thread: thread id, user, host, db, command, info
 ****************************************************************************/
 
-class thread_info :public ilink {
+class thread_info :public ilink<thread_info> {
 public:
   static void *operator new(size_t size)
   {

=== modified file 'sql/sql_test.cc'
--- a/sql/sql_test.cc	2011-12-14 12:32:55 +0000
+++ b/sql/sql_test.cc	2012-02-15 13:57:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -39,6 +39,8 @@
 #include "events.h"
 #endif
 
+#include "global_threads.h"
+
 static const char *lock_descriptions[] =
 {
   /* TL_UNLOCK                  */  "No lock",

=== modified file 'sql/sql_tmp_table.cc'
--- a/sql/sql_tmp_table.cc	2012-02-10 09:06:59 +0000
+++ b/sql/sql_tmp_table.cc	2012-02-15 10:47:01 +0000
@@ -1647,6 +1647,11 @@ bool create_myisam_tmp_table(TABLE *tabl
   if (share->keys)
   {						// Get keys for ni_create
     bool using_unique_constraint=0;
+    if (share->keys > 1)
+    {
+      DBUG_ASSERT(0); // This code can't handle more than 1 key
+      share->keys= 1;
+    }
     HA_KEYSEG *seg= (HA_KEYSEG*) alloc_root(&table->mem_root,
                                             sizeof(*seg) * keyinfo->key_parts);
     if (!seg)

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2012-02-03 18:09:00 +0000
+++ b/sql/sql_yacc.yy	2012-02-13 15:23:37 +0000
@@ -1227,7 +1227,6 @@ bool my_yyoverflow(short **a, YYSTYPE **
 %token  OFFSET_SYM
 %token  OLD_PASSWORD
 %token  ON                            /* SQL-2003-R */
-%token  ONE_SHOT_SYM
 %token  ONE_SYM
 %token  OPEN_SYM                      /* SQL-2003-R */
 %token  OPTIMIZE
@@ -1526,7 +1525,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
         opt_temporary all_or_any opt_distinct
         opt_ignore_leaves fulltext_options spatial_type union_option
         start_transaction_opts
-        union_opt select_derived_init option_type2
+        union_opt select_derived_init
         opt_natural_language_mode opt_query_expansion
         opt_ev_status opt_ev_on_completion ev_on_completion opt_ev_comment
         ev_alter_on_schedule_completion opt_ev_rename_to opt_ev_sql_stmt
@@ -1661,7 +1660,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
         ref_list opt_match_clause opt_on_update_delete use
         opt_delete_options opt_delete_option varchar nchar nvarchar
         opt_outer table_list table_name table_alias_ref_list table_alias_ref
-        opt_option opt_place
+        opt_place
         opt_attribute opt_attribute_list attribute column_list column_list_id
         opt_column_list grant_privileges grant_ident grant_list grant_option
         object_privilege object_privilege_list user_list rename_list
@@ -13320,7 +13319,7 @@ keyword_sp:
 /* Option functions */
 
 set:
-          SET opt_option
+          SET
           {
             LEX *lex=Lex;
             lex->sql_command= SQLCOM_SET_OPTION;
@@ -13334,11 +13333,6 @@ set:
           {}
         ;
 
-opt_option:
-          /* empty */ {}
-        | OPTION {}
-        ;
-
 option_value_list:
           option_type_value
         | option_value_list ',' option_type_value
@@ -13372,7 +13366,15 @@ option_type_value:
               lex->var_list.empty();
               lex->one_shot_set= 0;
               lex->autocommit= 0;
-              lex->sphead->m_tmp_query= lip->get_tok_start();
+              /*
+                Extract the query statement from the tokenizer.  The
+                start is either lip->ptr, if there was no lookahead,
+                lip->tok_start otherwise.
+              */
+              if (yychar == YYEMPTY)
+                lex->sphead->m_tmp_query= lip->get_ptr();
+              else
+                lex->sphead->m_tmp_query= lip->get_tok_start();
             }
           }
           ext_option_value
@@ -13427,16 +13429,12 @@ option_type_value:
         ;
 
 option_type:
-          option_type2    {}
+          /* empty */ { $$= OPT_DEFAULT; }
         | GLOBAL_SYM  { $$=OPT_GLOBAL; }
         | LOCAL_SYM   { $$=OPT_SESSION; }
         | SESSION_SYM { $$=OPT_SESSION; }
         ;
 
-option_type2:
-          /* empty */ { $$= OPT_DEFAULT; }
-        ;
-
 opt_var_type:
           /* empty */ { $$=OPT_SESSION; }
         | GLOBAL_SYM  { $$=OPT_GLOBAL; }
@@ -13453,7 +13451,7 @@ opt_var_ident_type:
 
 ext_option_value:
           sys_option_value
-        | option_type2 option_value
+        | option_value
         ;
 
 sys_option_value:
@@ -13815,7 +13813,11 @@ table_lock:
 lock_option:
           READ_SYM               { $$= TL_READ_NO_INSERT; }
         | WRITE_SYM              { $$= TL_WRITE_DEFAULT; }
-        | LOW_PRIORITY WRITE_SYM { $$= TL_WRITE_LOW_PRIORITY; }
+        | LOW_PRIORITY WRITE_SYM 
+          { 
+            $$= TL_WRITE_LOW_PRIORITY; 
+            WARN_DEPRECATED(YYTHD, "LOW_PRIORITY WRITE", "WRITE");
+          }
         | READ_SYM LOCAL_SYM     { $$= TL_READ; }
         ;
 

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2012-02-08 13:10:23 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2012-02-15 02:28:36 +0000
@@ -9202,8 +9202,15 @@ ha_innobase::delete_table(
 
 	ut_a(name_len < 1000);
 
-	/* Drop the table in InnoDB */
+	/* Either the transaction is already flagged as a locking transaction
+	or it hasn't been started yet. */
+
+	ut_a(!trx_is_started(trx) || trx->will_lock > 0);
 
+	/* We are doing a DDL operation. */
+	++trx->will_lock;
+
+	/* Drop the table in InnoDB */
 	error = row_drop_table_for_mysql(norm_name, trx,
 					 thd_sql_command(thd)
 					 == SQLCOM_DROP_DB);
@@ -9313,6 +9320,14 @@ innobase_drop_database(
 #endif
 	trx = innobase_trx_allocate(thd);
 
+	/* Either the transaction is already flagged as a locking transaction
+	or it hasn't been started yet. */
+
+	ut_a(!trx_is_started(trx) || trx->will_lock > 0);
+
+	/* We are doing a DDL operation. */
+	++trx->will_lock;
+
 	row_drop_database_for_mysql(namebuf, trx);
 
 	my_free(namebuf);
@@ -9362,6 +9377,11 @@ innobase_rename_table(
 		row_mysql_lock_data_dictionary(trx);
 	}
 
+	/* Transaction must be flagged as a locking transaction or it hasn't
+	been started yet. */
+
+	ut_a(trx->will_lock > 0);
+
 	error = row_rename_table_for_mysql(
 		norm_from, norm_to, trx, lock_and_commit);
 
@@ -9474,6 +9494,14 @@ ha_innobase::rename_table(
 
 	trx = innobase_trx_allocate(thd);
 
+	/* Either the transaction is already flagged as a locking transaction
+	or it hasn't been started yet. */
+
+	ut_a(!trx_is_started(trx) || trx->will_lock > 0);
+
+	/* We are doing a DDL operation. */
+	++trx->will_lock;
+
 	error = innobase_rename_table(trx, from, to, TRUE);
 
 	DEBUG_SYNC(thd, "after_innobase_rename_table");
@@ -14334,8 +14362,8 @@ static MYSQL_SYSVAR_ULONG(purge_threads,
   PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
   "Purge threads can be from 0 to 32. Default is 0.",
   NULL, NULL,
-  0,			/* Default setting */
-  0,			/* Minimum value */
+  1,			/* Default setting */
+  1,			/* Minimum value */
   32, 0);		/* Maximum value */
 
 static MYSQL_SYSVAR_ULONG(sync_array_size, srv_sync_array_size,
@@ -14448,6 +14476,14 @@ static MYSQL_SYSVAR_ULONG(max_purge_lag,
   "Desired maximum length of the purge queue (0 = no limit)",
   NULL, NULL, 0, 0, ~0UL, 0);
 
+static MYSQL_SYSVAR_ULONG(max_purge_lag_delay, srv_max_purge_lag_delay,
+   PLUGIN_VAR_RQCMDARG,
+   "Maximum delay of user threads in micro-seconds",
+   NULL, NULL, 
+   0L,			/* Default seting */
+   0L,			/* Minimum value */
+   10000000UL, 0);	/* Maximum value */
+ 
 static MYSQL_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout,
   PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
   "Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)",
@@ -14922,6 +14958,7 @@ static struct st_mysql_sys_var* innobase
   MYSQL_SYSVAR(max_dirty_pages_pct),
   MYSQL_SYSVAR(adaptive_flushing),
   MYSQL_SYSVAR(max_purge_lag),
+  MYSQL_SYSVAR(max_purge_lag_delay),
   MYSQL_SYSVAR(mirrored_log_groups),
   MYSQL_SYSVAR(old_blocks_pct),
   MYSQL_SYSVAR(old_blocks_time),

=== modified file 'storage/innobase/include/srv0mon.h'
--- a/storage/innobase/include/srv0mon.h	2011-11-24 07:15:35 +0000
+++ b/storage/innobase/include/srv0mon.h	2012-02-14 05:30:35 +0000
@@ -279,6 +279,8 @@ enum monitor_id_value {
 	MONITOR_PURGE_INVOKED,
 	MONITOR_PURGE_N_PAGE_HANDLED,
 	MONITOR_DML_PURGE_DELAY,
+	MONITOR_PURGE_STOP_COUNT,
+	MONITOR_PURGE_RESUME_COUNT,
 
 	/* Recovery related counters */
 	MONITOR_MODULE_RECOVERY,

=== modified file 'storage/innobase/include/srv0srv.h'
--- a/storage/innobase/include/srv0srv.h	2011-12-28 08:37:08 +0000
+++ b/storage/innobase/include/srv0srv.h	2012-02-15 01:51:32 +0000
@@ -254,6 +254,7 @@ extern ulong	srv_checksum_algorithm;
 
 extern ulong	srv_max_buf_pool_modified_pct;
 extern ulong	srv_max_purge_lag;
+extern ulong	srv_max_purge_lag_delay;
 
 extern ulong	srv_replication_delay;
 /*-------------------------------------------*/
@@ -524,21 +525,6 @@ void
 srv_general_init(void);
 /*==================*/
 /*********************************************************************//**
-Gets the number of threads in the system.
-@return	sum of srv_n_threads[] */
-UNIV_INTERN
-ulint
-srv_get_n_threads(void);
-/*===================*/
-/*********************************************************************//**
-Check whether thread type has reserved a slot.
-@return	slot number or UNDEFINED if not found*/
-UNIV_INTERN
-ulint
-srv_thread_has_reserved_slot(
-/*=========================*/
-	enum srv_thread_type	type);	/*!< in: thread type to check */
-/*********************************************************************//**
 Sets the info describing an i/o thread current state. */
 UNIV_INTERN
 void
@@ -558,12 +544,6 @@ void
 srv_wake_purge_thread_if_not_active(void);
 /*=====================================*/
 /*******************************************************************//**
-Wakes up the purge thread if it's not already awake. */
-UNIV_INTERN
-void
-srv_wake_purge_thread(void);
-/*=======================*/
-/*******************************************************************//**
 Tells the Innobase server that there has been activity in the database
 and wakes up the master thread if it is suspended (not sleeping). Used
 in the MySQL interface. Note that there is a small chance that the master
@@ -697,15 +677,6 @@ DECLARE_THREAD(srv_worker_thread)(
 						required by os_thread_create */
 } /* extern "C" */
 
-/*******************************************************************//**
-Wakes up the worker threads. */
-UNIV_INTERN
-void
-srv_wake_worker_threads(
-/*====================*/
-	ulint	n_workers);			/*!< number or workers to
-						wake up */
-
 /**********************************************************************//**
 Get count of tasks in the queue.
 @return number of tasks in queue  */
@@ -735,6 +706,13 @@ const char*
 srv_any_background_threads_are_active(void);
 /*=======================================*/
 
+/**********************************************************************//**
+Wakeup the purge threads. */
+UNIV_INTERN
+void
+srv_purge_wakeup(void);
+/*==================*/
+
 /** Status variables to be passed to MySQL */
 struct export_var_struct{
 	ulint innodb_data_pending_reads;	/*!< Pending reads */
@@ -797,13 +775,13 @@ struct export_var_struct{
 
 /** Thread slot in the thread table.  */
 struct srv_slot_struct{
-	enum srv_thread_type
-			type;			/*!< thread type: user,
+	srv_thread_type type;			/*!< thread type: user,
 						utility etc. */
 	ibool		in_use;			/*!< TRUE if this slot
 						is in use */
-	ibool		suspended;		/*!< TRUE if the thread is waiting for the
-						event of this slot */
+	ibool		suspended;		/*!< TRUE if the thread is
+						waiting for the event of this
+						slot */
 	ib_time_t	suspend_time;		/*!< time when the thread was
 						suspended. Initialized by
 						lock_wait_table_reserve_slot()
@@ -813,9 +791,9 @@ struct srv_slot_struct{
 						Initialized by
 						lock_wait_table_reserve_slot()
 						for lock wait */
-	os_event_t	event;			/*!< event used in suspending the
-						thread when it has nothing to
-						do */
+	os_event_t	event;			/*!< event used in suspending
+						the thread when it has nothing
+						to do */
 	que_thr_t*	thr;			/*!< suspended query thread
 						(only used for user threads) */
 };

=== modified file 'storage/innobase/include/trx0purge.h'
--- a/storage/innobase/include/trx0purge.h	2011-08-23 07:46:16 +0000
+++ b/storage/innobase/include/trx0purge.h	2012-02-14 05:30:35 +0000
@@ -89,6 +89,35 @@ trx_purge(
 					submit to task queue. */
 	ulint	limit);			/*!< in: the maximum number of
 					records to purge in one batch */
+/*******************************************************************//**
+Stop purge and wait for it to stop, move to PURGE_STATE_STOP. */
+UNIV_INTERN
+void
+trx_purge_stop(void);
+/*================*/
+/*******************************************************************//**
+Resume purge, move to PURGE_STATE_RUN. */
+UNIV_INTERN
+void
+trx_purge_run(void);
+/*================*/
+
+/** Purge states */
+enum purge_state_t {
+	PURGE_STATE_INIT,		/*!< Purge instance created */
+	PURGE_STATE_RUN,		/*!< Purge should be running */
+	PURGE_STATE_STOP,		/*!< Purge should be stopped */
+	PURGE_STATE_EXIT		/*!< Purge has been shutdown */
+};
+
+/*******************************************************************//**
+Get the purge state.
+@return purge state. */
+UNIV_INTERN
+purge_state_t
+trx_purge_state(void);
+/*=================*/
+
 /** This is the purge pointer/iterator. We need both the undo no and the
 transaction no up to which purge has parsed and applied the records. */
 typedef struct purge_iter_struct {
@@ -107,14 +136,21 @@ struct trx_purge_struct{
 					purge query: this trx is not in the
 					trx list of the trx system and it
 					never ends */
-	que_t*		query;		/*!< The query graph which will do the
-					parallelized purge operation */
 	rw_lock_t	latch;		/*!< The latch protecting the purge
 					view. A purge operation must acquire an
 					x-latch here for the instant at which
 					it changes the purge view: an undo
 					log operation can prevent this by
-					obtaining an s-latch here. */
+					obtaining an s-latch here. It also
+					protects state and running */
+	os_event_t	event;		/*!< State signal event */
+	ulint		n_stop;		/*!< Counter to track number stops */
+	bool		running;	/*!< true, if purge is active */
+	volatile purge_state_t	state;	/*!< Purge coordinator thread states,
+					we check this in several places
+					without holding the latch. */
+	que_t*		query;		/*!< The query graph which will do the
+					parallelized purge operation */
 	read_view_t*	view;		/*!< The purge will not remove undo logs
 					which are >= this view (purge view) */
 	volatile ulint	n_submitted;	/*!< Count of total tasks submitted

=== modified file 'storage/innobase/lock/lock0lock.cc'
--- a/storage/innobase/lock/lock0lock.cc	2012-02-02 10:44:07 +0000
+++ b/storage/innobase/lock/lock0lock.cc	2012-02-14 07:44:56 +0000
@@ -5067,10 +5067,35 @@ lock_print_info_summary(
 
 	fprintf(file,
 		"Purge done for trx's n:o < " TRX_ID_FMT
-		" undo n:o < " TRX_ID_FMT "\n",
+		" undo n:o < " TRX_ID_FMT " state: ",
 		purge_sys->iter.trx_no,
 		purge_sys->iter.undo_no);
 
+	/* Note: We are reading the state without the latch. One because it
+	will violate the latching order and two because we are merely querying
+	the state of the variable for display. */
+
+	switch (purge_sys->state){
+	case PURGE_STATE_EXIT:
+	case PURGE_STATE_INIT:
+		/* Should never be in this state while the system is running. */
+		ut_error;
+
+	case PURGE_STATE_RUN:
+		fprintf(stderr, "running");
+		/* Check if it is waiting for more data to arrive. */
+		if (!purge_sys->running) {
+			fprintf(stderr, " but idle");
+		}
+		break;
+
+	case PURGE_STATE_STOP:
+		fprintf(stderr, "stopped");
+		break;
+	}
+
+	fprintf(stderr, "\n");
+
 	fprintf(file,
 		"History list length %lu\n",
 		(ulong) trx_sys->rseg_history_len);

=== modified file 'storage/innobase/log/log0log.cc'
--- a/storage/innobase/log/log0log.cc	2011-12-19 08:43:28 +0000
+++ b/storage/innobase/log/log0log.cc	2012-02-14 05:30:35 +0000
@@ -3183,6 +3183,10 @@ loop:
 
 	if (active_thd != SRV_NONE) {
 
+		if (active_thd == SRV_PURGE) {
+			srv_purge_wakeup();
+		}
+
 		/* The srv_lock_timeout_thread, srv_error_monitor_thread
 		and srv_monitor_thread should already exit by now. The
 		only threads to be suspended are the master threads
@@ -3211,7 +3215,7 @@ loop:
 
 			ut_print_timestamp(stderr);
 			fprintf(stderr, " InnoDB: Waiting for %s "
-				" to be suspended\n", thread_type);
+				"to be suspended\n", thread_type);
 			count = 0;
 		}
 

=== modified file 'storage/innobase/log/log0recv.cc'
--- a/storage/innobase/log/log0recv.cc	2011-12-23 13:17:36 +0000
+++ b/storage/innobase/log/log0recv.cc	2012-02-14 06:30:44 +0000
@@ -3297,7 +3297,9 @@ recv_recovery_from_checkpoint_finish(voi
 	that the data dictionary tables will be free of any locks.
 	The data dictionary latch should guarantee that there is at
 	most one data dictionary transaction active at a time. */
-	trx_rollback_or_clean_recovered(FALSE);
+	if (srv_force_recovery < SRV_FORCE_NO_TRX_UNDO) {
+		trx_rollback_or_clean_recovered(FALSE);
+	}
 }
 
 /********************************************************//**
@@ -3317,18 +3319,21 @@ recv_recovery_rollback_active(void)
 	/* Switch latching order checks on in sync0sync.cc */
 	sync_order_checks_on = TRUE;
 #endif
-	/* Drop partially created indexes. */
-	row_merge_drop_temp_indexes();
-	/* Drop temporary tables. */
-	row_mysql_drop_temp_tables();
-
-	/* Drop any auxiliary tables that were not dropped when the
-	parent table was dropped. This can happen if the parent table
-	was dropped but the server crashed before the auxiliary tables
-	were dropped. */
-	fts_drop_orphaned_tables();
-
+	/* We can't start any (DDL) transactions if UNDO logging
+	has been disabled, additionally disable ROLLBACK of recovered
+	user transactions. */
 	if (srv_force_recovery < SRV_FORCE_NO_TRX_UNDO) {
+		/* Drop partially created indexes. */
+		row_merge_drop_temp_indexes();
+		/* Drop temporary tables. */
+		row_mysql_drop_temp_tables();
+
+		/* Drop any auxiliary tables that were not dropped when the
+		parent table was dropped. This can happen if the parent table
+		was dropped but the server crashed before the auxiliary tables
+		were dropped. */
+		fts_drop_orphaned_tables();
+
 		/* Rollback the uncommitted transactions which have no user
 		session */
 

=== modified file 'storage/innobase/srv/srv0mon.cc'
--- a/storage/innobase/srv/srv0mon.cc	2012-02-02 09:23:51 +0000
+++ b/storage/innobase/srv/srv0mon.cc	2012-02-14 05:30:35 +0000
@@ -743,7 +743,7 @@ static monitor_info_t	innodb_counter_inf
 	 MONITOR_DEFAULT_START, MONITOR_N_UPD_EXIST_EXTERN},
 
 	{"purge_invoked", "purge",
-	 "Number of purge was invoked",
+	 "Number of times purge was invoked",
 	 MONITOR_NONE,
 	 MONITOR_DEFAULT_START, MONITOR_PURGE_INVOKED},
 
@@ -757,6 +757,16 @@ static monitor_info_t	innodb_counter_inf
 	 MONITOR_DISPLAY_CURRENT,
 	 MONITOR_DEFAULT_START, MONITOR_DML_PURGE_DELAY},
 
+	{"purge_stop_count", "purge",
+	 "Number of times purge was stopped",
+	 MONITOR_DISPLAY_CURRENT,
+	 MONITOR_DEFAULT_START, MONITOR_PURGE_STOP_COUNT},
+
+	{"purge_resume_count", "purge",
+	 "Number of times purge was resumed",
+	 MONITOR_DISPLAY_CURRENT,
+	 MONITOR_DEFAULT_START, MONITOR_PURGE_RESUME_COUNT},
+
 	/* ========== Counters for Recovery Module ========== */
 	{"module_log", "recovery", "Recovery Module",
 	 MONITOR_MODULE,

=== modified file 'storage/innobase/srv/srv0srv.cc'
--- a/storage/innobase/srv/srv0srv.cc	2012-01-26 11:57:53 +0000
+++ b/storage/innobase/srv/srv0srv.cc	2012-02-15 01:12:54 +0000
@@ -265,8 +265,8 @@ that during a time of heavy update/inser
 
 UNIV_INTERN ulong	srv_max_buf_pool_modified_pct	= 75;
 
-/* the number of purge threads to use from the worker pool (currently 0 or 1).*/
-UNIV_INTERN ulong srv_n_purge_threads = 0;
+/* The number of purge threads to use.*/
+UNIV_INTERN ulong srv_n_purge_threads = 1;
 
 /* the number of pages to purge in one batch */
 UNIV_INTERN ulong srv_purge_batch_size = 20;
@@ -579,12 +579,12 @@ struct srv_sys_struct{
 			tasks;			/*!< task queue */
 
 	mutex_t		mutex;			/*!< variable protecting the
+
 						fields below. */
-	srv_table_t*	sys_threads;		/*!< server thread table */
+	ulint		n_sys_threads;		/*!< size of the sys_threads
+						array */
 
-	ulint		n_threads[SRV_MASTER + 1];
-						/*!< number of system threads
-						in a thread class */
+	srv_table_t*	sys_threads;		/*!< server thread table */
 
 	ulint		n_threads_active[SRV_MASTER + 1];
 						/*!< number of threads active
@@ -618,7 +618,13 @@ and/or load it during startup. */
 UNIV_INTERN char	srv_buffer_pool_dump_at_shutdown = FALSE;
 UNIV_INTERN char	srv_buffer_pool_load_at_startup = FALSE;
 
-/***********************************************************************
+/** Slot index in the srv_sys->sys_threads array for the purge thread. */
+static const ulint	SRV_PURGE_SLOT	= 1;
+
+/** Slot index in the srv_sys->sys_threads array for the master thread. */
+static const ulint	SRV_MASTER_SLOT = 0;
+
+/*********************************************************************//**
 Prints counters for work done by srv_master_thread. */
 static
 void
@@ -650,45 +656,6 @@ srv_set_io_thread_op_info(
 	srv_io_thread_op_info[i] = str;
 }
 
-/*********************************************************************//**
-Accessor function to get pointer to n'th slot in the server thread
-table.
-@return	pointer to the slot */
-static
-srv_slot_t*
-srv_table_get_nth_slot(
-/*===================*/
-	ulint	index)		/*!< in: index of the slot */
-{
-	ut_ad(srv_sys_mutex_own());
-	ut_a(index < OS_THREAD_MAX_N);
-
-	return(srv_sys->sys_threads + index);
-}
-
-/*********************************************************************//**
-Gets the number of threads in the system.
-@return	sum of srv_sys_t::n_threads[] */
-UNIV_INTERN
-ulint
-srv_get_n_threads(void)
-/*===================*/
-{
-	ulint	i;
-	ulint	n_threads	= 0;
-
-	srv_sys_mutex_enter();
-
-	for (i = SRV_WORKER; i < SRV_MASTER + 1; i++) {
-
-		n_threads += srv_sys->n_threads[i];
-	}
-
-	srv_sys_mutex_exit();
-
-	return(n_threads);
-}
-
 #ifdef UNIV_DEBUG
 /*********************************************************************//**
 Validates the type of a thread table slot.
@@ -697,7 +664,7 @@ static
 ibool
 srv_thread_type_validate(
 /*=====================*/
-	enum srv_thread_type	type)	/*!< in: thread type */
+	srv_thread_type	type)	/*!< in: thread type */
 {
 	switch (type) {
 	case SRV_NONE:
@@ -716,103 +683,146 @@ srv_thread_type_validate(
 Gets the type of a thread table slot.
 @return thread type */
 static
-enum srv_thread_type
+srv_thread_type
 srv_slot_get_type(
 /*==============*/
 	const srv_slot_t*	slot)	/*!< in: thread slot */
 {
-	enum srv_thread_type	type	= (enum srv_thread_type) slot->type;
+	srv_thread_type	type = slot->type;
 	ut_ad(srv_thread_type_validate(type));
 	return(type);
 }
 
 /*********************************************************************//**
 Reserves a slot in the thread table for the current thread.
-NOTE! The server mutex has to be reserved by the caller!
 @return	reserved slot */
 static
 srv_slot_t*
-srv_table_reserve_slot(
-/*===================*/
-	enum srv_thread_type	type)	/*!< in: type of the thread */
+srv_reserve_slot(
+/*=============*/
+	srv_thread_type	type)	/*!< in: type of the thread */
 {
-	srv_slot_t*	slot;
+	srv_slot_t*	slot = 0;
 
-	ut_ad(srv_sys_mutex_own());
+	srv_sys_mutex_enter();
 
 	ut_ad(srv_thread_type_validate(type));
 
-	if (type != SRV_MASTER) {
-		ulint	i = 1;
+	switch (type) {
+	case SRV_MASTER:
+		slot = &srv_sys->sys_threads[SRV_MASTER_SLOT];
+		break;
+
+	case SRV_PURGE:
+		slot = &srv_sys->sys_threads[SRV_PURGE_SLOT];
+		break;
 
-		/* Find an empty slot. */
-		for (slot = srv_table_get_nth_slot(i);
+	case SRV_WORKER:
+		/* Find an empty slot, skip the master and purge slots. */
+		for (slot = &srv_sys->sys_threads[2];
 		     slot->in_use;
-		     slot = srv_table_get_nth_slot(i)) {
+		     ++slot) {
 
-			++i;
+			ut_a(slot < &srv_sys->sys_threads[
+			     srv_sys->n_sys_threads]);
 		}
+		break;
 
-	} else {
-		slot = srv_table_get_nth_slot(0);
+	case SRV_NONE:
+		ut_error;
 	}
 
+	ut_a(!slot->in_use);
+
 	slot->in_use = TRUE;
 	slot->suspended = FALSE;
 	slot->type = type;
+
 	ut_ad(srv_slot_get_type(slot) == type);
 
+	++srv_sys->n_threads_active[type];
+
+	srv_sys_mutex_exit();
+
 	return(slot);
 }
 
 /*********************************************************************//**
-Suspends the calling thread to wait for the event in its thread slot. */
+Suspends the calling thread to wait for the event in its thread slot.
+@return the current signal count of the event. */
 static
-void
-srv_suspend_thread(
-/*===============*/
+ib_int64_t
+srv_suspend_thread_low(
+/*===================*/
 	srv_slot_t*	slot)	/*!< in/out: thread slot */
 {
-	enum srv_thread_type	type;
+	ut_ad(srv_sys_mutex_own());
 
-	srv_sys_mutex_enter();
 	ut_ad(slot->in_use);
-	ut_ad(!slot->suspended);
 
-	if (srv_print_thread_releases) {
-		fprintf(stderr,
-			"Suspending thread %lu to slot %lu\n",
-			(ulong) os_thread_get_curr_id(),
-			(ulong) (slot - srv_sys->sys_threads));
-	}
+	srv_thread_type	type = srv_slot_get_type(slot);
+
+	switch (type) {
+	case SRV_NONE:
+		ut_error;
+
+	case SRV_MASTER:
+		/* We have only one master thread and it
+		should be the first entry always. */
+		ut_a(srv_sys->n_threads_active[type] == 1);
+		break;
 
-	type = srv_slot_get_type(slot);
+	case SRV_PURGE:
+		/* We have only one purge coordinator thread
+		and it should be the second entry always. */
+		ut_a(srv_sys->n_threads_active[type] == 1);
+		break;
 
-	/* The master thread always uses the first slot. */
-	ut_a(type != SRV_MASTER || slot == srv_sys->sys_threads);
+	case SRV_WORKER:
+		ut_a(srv_n_purge_threads > 1);
+		ut_a(srv_sys->n_threads_active[type] > 0);
+		break;
+	}
 
+	ut_a(!slot->suspended);
 	slot->suspended = TRUE;
 
-	ut_ad(srv_sys->n_threads_active[type] > 0);
+	ut_a(srv_sys->n_threads_active[type] > 0);
 
 	srv_sys->n_threads_active[type]--;
 
-	os_event_reset(slot->event);
+	return(os_event_reset(slot->event));
+}
+
+/*********************************************************************//**
+Suspends the calling thread to wait for the event in its thread slot.
+@return the current signal count of the event. */
+static
+ib_int64_t
+srv_suspend_thread(
+/*===============*/
+	srv_slot_t*	slot)	/*!< in/out: thread slot */
+{
+	srv_sys_mutex_enter();
+
+	ib_int64_t	sig_count = srv_suspend_thread_low(slot);
 
 	srv_sys_mutex_exit();
+
+	return(sig_count);
 }
 
 /*********************************************************************//**
 Releases threads of the type given from suspension in the thread table.
 NOTE! The server mutex has to be reserved by the caller!
 @return number of threads released: this may be less than n if not
-enough threads were suspended at the moment */
+        enough threads were suspended at the moment. */
 UNIV_INTERN
 ulint
 srv_release_threads(
 /*================*/
-	enum srv_thread_type	type,	/*!< in: thread type */
-	ulint			n)	/*!< in: number of threads to release */
+	srv_thread_type	type,	/*!< in: thread type */
+	ulint		n)	/*!< in: number of threads to release */
 {
 	ulint		i;
 	ulint		count	= 0;
@@ -822,37 +832,52 @@ srv_release_threads(
 
 	srv_sys_mutex_enter();
 
-	for (i = 0; i < OS_THREAD_MAX_N; i++) {
+	for (i = 0; i < srv_sys->n_sys_threads; i++) {
 		srv_slot_t*	slot;
 
-		slot = srv_table_get_nth_slot(i);
+		slot = &srv_sys->sys_threads[i];
 
-		if (slot->in_use && slot->suspended
-		    && srv_slot_get_type(slot) == type) {
+		if (slot->in_use
+		    && srv_slot_get_type(slot) == type
+		    && slot->suspended) {
+
+			switch (type) {
+			case SRV_NONE:
+				ut_error;
+
+			case SRV_MASTER:
+				/* We have only one master thread and it
+				should be the first entry always. */
+				ut_a(n == 1);
+				ut_a(i == SRV_MASTER_SLOT);
+				ut_a(srv_sys->n_threads_active[type] == 0);
+				break;
 
-			slot->suspended = FALSE;
+			case SRV_PURGE:
+				/* We have only one purge coordinator thread
+				and it should be the second entry always. */
+				ut_a(n == 1);
+				ut_a(i == SRV_PURGE_SLOT);
+				ut_a(srv_n_purge_threads > 0);
+				ut_a(srv_sys->n_threads_active[type] == 0);
+				break;
 
-			srv_sys->n_threads_active[type]++;
+			case SRV_WORKER:
+				ut_a(srv_n_purge_threads > 1);
+				ut_a(srv_sys->n_threads_active[type]
+				     < srv_n_purge_threads - 1);
+				break;
+			}
 
-			os_event_set(slot->event);
+			slot->suspended = FALSE;
 
-			if (srv_print_thread_releases) {
-				fprintf(stderr,
-					"Releasing thread type %lu"
-					" from slot %lu\n",
-					(ulong) type, (ulong) i);
-			}
+			++srv_sys->n_threads_active[type];
 
-			count++;
+			os_event_set(slot->event);
 
-			if (count == n) {
+			if (++count == n) {
 				break;
 			}
-		/* We have only one master thread and it should be the
-		first entry always. */
-		} else if (type == SRV_MASTER) {
-			ut_a(i == 0);
-			break;
 		}
 	}
 
@@ -862,35 +887,25 @@ srv_release_threads(
 }
 
 /*********************************************************************//**
-Check whether thread type has reserved a slot. Return the first slot that
-is found. This works because we currently have only 1 thread of each type.
-@return	slot number or ULINT_UNDEFINED if not found*/
-UNIV_INTERN
-ulint
-srv_thread_has_reserved_slot(
-/*=========================*/
-	enum srv_thread_type	type)	/*!< in: thread type to check */
+Release a thread's slot. */
+static
+void
+srv_free_slot(
+/*==========*/
+	srv_slot_t*	slot)	/*!< in/out: thread slot */
 {
-	ulint			i;
-	ulint			slot_no = ULINT_UNDEFINED;
-
-	ut_ad(srv_thread_type_validate(type));
 	srv_sys_mutex_enter();
 
-	for (i = 0; i < OS_THREAD_MAX_N; i++) {
-		const srv_slot_t*	slot;
-
-		slot = srv_table_get_nth_slot(i);
-
-		if (slot->in_use && srv_slot_get_type(slot) == type) {
-			slot_no = i;
-			break;
-		}
+	if (!slot->suspended) {
+		/* Mark the thread as inactive. */
+		srv_suspend_thread_low(slot);
 	}
 
-	srv_sys_mutex_exit();
+	/* Free the slot for reuse. */
+	ut_ad(slot->in_use);
+	slot->in_use = FALSE;
 
-	return(slot_no);
+	srv_sys_mutex_exit();
 }
 
 /*********************************************************************//**
@@ -902,6 +917,7 @@ srv_init(void)
 {
 	ulint			i;
 	ulint			srv_sys_sz;
+	ulint			n_sys_threads;
 
 #ifndef HAVE_ATOMIC_BUILTINS
 	mutex_create(server_mutex_key, &server_mutex, SYNC_ANY_LATCH);
@@ -910,7 +926,10 @@ srv_init(void)
 	mutex_create(srv_innodb_monitor_mutex_key,
 		     &srv_innodb_monitor_mutex, SYNC_NO_ORDER_CHECK);
 
-	srv_sys_sz = sizeof(*srv_sys) + (OS_THREAD_MAX_N * sizeof(srv_slot_t));
+	/* Number of purge threads + master thread */
+	n_sys_threads = srv_n_purge_threads + 1;
+
+	srv_sys_sz = sizeof(*srv_sys) + (n_sys_threads * sizeof(srv_slot_t));
 
 	srv_sys = static_cast<srv_sys_t*>(mem_zalloc(srv_sys_sz));
 
@@ -919,9 +938,10 @@ srv_init(void)
 	mutex_create(srv_sys_tasks_mutex_key,
 		     &srv_sys->tasks_mutex, SYNC_ANY_LATCH);
 
+	srv_sys->n_sys_threads = n_sys_threads;
 	srv_sys->sys_threads = (srv_slot_t*) &srv_sys[1];
 
-	for (i = 0; i < OS_THREAD_MAX_N; i++) {
+	for (i = 0; i < srv_sys->n_sys_threads; i++) {
 		srv_slot_t*	slot;
 
 		slot = srv_sys->sys_threads + i;
@@ -1679,24 +1699,32 @@ type.
 @return SRV_NONE if all are suspended or have exited, thread
 type if any are still active. */
 UNIV_INTERN
-enum srv_thread_type
+srv_thread_type
 srv_get_active_thread_type(void)
 /*============================*/
 {
 	ulint	i;
-	enum srv_thread_type ret = SRV_NONE;
+	srv_thread_type ret = SRV_NONE;
 
 	srv_sys_mutex_enter();
 
 	for (i = SRV_WORKER; i <= SRV_MASTER; ++i) {
 		if (srv_sys->n_threads_active[i] != 0) {
-			ret = static_cast<enum srv_thread_type>(i);
+			ret = static_cast<srv_thread_type>(i);
 			break;
 		}
 	}
 
 	srv_sys_mutex_exit();
 
+	/* Check only on shutdown. */
+	if (ret == SRV_NONE
+	    && srv_shutdown_state != SRV_SHUTDOWN_NONE
+	    && trx_purge_state() != PURGE_STATE_EXIT) {
+
+		ret = SRV_PURGE;
+	}
+
 	return(ret);
 }
 
@@ -1749,7 +1777,7 @@ srv_active_wake_master_thread(void)
 
 		srv_sys_mutex_enter();
 
-		slot = srv_table_get_nth_slot(0);
+		slot = &srv_sys->sys_threads[SRV_MASTER_SLOT];
 
 		/* Only if the master thread has been started. */
 
@@ -1774,8 +1802,8 @@ srv_active_wake_master_thread(void)
 Tells the purge thread that there has been activity in the database
 and wakes up the purge thread if it is suspended (not sleeping).  Note
 that there is a small chance that the purge thread stays suspended
-(we do not protect our operation with the srv_sys_t:mutex, for
-performance reasons). */
+(we do not protect our check with the srv_sys_t:mutex and the
+purge_sys->latch, for performance reasons). */
 UNIV_INTERN
 void
 srv_wake_purge_thread_if_not_active(void)
@@ -1783,7 +1811,7 @@ srv_wake_purge_thread_if_not_active(void
 {
 	ut_ad(!srv_sys_mutex_own());
 
-	if (srv_n_purge_threads > 0
+	if (purge_sys->state == PURGE_STATE_RUN
 	    && srv_sys->n_threads_active[SRV_PURGE] == 0) {
 
 		srv_release_threads(SRV_PURGE, 1);
@@ -1805,38 +1833,6 @@ srv_wake_master_thread(void)
 }
 
 /*******************************************************************//**
-Wakes up the purge thread if it's not already awake. */
-UNIV_INTERN
-void
-srv_wake_purge_thread(void)
-/*=======================*/
-{
-	ut_ad(!srv_sys_mutex_own());
-
-	if (srv_n_purge_threads > 0) {
-
-		srv_release_threads(SRV_PURGE, 1);
-	}
-}
-
-/*******************************************************************//**
-Wakes up the worker threads. */
-UNIV_INTERN
-void
-srv_wake_worker_threads(
-/*====================*/
-	ulint	n_workers)		/*!< number or workers to wake up */
-{
-	ut_ad(!srv_sys_mutex_own());
-
-	if (srv_n_purge_threads > 1) {
-
-		ut_a(n_workers > 0);
-		srv_release_threads(SRV_WORKER, n_workers);
-	}
-}
-
-/*******************************************************************//**
 Get current server activity count. We don't hold srv_sys::mutex while
 reading this value as it is only used in heuristics.
 @return activity count. */
@@ -1855,12 +1851,12 @@ UNIV_INTERN
 ibool
 srv_check_activity(
 /*===============*/
-	ulint		old_activity_count)	/*!< old activity count */
+	ulint		old_activity_count)	/*!< in: old activity count */
 {
 	return(srv_sys->activity_count != old_activity_count);
 }
 
-/**********************************************************************
+/********************************************************************//**
 The master thread is tasked to ensure that flush of log file happens
 once every second in the background. This is to ensure that not more
 than one second of trxs are lost in case of crash when
@@ -1881,41 +1877,6 @@ srv_sync_log_buffer_in_background(void)
 }
 
 /********************************************************************//**
-Do a full purge, reconfigure the purge sub-system if a dynamic
-change is detected.
-@return total pages purged */
-static
-ulint
-srv_master_do_purge(void)
-/*=====================*/
-{
-	ulint	n_pages_purged;
-	ulint	total_pages_purged = 0;
-
-	ut_a(srv_n_purge_threads == 0);
-
-	do {
-		srv_main_thread_op_info = "master purging";
-
-		/* Check for shutdown and change in purge config. */
-		if (srv_fast_shutdown
-		    && srv_shutdown_state > SRV_SHUTDOWN_NONE) {
-
-			/* Nothing to purge. */
-			n_pages_purged = 0;
-		} else {
-			n_pages_purged = trx_purge(1, srv_purge_batch_size);
-		}
-
-		total_pages_purged += n_pages_purged;
-		srv_sync_log_buffer_in_background();
-
-	} while (n_pages_purged > 0);
-
-	return(total_pages_purged);
-}
-
-/********************************************************************//**
 Make room in the table cache by evicting an unused table.
 @return number of tables evicted. */
 static
@@ -1951,8 +1912,6 @@ srv_shutdown_print_master_pending(
 						print the message */
 	ulint		n_tables_to_drop,	/*!< number of tables to
 						be dropped */
-	ulint		n_pages_purged,		/*!< number of pages just
-						purged */
 	ulint		n_bytes_merged)		/*!< number of change buffer
 						just merged */
 {
@@ -1972,18 +1931,6 @@ srv_shutdown_print_master_pending(
 				(ulong) n_tables_to_drop);
 		}
 
-		/* Check undo log purge, we only wait for the purge
-		if it is a slow shutdown */
-		if (!srv_fast_shutdown && n_pages_purged) {
-			ut_print_timestamp(stderr);
-			fprintf(stderr, "  InnoDB: Waiting for %lu "
-				"undo logs to be purged\n"
-				"  InnoDB: number of pages just "
-				"purged: %lu\n",
-					(ulong) trx_sys->rseg_history_len,
-					(ulong) n_pages_purged);
-			}
-
 		/* Check change buffer merge, we only wait for change buffer
 		merge if it is a slow shutdown */
 		if (!srv_fast_shutdown && n_bytes_merged) {
@@ -2065,14 +2012,6 @@ srv_master_do_active_tasks(void)
 		return;
 	}
 
-	/* Do a purge if we don't have a dedicated purge thread */
-	if (srv_n_purge_threads == 0
-	    && cur_time % SRV_MASTER_PURGE_INTERVAL == 0) {
-		srv_master_do_purge();
-		MONITOR_INC_TIME_IN_MICRO_SECS(
-			MONITOR_SRV_PURGE_MICROSECOND, counter_time);
-	}
-
 	if (srv_shutdown_state > 0) {
 		return;
 	}
@@ -2157,13 +2096,6 @@ srv_master_do_idle_tasks(void)
 	MONITOR_INC_TIME_IN_MICRO_SECS(
 		MONITOR_SRV_LOG_FLUSH_MICROSECOND, counter_time);
 
-	/* Do a purge if we don't have a dedicated purge thread */
-	if (srv_n_purge_threads == 0) {
-		srv_master_do_purge();
-		MONITOR_INC_TIME_IN_MICRO_SECS(
-			MONITOR_SRV_PURGE_MICROSECOND, counter_time);
-	}
-
 	if (srv_shutdown_state > 0) {
 		return;
 	}
@@ -2190,7 +2122,6 @@ srv_master_do_shutdown_tasks(
 	ib_time_t*	last_print_time)/*!< last time the function
 					print the message */
 {
-	ulint		n_pages_purged = 0;
 	ulint		n_bytes_merged = 0;
 	ulint		n_tables_to_drop = 0;
 
@@ -2226,11 +2157,6 @@ srv_master_do_shutdown_tasks(
 	/* Flush logs if needed */
 	srv_sync_log_buffer_in_background();
 
-	/* Do a purge if we don't have a dedicated purge thread */
-	if (srv_n_purge_threads == 0) {
-		n_pages_purged = srv_master_do_purge();
-	}
-
 func_exit:
 	/* Make a new checkpoint about once in 10 seconds */
 	srv_main_thread_op_info = "making checkpoint";
@@ -2238,15 +2164,11 @@ func_exit:
 
 	/* Print progress message every 60 seconds during shutdown */
 	if (srv_shutdown_state > 0 && srv_print_verbose_log) {
-		srv_shutdown_print_master_pending(last_print_time,
-						  n_tables_to_drop,
-						  n_pages_purged,
-						  n_bytes_merged);
+		srv_shutdown_print_master_pending(
+			last_print_time, n_tables_to_drop, n_bytes_merged);
 	}
 
-	return(n_pages_purged
-	       || n_bytes_merged
-               || n_tables_to_drop);
+	return(n_bytes_merged || n_tables_to_drop);
 }
 
 /*********************************************************************//**
@@ -2290,15 +2212,9 @@ DECLARE_THREAD(srv_master_thread)(
 	srv_main_thread_process_no = os_proc_get_number();
 	srv_main_thread_id = os_thread_pf(os_thread_get_curr_id());
 
-	srv_sys_mutex_enter();
-
-	slot = srv_table_reserve_slot(SRV_MASTER);
+	slot = srv_reserve_slot(SRV_MASTER);
 	ut_a(slot == srv_sys->sys_threads);
 
-	srv_sys->n_threads_active[SRV_MASTER]++;
-
-	srv_sys_mutex_exit();
-
 	last_print_time = ut_time();
 loop:
 	if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) {
@@ -2348,10 +2264,37 @@ suspend_thread:
 }
 
 /*********************************************************************//**
+Check if purge should stop.
+@return true if it should shutdown. */
+static
+bool
+srv_purge_should_exit(
+/*==============*/
+	ulint		n_purged)	/*!< in: pages purged in last batch */
+{
+	switch (srv_shutdown_state) {
+	case SRV_SHUTDOWN_NONE:
+		/* Normal operation. */
+		break;
+
+	case SRV_SHUTDOWN_CLEANUP:
+	case SRV_SHUTDOWN_EXIT_THREADS:
+		/* Exit unless slow shutdown requested or all done. */
+		return(srv_fast_shutdown != 0 || n_purged == 0);
+
+	case SRV_SHUTDOWN_LAST_PHASE:
+	case SRV_SHUTDOWN_FLUSH_PHASE:
+		ut_error;
+	}
+
+	return(false);
+}
+
+/*********************************************************************//**
 Fetch and execute a task from the work queue.
-@return	TRUE if a task was executed */
+@return	true if a task was executed */
 static
-ibool
+bool
 srv_task_execute(void)
 /*==================*/
 {
@@ -2398,47 +2341,55 @@ DECLARE_THREAD(srv_worker_thread)(
 	ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND);
 
 #ifdef UNIV_DEBUG_THREAD_CREATION
-	fprintf(stderr, "Worker thread starts, id %lu\n",
+	ut_print_timestamp(stderr);
+	fprintf(stderr, " InnoDB: worker thread starting, id %lu\n",
 		os_thread_pf(os_thread_get_curr_id()));
 #endif /* UNIV_DEBUG_THREAD_CREATION */
 
-	srv_sys_mutex_enter();
+	slot = srv_reserve_slot(SRV_WORKER);
 
-	slot = srv_table_reserve_slot(SRV_WORKER);
+	ut_a(srv_n_purge_threads > 1);
 
-	++srv_sys->n_threads_active[SRV_WORKER];
+	srv_sys_mutex_enter();
 
-	ut_a(srv_n_purge_threads > 1);
 	ut_a(srv_sys->n_threads_active[SRV_WORKER] < srv_n_purge_threads);
 
 	srv_sys_mutex_exit();
 
-	while (srv_shutdown_state == SRV_SHUTDOWN_NONE && !srv_fast_shutdown) {
+	/* We need to ensure that the worker threads exit after the
+	purge coordinator thread. Otherwise the purge coordinaor can
+	end up waiting forever in trx_purge_wait_for_workers_to_complete() */
 
+	do {
 		srv_suspend_thread(slot);
 
 		os_event_wait(slot->event);
 
-		srv_task_execute();
+		if (srv_task_execute()) {
 
-		/* If there is no task in the queue, wakeup the purge
-		coordinator thread. */
+			/* If there are tasks in the queue, wakeup
+			the purge coordinator thread. */
 
-		srv_wake_purge_thread_if_not_active();
-	}
+			srv_wake_purge_thread_if_not_active();
+		}
 
-	srv_suspend_thread(slot);
+		/* Note: we are checking the state without holding the
+		purge_sys->latch here. */
+	} while (purge_sys->state != PURGE_STATE_EXIT);
 
-	srv_sys_mutex_enter();
+	srv_free_slot(slot);
 
-	/* Free the slot for reuse. */
-	ut_ad(slot->in_use);
-	slot->in_use = FALSE;
+	rw_lock_x_lock(&purge_sys->latch);
 
-	srv_sys_mutex_exit();
+	ut_a(!purge_sys->running);
+	ut_a(purge_sys->state == PURGE_STATE_EXIT);
+	ut_a(srv_shutdown_state > SRV_SHUTDOWN_NONE);
+
+	rw_lock_x_unlock(&purge_sys->latch);
 
 #ifdef UNIV_DEBUG_THREAD_CREATION
-	fprintf(stderr, "Worker thread exits, id %lu\n",
+	ut_print_timestamp(stderr);
+	fprintf(stderr, " InnoDB: Purge worker thread exiting, id %lu\n",
 		os_thread_pf(os_thread_get_curr_id()));
 #endif /* UNIV_DEBUG_THREAD_CREATION */
 
@@ -2450,17 +2401,20 @@ DECLARE_THREAD(srv_worker_thread)(
 }
 
 /*********************************************************************//**
-Do the actual purge operation. */
+Do the actual purge operation.
+@return length of history list before the last purge batch. */
 static
-void
+ulint
 srv_do_purge(
 /*=========*/
 	ulint		n_threads,	/*!< in: number of threads to use */
 	ulint*		n_total_purged)	/*!< in/out: total pages purged */
 {
 	ulint		n_pages_purged;
+
 	static ulint	n_use_threads = 0;
 	static ulint	rseg_history_len = 0;
+	static ulint	old_activity_count = srv_get_activity_count();
 
 	ut_a(n_threads > 0);
 
@@ -2484,11 +2438,15 @@ srv_do_purge(
 				++n_use_threads;
 			}
 
-		} else if (n_use_threads > 1) {
+		} else if (srv_check_activity(old_activity_count)
+			   && n_use_threads > 1) {
+
 			/* History length same or smaller since last snapshot,
 			use fewer threads. */
 
 			--n_use_threads;
+
+			old_activity_count = srv_get_activity_count();
 		}
 
 		/* Ensure that the purge threads are less than what
@@ -2498,20 +2456,110 @@ srv_do_purge(
 		ut_a(n_use_threads <= n_threads);
 
 		/* Take a snapshot of the history list before purge. */
-		rseg_history_len = trx_sys->rseg_history_len;
-#if 0
-		fprintf(stderr, "%lu:%lu %lu\n",
-			rseg_history_len, trx_sys->rseg_history_len,
-			n_use_threads);
-#endif
+		if ((rseg_history_len = trx_sys->rseg_history_len) == 0) {
+			break;
+		}
+
 		n_pages_purged = trx_purge(n_use_threads, srv_purge_batch_size);
 
 		*n_total_purged += n_pages_purged;
 
-	} while (srv_shutdown_state == SRV_SHUTDOWN_NONE
-		 && srv_fast_shutdown == 0
-		 && n_pages_purged > 0);
+	} while (!srv_purge_should_exit(n_pages_purged) && n_pages_purged > 0);
+
+	return(rseg_history_len);
+}
+
+/*********************************************************************//**
+Suspend the purge coordinator thread. */
+static
+void
+srv_purge_coordinator_suspend(
+/*==========================*/
+	srv_slot_t*	slot,			/*!< in/out: Purge coordinator
+						thread slot */
+	ulint		rseg_history_len)	/*!< in: history list length
+						before last purge */
+{
+	ut_a(slot->type == SRV_PURGE);
+
+	rw_lock_x_lock(&purge_sys->latch);
+
+	purge_sys->running = false;
+
+	rw_lock_x_unlock(&purge_sys->latch);
+
+	bool		stop = false;
+
+	/** Maximum wait time on the purge event, in micro-seconds. */
+	static const ulint SRV_PURGE_MAX_TIMEOUT = 10000;
 
+	do {
+		ulint		ret;
+		ib_int64_t	sig_count = srv_suspend_thread(slot);
+
+		/* We don't wait right away on the the non-timed wait because
+		we want to signal the thread that wants to suspend purge. */
+
+		if (stop) {
+			os_event_wait_low(slot->event, sig_count);
+			ret = 0;
+		} else if (rseg_history_len <= trx_sys->rseg_history_len) {
+			ret = os_event_wait_time_low(
+				slot->event, SRV_PURGE_MAX_TIMEOUT, sig_count);
+		} else {
+			/* We don't want to waste time waiting if the
+			history list has increased by the time we get here
+			unless purge has been stopped. */
+			ret = 0;
+		}
+
+		srv_sys_mutex_enter();
+
+		/* The thread can be in state !suspended after the timeout
+		but before this check if another thread sent a wakeup signal. */
+
+		if (slot->suspended) {
+			slot->suspended = FALSE;
+			++srv_sys->n_threads_active[slot->type];
+			ut_a(srv_sys->n_threads_active[slot->type] == 1);
+		}
+
+		srv_sys_mutex_exit();
+
+		rw_lock_x_lock(&purge_sys->latch);
+
+		stop = (purge_sys->state == PURGE_STATE_STOP);
+
+		if (!stop) {
+			ut_a(purge_sys->n_stop == 0);
+			purge_sys->running = true;
+		} else {
+			ut_a(purge_sys->n_stop > 0);
+
+			/* Signal that we are suspended. */
+			os_event_set(purge_sys->event);
+		}
+
+		rw_lock_x_unlock(&purge_sys->latch);
+
+		if (ret == OS_SYNC_TIME_EXCEEDED) {
+
+			/* No new records added since wait started then simply
+			wait for new records. The magic number 5000 is an
+			approximation for the case where we have cached UNDO
+			log records which prevent truncate of the UNDO
+			segments. */
+
+			if (rseg_history_len == trx_sys->rseg_history_len
+			    && trx_sys->rseg_history_len < 5000) {
+
+				stop = true;
+			}
+		}
+
+	} while (stop);
+
+	ut_a(!slot->suspended);
 }
 
 /*********************************************************************//**
@@ -2525,91 +2573,88 @@ DECLARE_THREAD(srv_purge_coordinator_thr
 						required by os_thread_create */
 {
 	srv_slot_t*	slot;
-	ulint		retries = 0;
 	ulint           n_total_purged = ULINT_UNDEFINED;
 
 	ut_a(srv_n_purge_threads >= 1);
-
+	ut_a(trx_purge_state() == PURGE_STATE_INIT);
 	ut_a(srv_force_recovery < SRV_FORCE_NO_BACKGROUND);
 
+	rw_lock_x_lock(&purge_sys->latch);
+
+	purge_sys->running = true;
+	purge_sys->state = PURGE_STATE_RUN;
+
+	rw_lock_x_unlock(&purge_sys->latch);
+
 #ifdef UNIV_PFS_THREAD
 	pfs_register_thread(srv_purge_thread_key);
 #endif /* UNIV_PFS_THREAD */
 
-
 #ifdef UNIV_DEBUG_THREAD_CREATION
-	fprintf(stderr, "Purge coordinator thread starts, id %lu\n",
+	ut_print_timestamp(stderr);
+	fprintf(stderr, " InnoDB: Purge coordinator thread created, id %lu\n",
 		os_thread_pf(os_thread_get_curr_id()));
 #endif /* UNIV_DEBUG_THREAD_CREATION */
 
-	srv_sys_mutex_enter();
-
-	slot = srv_table_reserve_slot(SRV_PURGE);
+	slot = srv_reserve_slot(SRV_PURGE);
 
-	++srv_sys->n_threads_active[SRV_PURGE];
-
-	srv_sys_mutex_exit();
-
-	while (srv_shutdown_state != SRV_SHUTDOWN_EXIT_THREADS) {
+	ulint	rseg_history_len = trx_sys->rseg_history_len;
 
+	do {
 		/* If there are no records to purge or the last
-		purge didn't purge any records then wait for activity.
-	        We peek at the history len without holding any mutex
-		because in the worst case we will end up waiting for
-		the next purge event. */
-
-		if (trx_sys->rseg_history_len == 0
-		    || (n_total_purged == 0 && retries >= TRX_SYS_N_RSEGS)) {
+		purge didn't purge any records then wait for activity. */
 
-			srv_suspend_thread(slot);
+		if (purge_sys->state == PURGE_STATE_STOP
+		    || n_total_purged == 0) {
 
-			os_event_wait(slot->event);
-
-			retries = 0;
+			srv_purge_coordinator_suspend(slot, rseg_history_len);
 		}
 
-		/* Check for shutdown and whether we should do purge at all. */
-		if (srv_shutdown_state != SRV_SHUTDOWN_NONE
-		    || srv_fast_shutdown) {
-
+		if (srv_purge_should_exit(n_total_purged)) {
+			ut_a(!slot->suspended);
 			break;
 		}
 
-		if (n_total_purged == 0 && retries <= TRX_SYS_N_RSEGS) {
-			++retries;
-		} else if (n_total_purged > 0) {
-			retries = 0;
-			n_total_purged = 0;
+		n_total_purged = 0;
+
+		for (int i = 0;i < TRX_SYS_N_RSEGS; ++i) {
+			rseg_history_len = srv_do_purge(
+				srv_n_purge_threads, &n_total_purged);
 		}
 
-		srv_do_purge(srv_n_purge_threads, &n_total_purged);
-	}
+	} while (!srv_purge_should_exit(n_total_purged));
+
+	/* Ensure that we don't jump out of the loop unless the
+	exit condition is satisfied. */
+
+	ut_a(srv_purge_should_exit(n_total_purged));
 
 	/* The task queue should always be empty, independent of fast
 	shutdown state. */
 	ut_a(srv_get_task_queue_length() == 0);
 
-	/* Ensure that all the worker threads quit. */
-	if (srv_n_purge_threads > 1) {
-		srv_wake_worker_threads(srv_n_purge_threads - 1);
-	}
+	srv_free_slot(slot);
 
-	/* Decrement the active count. */
-	srv_suspend_thread(slot);
+	/* Note that we are shutting down. */
+	rw_lock_x_lock(&purge_sys->latch);
 
-	srv_sys_mutex_enter();
+	purge_sys->state = PURGE_STATE_EXIT;
 
-	/* Free the slot for reuse. */
-	ut_ad(slot->in_use);
-	slot->in_use = FALSE;
+	purge_sys->running = false;
 
-	srv_sys_mutex_exit();
+	rw_lock_x_unlock(&purge_sys->latch);
 
 #ifdef UNIV_DEBUG_THREAD_CREATION
-	fprintf(stderr, "Purge coordinator exiting, id %lu\n",
+	ut_print_timestamp(stderr);
+	fprintf(stderr, " InnoDB: Purge coordinator exiting, id %lu\n",
 		os_thread_pf(os_thread_get_curr_id()));
 #endif /* UNIV_DEBUG_THREAD_CREATION */
 
+	/* Ensure that all the worker threads quit. */
+	if (srv_n_purge_threads > 1) {
+		srv_release_threads(SRV_WORKER, srv_n_purge_threads - 1);
+	}
+
 	/* We count the number of threads in os_thread_exit(). A created
 	thread should always use that to exit and not use return() to exit. */
 	os_thread_exit(NULL);
@@ -2653,3 +2698,23 @@ srv_get_task_queue_length(void)
 
 	return(n_tasks);
 }
+
+/**********************************************************************//**
+Wakeup the purge threads. */
+UNIV_INTERN
+void
+srv_purge_wakeup(void)
+/*==================*/
+{
+	if (srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
+
+		srv_release_threads(SRV_PURGE, 1);
+
+		if (srv_n_purge_threads > 1) {
+			ulint	n_workers = srv_n_purge_threads - 1;
+
+			srv_release_threads(SRV_WORKER, n_workers);
+		}
+	}
+}
+

=== modified file 'storage/innobase/srv/srv0start.cc'
--- a/storage/innobase/srv/srv0start.cc	2012-01-18 15:39:14 +0000
+++ b/storage/innobase/srv/srv0start.cc	2012-02-15 01:12:54 +0000
@@ -2177,6 +2177,12 @@ innobase_start_or_create_for_mysql(void)
 	srv_available_undo_logs = trx_sys_create_rsegs(
 		srv_undo_tablespaces, srv_undo_logs);
 
+	if (srv_available_undo_logs == ULINT_UNDEFINED) {
+		/* Can only happen if force recovery is set. */
+		ut_a(srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO);
+		srv_undo_logs = ULINT_UNDEFINED;
+	}
+
 	/* Create the thread which watches the timeouts for lock waits */
 	os_thread_create(
 		lock_wait_timeout_thread,
@@ -2202,6 +2208,8 @@ innobase_start_or_create_for_mysql(void)
 
 	srv_is_being_started = FALSE;
 
+	ut_a(trx_purge_state() == PURGE_STATE_INIT);
+
 	/* Create the master thread which does purge and other utility
 	operations */
 
@@ -2209,10 +2217,7 @@ innobase_start_or_create_for_mysql(void)
 		srv_master_thread,
 		NULL, thread_ids + (1 + SRV_MAX_N_IO_THREADS));
 
-	/* If the user has requested a separate purge thread then
-	start the purge thread. */
-	if (srv_n_purge_threads >= 1
-	    && srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
+	if (srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
 
 		os_thread_create(
 			srv_purge_coordinator_thread,
@@ -2221,6 +2226,7 @@ innobase_start_or_create_for_mysql(void)
 		ut_a(UT_ARR_SIZE(thread_ids)
 		     > 5 + srv_n_purge_threads + SRV_MAX_N_IO_THREADS);
 
+		/* We've already created the purge coordinator thread above. */
 		for (i = 1; i < srv_n_purge_threads; ++i) {
 			os_thread_create(
 				srv_worker_thread, NULL,
@@ -2228,27 +2234,32 @@ innobase_start_or_create_for_mysql(void)
 		}
 	}
 
-
-	os_thread_create(
-		buf_flush_page_cleaner_thread, NULL, NULL);
+	os_thread_create(buf_flush_page_cleaner_thread, NULL, NULL);
 
 	/* Wait for the purge coordinator and master thread to startup. */
 
+	purge_state_t	state = trx_purge_state();
+
 	while (srv_shutdown_state == SRV_SHUTDOWN_NONE
-	       && srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
+	       && srv_force_recovery < SRV_FORCE_NO_BACKGROUND
+	       && state == PURGE_STATE_INIT) {
 
-		if (srv_thread_has_reserved_slot(SRV_MASTER) == ULINT_UNDEFINED
-		    || (srv_n_purge_threads > 0
-			&& srv_thread_has_reserved_slot(SRV_PURGE)
-			== ULINT_UNDEFINED)) {
+		switch (state = trx_purge_state()) {
+		case PURGE_STATE_RUN:
+		case PURGE_STATE_STOP:
+			break;
 
+		case PURGE_STATE_INIT:
 			ut_print_timestamp(stderr);
 			fprintf(stderr, " InnoDB: "
 				"Waiting for the background threads to "
 				"start\n");
-			os_thread_sleep(1000000);
-		} else {
+
+			os_thread_sleep(50000);
 			break;
+
+		case PURGE_STATE_EXIT:
+			ut_error;
 		}
 	}
 
@@ -2479,6 +2490,11 @@ innobase_shutdown_for_mysql(void)
 			srv_conc_get_active_threads());
 	}
 
+	/* This functionality will be used by WL#5522. */
+	ut_a(trx_purge_state() == PURGE_STATE_RUN
+	     || trx_purge_state() == PURGE_STATE_EXIT
+	     || srv_force_recovery >= SRV_FORCE_NO_BACKGROUND);
+
 	/* 2. Make all threads created by InnoDB to exit */
 
 	srv_shutdown_state = SRV_SHUTDOWN_EXIT_THREADS;
@@ -2500,11 +2516,8 @@ innobase_shutdown_for_mysql(void)
 		/* c. We wake the master thread so that it exits */
 		srv_wake_master_thread();
 
-		/* d. We wake the purge thread(s) so that they exit */
-		if (srv_n_purge_threads > 0) {
-			srv_wake_purge_thread();
-			srv_wake_worker_threads(srv_n_purge_threads - 1);
-		}
+		/* d. Wakeup purge threads. */
+		srv_purge_wakeup();
 
 		/* e. Exit the i/o threads */
 

=== modified file 'storage/innobase/trx/trx0purge.cc'
--- a/storage/innobase/trx/trx0purge.cc	2012-01-26 11:57:53 +0000
+++ b/storage/innobase/trx/trx0purge.cc	2012-02-15 01:51:32 +0000
@@ -49,6 +49,9 @@ Created 3/26/1996 Heikki Tuuri
 /** Maximum allowable purge history length.  <=0 means 'infinite'. */
 UNIV_INTERN ulong		srv_max_purge_lag = 0;
 
+/** Max DML user threads delay in micro-seconds. */
+UNIV_INTERN ulong		srv_max_purge_lag_delay = 0;
+
 /** The global data structure coordinating a purge */
 UNIV_INTERN trx_purge_t*	purge_sys = NULL;
 
@@ -125,6 +128,9 @@ trx_purge_sys_create(
 {
 	purge_sys = static_cast<trx_purge_t*>(mem_zalloc(sizeof(*purge_sys)));
 
+	purge_sys->state = PURGE_STATE_INIT;
+	purge_sys->event = os_event_create("purge");
+
 	/* Take ownership of ib_bh, we are responsible for freeing it. */
 	purge_sys->ib_bh = ib_bh;
 
@@ -137,10 +143,7 @@ trx_purge_sys_create(
 
 	purge_sys->heap = mem_heap_create(256);
 
-	/* Handle the case for the traditional mode. */
-	if (n_purge_threads == 0) {
-		n_purge_threads = 1;
-	}
+	ut_a(n_purge_threads > 0);
 
 	purge_sys->sess = sess_open();
 
@@ -189,6 +192,10 @@ trx_purge_sys_close(void)
 
 	ib_bh_free(purge_sys->ib_bh);
 
+	os_event_free(purge_sys->event);
+
+	purge_sys->event = NULL;
+
 	mem_free(purge_sys);
 
 	purge_sys = NULL;
@@ -1085,27 +1092,28 @@ trx_purge_dml_delay(void)
 	thread. */
 	ulint	delay = 0; /* in microseconds; default: no delay */
 
-	/* If we cannot advance the 'purge view' because of an old
-	'consistent read view', then the DML statements cannot be delayed.
-	Also, srv_max_purge_lag <= 0 means 'infinity'. Note: we do a dirty
-	read of the trx_sys_t data structure here, without holding
-	trx_sys->mutex. */
-	if (srv_max_purge_lag > 0
-	    && !UT_LIST_GET_LAST(trx_sys->view_list)) {
-		float	ratio = (float) trx_sys->rseg_history_len
-			/ srv_max_purge_lag;
-		if (ratio > ULINT_MAX / 10000) {
-			/* Avoid overflow: maximum delay is 4295 seconds */
-			delay = ULINT_MAX;
-		} else if (ratio > 1) {
+	/* If purge lag is set (ie. > 0) then calculate the new DML delay.
+	Note: we do a dirty read of the trx_sys_t data structure here,
+	without holding trx_sys->mutex. */
+
+	if (srv_max_purge_lag > 0) {
+		float	ratio;
+
+		ratio = float(trx_sys->rseg_history_len) / srv_max_purge_lag;
+
+		if (ratio > 1.0) {
 			/* If the history list length exceeds the
-			innodb_max_purge_lag, the
-			data manipulation statements are delayed
-			by at least 5000 microseconds. */
+			srv_max_purge_lag, the data manipulation
+			statements are delayed by at least 5000
+			microseconds. */
 			delay = (ulint) ((ratio - .5) * 10000);
 		}
 
-		MONITOR_SET(MONITOR_DML_PURGE_DELAY, srv_dml_needed_delay);
+		if (delay > srv_max_purge_lag_delay) {
+			delay = srv_max_purge_lag_delay;
+		}
+
+		MONITOR_SET(MONITOR_DML_PURGE_DELAY, delay);
 	}
 
 	return(delay);
@@ -1239,16 +1247,12 @@ trx_purge(
 
 	/* Do it synchronously. */
 	} else {
-		thr = que_fork_start_command(purge_sys->query);
+		thr = que_fork_scheduler_round_robin(purge_sys->query, NULL);
 		ut_ad(thr);
 
 run_synchronously:
 		++purge_sys->n_submitted;
 
-		if (srv_print_thread_releases) {
-			fputs("Starting purge\n", stderr);
-		}
-
 		que_run_threads(thr);
 
 		os_atomic_inc_ulint(
@@ -1270,10 +1274,105 @@ run_synchronously:
 	MONITOR_INC_VALUE(MONITOR_PURGE_INVOKED, 1);
 	MONITOR_INC_VALUE(MONITOR_PURGE_N_PAGE_HANDLED, n_pages_handled);
 
-	if (srv_print_thread_releases) {
-		fprintf(stderr, "Purge ends; pages handled %lu\n",
-			n_pages_handled);
+	return(n_pages_handled);
+}
+
+/*******************************************************************//**
+Get the purge state.
+@return purge state. */
+UNIV_INTERN
+purge_state_t
+trx_purge_state(void)
+/*=================*/
+{
+	purge_state_t	state;
+
+	rw_lock_x_lock(&purge_sys->latch);
+
+	state = purge_sys->state;
+
+	rw_lock_x_unlock(&purge_sys->latch);
+
+	return(state);
+}
+
+/*******************************************************************//**
+Stop purge and wait for it to stop, move to PURGE_STATE_STOP. */
+UNIV_INTERN
+void
+trx_purge_stop(void)
+/*================*/
+{
+	purge_state_t	state;
+	ib_int64_t	sig_count = os_event_reset(purge_sys->event);
+
+	ut_a(srv_n_purge_threads > 0);
+
+	rw_lock_x_lock(&purge_sys->latch);
+
+	ut_a(purge_sys->state != PURGE_STATE_INIT);
+	ut_a(purge_sys->state != PURGE_STATE_EXIT);
+
+	++purge_sys->n_stop;
+
+	state = purge_sys->state;
+
+	if (state == PURGE_STATE_RUN) {
+		ut_print_timestamp(stderr);
+		fprintf(stderr, " InnoDB: Stopping purge.\n");
+
+		/* We need to wakeup the purge thread in case it is suspended,
+		so that it can acknowledge the state change. */
+
+		srv_wake_purge_thread_if_not_active();
 	}
 
-	return(n_pages_handled);
+	purge_sys->state = PURGE_STATE_STOP;
+
+	rw_lock_x_unlock(&purge_sys->latch);
+
+	if (state != PURGE_STATE_STOP) {
+
+		/* Wait for purge coordinator to signal that it
+		is suspended. */
+		os_event_wait_low(purge_sys->event, sig_count);
+	}
+
+	MONITOR_INC_VALUE(MONITOR_PURGE_STOP_COUNT, 1);
+}
+
+/*******************************************************************//**
+Resume purge, move to PURGE_STATE_RUN. */
+UNIV_INTERN
+void
+trx_purge_run(void)
+/*===============*/
+{
+	rw_lock_x_lock(&purge_sys->latch);
+
+	ut_a(purge_sys->state != PURGE_STATE_INIT);
+	ut_a(purge_sys->state != PURGE_STATE_EXIT);
+
+	if (purge_sys->n_stop > 0) {
+
+		ut_a(purge_sys->state == PURGE_STATE_STOP);
+
+		--purge_sys->n_stop;
+
+		if (purge_sys->n_stop == 0) {
+
+			ut_print_timestamp(stderr);
+			fprintf(stderr, " InnoDB: Resuming purge.\n");
+
+			purge_sys->state = PURGE_STATE_RUN;
+		}
+
+		MONITOR_INC_VALUE(MONITOR_PURGE_RESUME_COUNT, 1);
+	} else {
+		ut_a(purge_sys->state == PURGE_STATE_RUN);
+	}
+
+	rw_lock_x_unlock(&purge_sys->latch);
+
+	srv_wake_purge_thread_if_not_active();
 }

=== modified file 'storage/innobase/trx/trx0roll.cc'
--- a/storage/innobase/trx/trx0roll.cc	2011-12-19 08:43:28 +0000
+++ b/storage/innobase/trx/trx0roll.cc	2012-02-14 06:30:44 +0000
@@ -739,6 +739,8 @@ trx_rollback_or_clean_recovered(
 {
 	trx_t*	trx;
 
+	ut_a(srv_force_recovery < SRV_FORCE_NO_TRX_UNDO);
+
 	if (trx_sys_get_n_rw_trx() == 0) {
 
 		return;

=== modified file 'storage/innobase/trx/trx0sys.cc'
--- a/storage/innobase/trx/trx0sys.cc	2012-02-02 10:44:07 +0000
+++ b/storage/innobase/trx/trx0sys.cc	2012-02-14 06:30:44 +0000
@@ -882,7 +882,7 @@ trx_sys_create_rsegs(
 	ut_a(n_spaces < TRX_SYS_N_RSEGS);
 	ut_a(n_rsegs <= TRX_SYS_N_RSEGS);
 
-	if (srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN) {
+	if (srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO) {
 		return(ULINT_UNDEFINED);
 	}
 

=== modified file 'storage/innobase/trx/trx0trx.cc'
--- a/storage/innobase/trx/trx0trx.cc	2012-02-13 06:15:14 +0000
+++ b/storage/innobase/trx/trx0trx.cc	2012-02-14 06:30:44 +0000
@@ -631,7 +631,7 @@ trx_assign_rseg(
 	trx_rseg_t*	rseg;
 	static ulint	latest_rseg = 0;
 
-	if (srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN) {
+	if (srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO) {
 		ut_a(max_undo_logs == ULINT_UNDEFINED);
 		return(NULL);
 	}
@@ -738,7 +738,10 @@ trx_start_low(
 			ut_d(trx->in_ro_trx_list = TRUE);
 		}
 	} else {
-		ut_ad(trx->rseg != NULL);
+
+		ut_ad(trx->rseg != NULL
+		      || srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO);
+
 		ut_ad(!trx_is_autocommit_non_locking(trx));
 		UT_LIST_ADD_FIRST(trx_list, trx_sys->rw_trx_list, trx);
 		ut_d(trx->in_rw_trx_list = TRUE);
@@ -1022,6 +1025,13 @@ trx_commit(
 		ut_ad(!trx->in_ro_trx_list);
 		ut_ad(!trx->in_rw_trx_list);
 
+		/* Note: We are asserting without holding the lock mutex. But
+		that is OK because this transaction is not waiting and cannot
+		be rolled back and no new locks can (or should not) be added
+		becuase it is flagged as a non-locking read-only transaction. */
+
+		ut_a(UT_LIST_GET_LEN(trx->lock.trx_locks) == 0);
+
 		/* This state change is not protected by any mutex, therefore
 		there is an inherent race here around state transition during
 		printouts. We ignore this race for the sake of efficiency.

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2011-11-21 11:58:25 +0000
+++ b/tests/mysql_client_test.c	2012-02-13 15:23:37 +0000
@@ -8193,7 +8193,7 @@ static void test_field_misc()
 
 
 /*
-  Test SET OPTION feature with prepare stmts
+  Test SET feature with prepare stmts
   bug #85 (reported by mark@stripped)
 */
 
@@ -8208,7 +8208,7 @@ static void test_set_option()
   mysql_autocommit(mysql, TRUE);
 
   /* LIMIT the rows count to 2 */
-  rc= mysql_query(mysql, "SET OPTION SQL_SELECT_LIMIT= 2");
+  rc= mysql_query(mysql, "SET SQL_SELECT_LIMIT= 2");
   myquery(rc);
 
   rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_limit");
@@ -8249,7 +8249,7 @@ static void test_set_option()
   /* RESET the LIMIT the rows count to 0 */
   if (!opt_silent)
     fprintf(stdout, "\n with SQL_SELECT_LIMIT=DEFAULT (prepare)");
-  rc= mysql_query(mysql, "SET OPTION SQL_SELECT_LIMIT=DEFAULT");
+  rc= mysql_query(mysql, "SET SQL_SELECT_LIMIT=DEFAULT");
   myquery(rc);
 
   stmt= mysql_simple_prepare(mysql, "SELECT * FROM test_limit");

=== modified file 'unittest/gunit/sql_list-t.cc'
--- a/unittest/gunit/sql_list-t.cc	2011-12-20 09:51:05 +0000
+++ b/unittest/gunit/sql_list-t.cc	2012-02-15 13:57:17 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -142,16 +142,16 @@ TEST_F(SqlListTest, DeepCopy)
 {
   int values[] = {11, 22, 33, 42, 5};
   insert_values(values, &m_int_list);
-  MEM_ROOT *mem_root= (MEM_ROOT*) malloc(1 << 20);
-  init_alloc_root(mem_root, 4096, 4096);
-  List<int> list_copy(m_int_list, mem_root);
+  MEM_ROOT mem_root;
+  init_alloc_root(&mem_root, 4096, 4096);
+  List<int> list_copy(m_int_list, &mem_root);
   EXPECT_EQ(list_copy.elements, m_int_list.elements);
   while (!list_copy.is_empty())
   {
     EXPECT_EQ(*m_int_list.pop(), *list_copy.pop());
   }
   EXPECT_TRUE(m_int_list.is_empty());
-  free(mem_root);
+  free_root(&mem_root, MYF(0));
 }
 
 
@@ -175,7 +175,7 @@ TEST_F(SqlListTest, Iterate)
 
 
 // A simple helper class for testing intrusive lists.
-class Linked_node : public ilink
+class Linked_node : public ilink<Linked_node>
 {
 public:
   Linked_node(int val) : m_value(val) {}
@@ -183,6 +183,7 @@ public:
 private:
   int m_value;
 };
+const Linked_node * const null_node= NULL;
 
 
 // An example of a test without any fixture.
@@ -191,17 +192,17 @@ TEST(SqlIlistTest, ConstructAndDestruct)
   I_List<Linked_node> i_list;
   I_List_iterator<Linked_node> i_list_iter(i_list);
   EXPECT_TRUE(i_list.is_empty());
-  const Linked_node *null_node= NULL;
   EXPECT_EQ(null_node, i_list_iter++);
 }
 
 
 // Tests iteration over intrusive lists.
-TEST(SqlIlistTest, Iterate)
+TEST(SqlIlistTest, PushBackAndIterate)
 {
   I_List<Linked_node> i_list;
   I_List_iterator<Linked_node> i_list_iter(i_list);
   int values[] = {11, 22, 33, 42, 5};
+  EXPECT_EQ(null_node, i_list.head());
   for (int ix= 0; ix < array_size(values); ++ix)
   {
     i_list.push_back(new Linked_node(values[ix]));
@@ -213,6 +214,12 @@ TEST(SqlIlistTest, Iterate)
   {
     EXPECT_EQ(values[value_number++], node->get_value());
   }
+  for (value_number= 0; (node= i_list.get()); ++value_number)
+  {
+    EXPECT_EQ(values[value_number], node->get_value());
+    delete node;
+  }
+  EXPECT_EQ(array_size(values), value_number);
 }
 
 // Another iteration test over intrusive lists.
@@ -232,6 +239,8 @@ TEST(SqlIlistTest, PushFrontAndIterate)
   {
     EXPECT_EQ(values[value_number--], node->get_value());
   }
+  while ((node= i_list.get()))
+    delete node;
 }
 
 static int cmp_test(void *a, void *b, void *c)

=== modified file 'vio/vio.c'
--- a/vio/vio.c	2011-08-18 05:29:13 +0000
+++ b/vio/vio.c	2012-02-15 07:20:32 +0000
@@ -217,8 +217,6 @@ Vio *mysql_socket_vio_new(MYSQL_SOCKET m
   if ((vio = (Vio*) my_malloc(sizeof(*vio),MYF(MY_WME))))
   {
     vio_init(vio, type, sd, flags);
-    sprintf(vio->desc,
-	    (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"), sd);
     vio->mysql_socket= mysql_socket;
   }
   DBUG_RETURN(vio);

=== modified file 'vio/viosocket.c'
--- a/vio/viosocket.c	2011-08-29 12:08:58 +0000
+++ b/vio/viosocket.c	2012-02-15 07:20:32 +0000
@@ -430,6 +430,12 @@ int vio_close(Vio * vio)
 
 const char *vio_description(Vio * vio)
 {
+  if (!vio->desc[0])
+  {
+    my_snprintf(vio->desc, VIO_DESCRIPTION_SIZE,
+                (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"),
+                mysql_socket_getfd(vio->mysql_socket));
+  }
   return vio->desc;
 }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5767 branch (mayank.prasad:3436 to 3437) WL#5767Mayank Prasad16 Feb