List:Commits« Previous MessageNext Message »
From:Mayank Prasad Date:February 8 2012 9:47am
Subject:bzr push into mysql-trunk-wl5767 branch (mayank.prasad:3433 to 3434) WL#5767
View as plain text  
 3434 Mayank Prasad	2012-02-08 [merge]
      WL#5767 : Performance Schema, Statements Digest
      
      Merge : mysql_trunk->mysql_trunk_wl5767

    added:
      unittest/gunit/filesort_compare-t.cc
    modified:
      include/my_sys.h
      mysql-test/include/subquery.inc
      mysql-test/r/ctype_many.result
      mysql-test/r/mix2_myisam.result
      mysql-test/r/myisam.result
      mysql-test/r/partition_windows.result
      mysql-test/r/subquery_all.result
      mysql-test/r/subquery_all_bka.result
      mysql-test/r/subquery_all_bka_nixbnl.result
      mysql-test/r/subquery_nomat_nosj.result
      mysql-test/r/subquery_nomat_nosj_bka.result
      mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result
      mysql-test/r/subquery_none.result
      mysql-test/r/subquery_none_bka.result
      mysql-test/r/subquery_none_bka_nixbnl.result
      mysql-test/r/type_temporal_fractional.result
      mysql-test/suite/funcs_1/r/innodb_views.result
      mysql-test/suite/funcs_1/r/memory_views.result
      mysql-test/suite/funcs_1/views/views_master.inc
      mysql-test/suite/innodb/r/innodb.result
      mysql-test/valgrind.supp
      mysys/mf_radix.c
      mysys/mf_sort.c
      sql/filesort.cc
      sql/filesort_utils.cc
      sql/filesort_utils.h
      sql/item.h
      sql/log_event.cc
      sql/partition_info.cc
      sql/sql_executor.cc
      sql/sql_optimizer.cc
      sql/sql_parse.cc
      sql/sql_table.cc
      sql/table.h
      storage/archive/ha_archive.cc
      storage/myisam/ha_myisam.cc
      storage/myisam/mi_dbug.c
      unittest/gunit/CMakeLists.txt
      unittest/gunit/dynarray-t.cc
 3433 Mayank Prasad	2012-02-06 [merge]
      WL#5767:
      
      Merge : mysql-trunk->mysql-trunk-wl5767

    added:
      mysql-test/suite/innodb/r/innodb_bug11754376.result
      mysql-test/suite/innodb/t/innodb_bug11754376.test
    modified:
      mysql-test/r/group_by.result
      mysql-test/r/join_outer.result
      mysql-test/r/join_outer_bka.result
      mysql-test/r/join_outer_bka_nixbnl.result
      mysql-test/t/join_outer.test
      sql/item.h
      sql/sql_optimizer.cc
      storage/innobase/handler/ha_innodb.cc
=== modified file 'include/my_sys.h'
--- a/include/my_sys.h	2011-11-28 07:13:03 +0000
+++ b/include/my_sys.h	2012-02-07 11:56:30 +0000
@@ -719,6 +719,7 @@ extern int flush_write_cache(RECORD_CACH
 extern void handle_recived_signals(void);
 
 extern sig_handler my_set_alarm_variable(int signo);
+extern my_bool radixsort_is_appliccable(uint n_items, size_t size_of_element);
 extern void my_string_ptr_sort(uchar *base,uint items,size_t size);
 extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
 				  size_t size_of_element,uchar *buffer[]);

=== modified file 'mysql-test/include/subquery.inc'
--- a/mysql-test/include/subquery.inc	2011-09-29 12:47:32 +0000
+++ b/mysql-test/include/subquery.inc	2012-02-07 14:50:31 +0000
@@ -5643,3 +5643,164 @@ WHERE (col_varchar_nokey, 'x') IN
 
 --echo
 DROP TABLE it, ot;
+
+--echo #
+--echo # Bug #11829691: Pure virtual method called in Item_bool_func2::fix...()
+--echo #
+
+CREATE TABLE t1(a INTEGER);
+CREATE TABLE t2(b INTEGER);
+
+PREPARE stmt FROM "
+SELECT SUM(b) FROM t2 GROUP BY b HAVING b IN (SELECT b FROM t1)";
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+
+DROP TABLE t1, t2;
+
+--echo #
+--echo # Bug #13595212 EXTRA ROWS RETURNED ON RIGHT JOIN WITH VIEW AND
+--echo # IN-SUBQUERY IN WHERE
+--echo #
+
+CREATE TABLE t1 (
+  pk int(11) NOT NULL AUTO_INCREMENT,
+  col_int_key int(11) NOT NULL,
+  col_varchar_key varchar(1) NOT NULL,
+  col_varchar_nokey varchar(1) NOT NULL,
+  PRIMARY KEY (pk),
+  KEY col_int_key (col_int_key),
+  KEY col_varchar_key (col_varchar_key,col_int_key)
+);
+
+INSERT INTO t1 VALUES (1,0,'j','j'),(2,8,'v','v'),
+(3,1,'c','c'),(4,8,'m','m'),(5,9,'d','d');
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+# RIGHT JOIN
+
+let $query=
+SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+  RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+  SELECT sq2_alias1.col_varchar_nokey
+  FROM v1 AS sq2_alias1
+    LEFT JOIN t1 AS sq2_alias2
+    ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+  WHERE sq2_alias1.pk != alias1.col_int_key
+    AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+
+eval EXPLAIN EXTENDED $query;
+--sorted_result
+eval $query;
+
+# Same, but in view:
+
+eval CREATE VIEW v2 AS $query;
+
+EXPLAIN EXTENDED SELECT * FROM v2;
+--sorted_result
+SELECT * FROM v2;
+
+# Same, with LEFT JOIN
+
+let $query=SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+  LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+  SELECT sq2_alias1.col_varchar_nokey
+  FROM v1 AS sq2_alias1
+    LEFT JOIN t1 AS sq2_alias2
+    ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+  WHERE sq2_alias1.pk != alias1.col_int_key
+    AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+
+eval EXPLAIN EXTENDED $query;
+--sorted_result
+eval $query;
+
+DROP TABLE t1;
+DROP VIEW v1,v2;
+
+--echo #
+--echo # Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY
+--echo # HAS AN EMPTY RESULT
+--echo #
+
+CREATE TABLE t1 (
+  pk int NOT NULL,
+  col_int_nokey int NOT NULL,
+  col_int_key int NOT NULL,
+  col_time_key time NOT NULL,
+  col_varchar_key varchar(1) NOT NULL,
+  col_varchar_nokey varchar(1) NOT NULL,
+  PRIMARY KEY (pk),
+  KEY col_int_key (col_int_key),
+  KEY col_time_key (col_time_key),
+  KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+
+CREATE TABLE t2 (
+  pk int NOT NULL AUTO_INCREMENT,
+  col_int_nokey int NOT NULL,
+  col_int_key int NOT NULL,
+  col_time_key time NOT NULL,
+  col_varchar_key varchar(1) NOT NULL,
+  col_varchar_nokey varchar(1) NOT NULL,
+  PRIMARY KEY (pk),
+  KEY col_int_key (col_int_key),
+  KEY col_time_key (col_time_key),
+  KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+
+INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b');
+
+SET @var2:=4, @var3:=8;
+
+--echo
+--echo Testcase without inner subquery
+
+let $subq=
+SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+      sq4_alias1.col_varchar_key = @var3;
+
+eval EXPLAIN $subq;
+eval $subq;
+SELECT @var3;
+
+# Now as derived table:
+eval EXPLAIN SELECT * FROM ( $subq ) AS alias3;
+eval SELECT * FROM ( $subq ) AS alias3;
+SELECT @var3;
+
+--echo
+--echo Testcase with inner subquery; crashed WL#6095
+SET @var3=8;
+let $subq=
+SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+      NOT IN
+      (SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+              c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+       FROM t2 AS c_sq1_alias1
+       WHERE (c_sq1_alias1.col_int_nokey != @var2
+              OR c_sq1_alias1.pk != @var3));
+
+eval EXPLAIN $subq;
+eval $subq;
+# Now as derived table:
+eval EXPLAIN SELECT * FROM ( $subq ) AS alias3;
+eval SELECT * FROM ( $subq ) AS alias3;
+
+DROP TABLE t1,t2;

=== modified file 'mysql-test/r/ctype_many.result'
--- a/mysql-test/r/ctype_many.result	2012-01-16 09:01:53 +0000
+++ b/mysql-test/r/ctype_many.result	2012-02-07 11:56:30 +0000
@@ -753,10 +753,10 @@ lower(utf8_f)
 �
 �
 �
-�
 �
 �
 �
+�
 �
 �
 �

=== modified file 'mysql-test/r/mix2_myisam.result'
--- a/mysql-test/r/mix2_myisam.result	2010-12-06 13:12:51 +0000
+++ b/mysql-test/r/mix2_myisam.result	2012-02-07 11:56:30 +0000
@@ -1611,15 +1611,15 @@ i	10
 select sql_big_result v,count(c) from t1 group by v limit 10;
 v	count(c)
 a	1
-a 	10
-b     	10
-c    	10
-d   	10
-e  	10
-f     	10
-g    	10
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
 h	10
-i     	10
+i	10
 select c,count(*) from t1 group by c limit 10;
 c	count(*)
 a	1

=== modified file 'mysql-test/r/myisam.result'
--- a/mysql-test/r/myisam.result	2012-02-02 09:03:02 +0000
+++ b/mysql-test/r/myisam.result	2012-02-07 11:56:30 +0000
@@ -1286,15 +1286,15 @@ i	10
 select sql_big_result v,count(c) from t1 group by v limit 10;
 v	count(c)
 a	1
-a 	10
-b     	10
-c    	10
-d   	10
-e  	10
-f     	10
-g    	10
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
 h	10
-i     	10
+i	10
 select c,count(*) from t1 group by c limit 10;
 c	count(*)
 a	1

=== modified file 'mysql-test/r/partition_windows.result'
--- a/mysql-test/r/partition_windows.result	2008-10-26 17:05:24 +0000
+++ b/mysql-test/r/partition_windows.result	2012-02-07 23:33:54 +0000
@@ -26,5 +26,9 @@ ALTER TABLE t1 ADD PARTITION (PARTITION
 Warnings:
 Warning	1618	<DATA DIRECTORY> option ignored
 Warning	1618	<INDEX DIRECTORY> option ignored
+Warning	1618	<DATA DIRECTORY> option ignored
+Warning	1618	<INDEX DIRECTORY> option ignored
+Warning	1618	<DATA DIRECTORY> option ignored
+Warning	1618	<INDEX DIRECTORY> option ignored
 INSERT INTO t1 VALUES (NULL, "last", 4);
 DROP TABLE t1;

=== modified file 'mysql-test/r/subquery_all.result'
--- a/mysql-test/r/subquery_all.result	2012-01-30 13:13:15 +0000
+++ b/mysql-test/r/subquery_all.result	2012-02-07 14:50:31 +0000
@@ -6822,4 +6822,262 @@ Warnings:
 Note	1003	/* select#1 */ select '1' AS `col_int_nokey` from (`test`.`it`) where ((`test`.`it`.`col_varchar_key2` = 'x') and (`test`.`it`.`col_varchar_key` = 'x') and isnull(`test`.`it`.`col_int_key`))
 
 DROP TABLE it, ot;
+#
+# Bug #11829691: Pure virtual method called in Item_bool_func2::fix...()
+#
+CREATE TABLE t1(a INTEGER);
+CREATE TABLE t2(b INTEGER);
+PREPARE stmt FROM "
+SELECT SUM(b) FROM t2 GROUP BY b HAVING b IN (SELECT b FROM t1)";
+EXECUTE stmt;
+SUM(b)
+EXECUTE stmt;
+SUM(b)
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+#
+# Bug #13595212 EXTRA ROWS RETURNED ON RIGHT JOIN WITH VIEW AND
+# IN-SUBQUERY IN WHERE
+#
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+col_int_key int(11) NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+);
+INSERT INTO t1 VALUES (1,0,'j','j'),(2,8,'v','v'),
+(3,1,'c','c'),(4,8,'m','m'),(5,9,'d','d');
+CREATE VIEW v1 AS SELECT * FROM t1;
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`test`.`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `test`.`t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `test`.`t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+CREATE VIEW v2 AS SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+EXPLAIN EXTENDED SELECT * FROM v2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+3	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+3	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #3 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #3 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#3 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT * FROM v2;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+DROP TABLE t1;
+DROP VIEW v1,v2;
+#
+# Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY
+# HAS AN EMPTY RESULT
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+CREATE TABLE t2 (
+pk int NOT NULL AUTO_INCREMENT,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b');
+SET @var2:=4, @var3:=8;
+
+Testcase without inner subquery
+EXPLAIN SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+EXPLAIN SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+
+Testcase with inner subquery; crashed WL#6095
+SET @var3=8;
+EXPLAIN SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+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	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+EXPLAIN SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+3	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+DROP TABLE t1,t2;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/subquery_all_bka.result'
--- a/mysql-test/r/subquery_all_bka.result	2012-01-30 13:13:15 +0000
+++ b/mysql-test/r/subquery_all_bka.result	2012-02-07 14:50:31 +0000
@@ -6823,5 +6823,263 @@ Warnings:
 Note	1003	/* select#1 */ select '1' AS `col_int_nokey` from (`test`.`it`) where ((`test`.`it`.`col_varchar_key2` = 'x') and (`test`.`it`.`col_varchar_key` = 'x') and isnull(`test`.`it`.`col_int_key`))
 
 DROP TABLE it, ot;
+#
+# Bug #11829691: Pure virtual method called in Item_bool_func2::fix...()
+#
+CREATE TABLE t1(a INTEGER);
+CREATE TABLE t2(b INTEGER);
+PREPARE stmt FROM "
+SELECT SUM(b) FROM t2 GROUP BY b HAVING b IN (SELECT b FROM t1)";
+EXECUTE stmt;
+SUM(b)
+EXECUTE stmt;
+SUM(b)
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+#
+# Bug #13595212 EXTRA ROWS RETURNED ON RIGHT JOIN WITH VIEW AND
+# IN-SUBQUERY IN WHERE
+#
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+col_int_key int(11) NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+);
+INSERT INTO t1 VALUES (1,0,'j','j'),(2,8,'v','v'),
+(3,1,'c','c'),(4,8,'m','m'),(5,9,'d','d');
+CREATE VIEW v1 AS SELECT * FROM t1;
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`test`.`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `test`.`t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `test`.`t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+CREATE VIEW v2 AS SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+EXPLAIN EXTENDED SELECT * FROM v2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+3	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+3	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #3 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #3 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#3 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT * FROM v2;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+DROP TABLE t1;
+DROP VIEW v1,v2;
+#
+# Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY
+# HAS AN EMPTY RESULT
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+CREATE TABLE t2 (
+pk int NOT NULL AUTO_INCREMENT,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b');
+SET @var2:=4, @var3:=8;
+
+Testcase without inner subquery
+EXPLAIN SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+EXPLAIN SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+
+Testcase with inner subquery; crashed WL#6095
+SET @var3=8;
+EXPLAIN SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+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	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+EXPLAIN SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+3	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+DROP TABLE t1,t2;
 set optimizer_switch=default;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/subquery_all_bka_nixbnl.result'
--- a/mysql-test/r/subquery_all_bka_nixbnl.result	2011-12-01 11:30:35 +0000
+++ b/mysql-test/r/subquery_all_bka_nixbnl.result	2012-02-07 14:50:31 +0000
@@ -6823,5 +6823,263 @@ Warnings:
 Note	1003	/* select#1 */ select '1' AS `col_int_nokey` from (`test`.`it`) where ((`test`.`it`.`col_varchar_key2` = 'x') and (`test`.`it`.`col_varchar_key` = 'x') and isnull(`test`.`it`.`col_int_key`))
 
 DROP TABLE it, ot;
+#
+# Bug #11829691: Pure virtual method called in Item_bool_func2::fix...()
+#
+CREATE TABLE t1(a INTEGER);
+CREATE TABLE t2(b INTEGER);
+PREPARE stmt FROM "
+SELECT SUM(b) FROM t2 GROUP BY b HAVING b IN (SELECT b FROM t1)";
+EXECUTE stmt;
+SUM(b)
+EXECUTE stmt;
+SUM(b)
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+#
+# Bug #13595212 EXTRA ROWS RETURNED ON RIGHT JOIN WITH VIEW AND
+# IN-SUBQUERY IN WHERE
+#
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+col_int_key int(11) NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+);
+INSERT INTO t1 VALUES (1,0,'j','j'),(2,8,'v','v'),
+(3,1,'c','c'),(4,8,'m','m'),(5,9,'d','d');
+CREATE VIEW v1 AS SELECT * FROM t1;
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	ref	col_int_key	col_int_key	4	test.t1.pk	2	100.00	Using index
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`test`.`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `test`.`t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `test`.`t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+CREATE VIEW v2 AS SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+EXPLAIN EXTENDED SELECT * FROM v2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index
+3	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+3	DEPENDENT SUBQUERY	sq2_alias2	ref	col_int_key	col_int_key	4	test.t1.pk	2	100.00	Using index
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #3 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #3 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#3 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT * FROM v2;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	ref	col_int_key	col_int_key	4	test.t1.pk	2	100.00	Using index
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+DROP TABLE t1;
+DROP VIEW v1,v2;
+#
+# Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY
+# HAS AN EMPTY RESULT
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+CREATE TABLE t2 (
+pk int NOT NULL AUTO_INCREMENT,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b');
+SET @var2:=4, @var3:=8;
+
+Testcase without inner subquery
+EXPLAIN SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+EXPLAIN SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+
+Testcase with inner subquery; crashed WL#6095
+SET @var3=8;
+EXPLAIN SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+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	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+EXPLAIN SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+3	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+DROP TABLE t1,t2;
 set optimizer_switch=default;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/subquery_nomat_nosj.result'
--- a/mysql-test/r/subquery_nomat_nosj.result	2011-11-01 11:52:24 +0000
+++ b/mysql-test/r/subquery_nomat_nosj.result	2012-02-07 14:50:31 +0000
@@ -6822,4 +6822,262 @@ Warnings:
 Note	1003	/* select#1 */ select '1' AS `col_int_nokey` from dual where <in_optimizer>(('x','x'),<exists>(<index_lookup>(<cache>('x') in it on idx_cvk_cvk2_cik where (isnull(`test`.`it`.`col_int_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key2`)))))
 
 DROP TABLE it, ot;
+#
+# Bug #11829691: Pure virtual method called in Item_bool_func2::fix...()
+#
+CREATE TABLE t1(a INTEGER);
+CREATE TABLE t2(b INTEGER);
+PREPARE stmt FROM "
+SELECT SUM(b) FROM t2 GROUP BY b HAVING b IN (SELECT b FROM t1)";
+EXECUTE stmt;
+SUM(b)
+EXECUTE stmt;
+SUM(b)
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+#
+# Bug #13595212 EXTRA ROWS RETURNED ON RIGHT JOIN WITH VIEW AND
+# IN-SUBQUERY IN WHERE
+#
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+col_int_key int(11) NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+);
+INSERT INTO t1 VALUES (1,0,'j','j'),(2,8,'v','v'),
+(3,1,'c','c'),(4,8,'m','m'),(5,9,'d','d');
+CREATE VIEW v1 AS SELECT * FROM t1;
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`test`.`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `test`.`t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `test`.`t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+CREATE VIEW v2 AS SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+EXPLAIN EXTENDED SELECT * FROM v2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+3	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+3	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #3 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #3 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#3 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT * FROM v2;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+DROP TABLE t1;
+DROP VIEW v1,v2;
+#
+# Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY
+# HAS AN EMPTY RESULT
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+CREATE TABLE t2 (
+pk int NOT NULL AUTO_INCREMENT,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b');
+SET @var2:=4, @var3:=8;
+
+Testcase without inner subquery
+EXPLAIN SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+EXPLAIN SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+
+Testcase with inner subquery; crashed WL#6095
+SET @var3=8;
+EXPLAIN SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+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	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+EXPLAIN SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+3	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+DROP TABLE t1,t2;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/subquery_nomat_nosj_bka.result'
--- a/mysql-test/r/subquery_nomat_nosj_bka.result	2011-11-01 11:52:24 +0000
+++ b/mysql-test/r/subquery_nomat_nosj_bka.result	2012-02-07 14:50:31 +0000
@@ -6823,5 +6823,263 @@ Warnings:
 Note	1003	/* select#1 */ select '1' AS `col_int_nokey` from dual where <in_optimizer>(('x','x'),<exists>(<index_lookup>(<cache>('x') in it on idx_cvk_cvk2_cik where (isnull(`test`.`it`.`col_int_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key2`)))))
 
 DROP TABLE it, ot;
+#
+# Bug #11829691: Pure virtual method called in Item_bool_func2::fix...()
+#
+CREATE TABLE t1(a INTEGER);
+CREATE TABLE t2(b INTEGER);
+PREPARE stmt FROM "
+SELECT SUM(b) FROM t2 GROUP BY b HAVING b IN (SELECT b FROM t1)";
+EXECUTE stmt;
+SUM(b)
+EXECUTE stmt;
+SUM(b)
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+#
+# Bug #13595212 EXTRA ROWS RETURNED ON RIGHT JOIN WITH VIEW AND
+# IN-SUBQUERY IN WHERE
+#
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+col_int_key int(11) NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+);
+INSERT INTO t1 VALUES (1,0,'j','j'),(2,8,'v','v'),
+(3,1,'c','c'),(4,8,'m','m'),(5,9,'d','d');
+CREATE VIEW v1 AS SELECT * FROM t1;
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`test`.`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `test`.`t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `test`.`t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+CREATE VIEW v2 AS SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+EXPLAIN EXTENDED SELECT * FROM v2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+3	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+3	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #3 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #3 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#3 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT * FROM v2;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+DROP TABLE t1;
+DROP VIEW v1,v2;
+#
+# Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY
+# HAS AN EMPTY RESULT
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+CREATE TABLE t2 (
+pk int NOT NULL AUTO_INCREMENT,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b');
+SET @var2:=4, @var3:=8;
+
+Testcase without inner subquery
+EXPLAIN SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+EXPLAIN SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+
+Testcase with inner subquery; crashed WL#6095
+SET @var3=8;
+EXPLAIN SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+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	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+EXPLAIN SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+3	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+DROP TABLE t1,t2;
 set optimizer_switch=default;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result'
--- a/mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result	2011-11-01 11:52:24 +0000
+++ b/mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result	2012-02-07 14:50:31 +0000
@@ -6823,5 +6823,263 @@ Warnings:
 Note	1003	/* select#1 */ select '1' AS `col_int_nokey` from dual where <in_optimizer>(('x','x'),<exists>(<index_lookup>(<cache>('x') in it on idx_cvk_cvk2_cik where (isnull(`test`.`it`.`col_int_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key2`)))))
 
 DROP TABLE it, ot;
+#
+# Bug #11829691: Pure virtual method called in Item_bool_func2::fix...()
+#
+CREATE TABLE t1(a INTEGER);
+CREATE TABLE t2(b INTEGER);
+PREPARE stmt FROM "
+SELECT SUM(b) FROM t2 GROUP BY b HAVING b IN (SELECT b FROM t1)";
+EXECUTE stmt;
+SUM(b)
+EXECUTE stmt;
+SUM(b)
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+#
+# Bug #13595212 EXTRA ROWS RETURNED ON RIGHT JOIN WITH VIEW AND
+# IN-SUBQUERY IN WHERE
+#
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+col_int_key int(11) NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+);
+INSERT INTO t1 VALUES (1,0,'j','j'),(2,8,'v','v'),
+(3,1,'c','c'),(4,8,'m','m'),(5,9,'d','d');
+CREATE VIEW v1 AS SELECT * FROM t1;
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	ref	col_int_key	col_int_key	4	test.t1.pk	2	100.00	Using index
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`test`.`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `test`.`t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `test`.`t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+CREATE VIEW v2 AS SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+EXPLAIN EXTENDED SELECT * FROM v2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index
+3	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+3	DEPENDENT SUBQUERY	sq2_alias2	ref	col_int_key	col_int_key	4	test.t1.pk	2	100.00	Using index
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #3 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #3 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#3 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT * FROM v2;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	ref	col_int_key	col_int_key	4	test.t1.pk	2	100.00	Using index
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+DROP TABLE t1;
+DROP VIEW v1,v2;
+#
+# Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY
+# HAS AN EMPTY RESULT
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+CREATE TABLE t2 (
+pk int NOT NULL AUTO_INCREMENT,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b');
+SET @var2:=4, @var3:=8;
+
+Testcase without inner subquery
+EXPLAIN SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+EXPLAIN SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+
+Testcase with inner subquery; crashed WL#6095
+SET @var3=8;
+EXPLAIN SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+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	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+EXPLAIN SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+3	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+DROP TABLE t1,t2;
 set optimizer_switch=default;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/subquery_none.result'
--- a/mysql-test/r/subquery_none.result	2011-11-01 11:52:24 +0000
+++ b/mysql-test/r/subquery_none.result	2012-02-07 14:50:31 +0000
@@ -6821,4 +6821,262 @@ Warnings:
 Note	1003	/* select#1 */ select '1' AS `col_int_nokey` from dual where <in_optimizer>(('x','x'),<exists>(<index_lookup>(<cache>('x') in it on idx_cvk_cvk2_cik where (isnull(`test`.`it`.`col_int_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key2`)))))
 
 DROP TABLE it, ot;
+#
+# Bug #11829691: Pure virtual method called in Item_bool_func2::fix...()
+#
+CREATE TABLE t1(a INTEGER);
+CREATE TABLE t2(b INTEGER);
+PREPARE stmt FROM "
+SELECT SUM(b) FROM t2 GROUP BY b HAVING b IN (SELECT b FROM t1)";
+EXECUTE stmt;
+SUM(b)
+EXECUTE stmt;
+SUM(b)
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+#
+# Bug #13595212 EXTRA ROWS RETURNED ON RIGHT JOIN WITH VIEW AND
+# IN-SUBQUERY IN WHERE
+#
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+col_int_key int(11) NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+);
+INSERT INTO t1 VALUES (1,0,'j','j'),(2,8,'v','v'),
+(3,1,'c','c'),(4,8,'m','m'),(5,9,'d','d');
+CREATE VIEW v1 AS SELECT * FROM t1;
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`test`.`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `test`.`t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `test`.`t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+CREATE VIEW v2 AS SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+EXPLAIN EXTENDED SELECT * FROM v2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+3	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+3	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #3 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #3 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#3 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT * FROM v2;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+DROP TABLE t1;
+DROP VIEW v1,v2;
+#
+# Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY
+# HAS AN EMPTY RESULT
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+CREATE TABLE t2 (
+pk int NOT NULL AUTO_INCREMENT,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b');
+SET @var2:=4, @var3:=8;
+
+Testcase without inner subquery
+EXPLAIN SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+EXPLAIN SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+
+Testcase with inner subquery; crashed WL#6095
+SET @var3=8;
+EXPLAIN SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+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	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+EXPLAIN SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+3	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+DROP TABLE t1,t2;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/subquery_none_bka.result'
--- a/mysql-test/r/subquery_none_bka.result	2011-11-01 11:52:24 +0000
+++ b/mysql-test/r/subquery_none_bka.result	2012-02-07 14:50:31 +0000
@@ -6822,5 +6822,263 @@ Warnings:
 Note	1003	/* select#1 */ select '1' AS `col_int_nokey` from dual where <in_optimizer>(('x','x'),<exists>(<index_lookup>(<cache>('x') in it on idx_cvk_cvk2_cik where (isnull(`test`.`it`.`col_int_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key2`)))))
 
 DROP TABLE it, ot;
+#
+# Bug #11829691: Pure virtual method called in Item_bool_func2::fix...()
+#
+CREATE TABLE t1(a INTEGER);
+CREATE TABLE t2(b INTEGER);
+PREPARE stmt FROM "
+SELECT SUM(b) FROM t2 GROUP BY b HAVING b IN (SELECT b FROM t1)";
+EXECUTE stmt;
+SUM(b)
+EXECUTE stmt;
+SUM(b)
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+#
+# Bug #13595212 EXTRA ROWS RETURNED ON RIGHT JOIN WITH VIEW AND
+# IN-SUBQUERY IN WHERE
+#
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+col_int_key int(11) NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+);
+INSERT INTO t1 VALUES (1,0,'j','j'),(2,8,'v','v'),
+(3,1,'c','c'),(4,8,'m','m'),(5,9,'d','d');
+CREATE VIEW v1 AS SELECT * FROM t1;
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`test`.`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `test`.`t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `test`.`t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+CREATE VIEW v2 AS SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+EXPLAIN EXTENDED SELECT * FROM v2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+3	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+3	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #3 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #3 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#3 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT * FROM v2;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	index	col_int_key	col_int_key	4	NULL	5	80.00	Using where; Using index; Using join buffer (Block Nested Loop)
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+DROP TABLE t1;
+DROP VIEW v1,v2;
+#
+# Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY
+# HAS AN EMPTY RESULT
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+CREATE TABLE t2 (
+pk int NOT NULL AUTO_INCREMENT,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b');
+SET @var2:=4, @var3:=8;
+
+Testcase without inner subquery
+EXPLAIN SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+EXPLAIN SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+
+Testcase with inner subquery; crashed WL#6095
+SET @var3=8;
+EXPLAIN SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+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	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+EXPLAIN SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+3	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+DROP TABLE t1,t2;
 set optimizer_switch=default;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/subquery_none_bka_nixbnl.result'
--- a/mysql-test/r/subquery_none_bka_nixbnl.result	2011-11-01 11:52:24 +0000
+++ b/mysql-test/r/subquery_none_bka_nixbnl.result	2012-02-07 14:50:31 +0000
@@ -6822,5 +6822,263 @@ Warnings:
 Note	1003	/* select#1 */ select '1' AS `col_int_nokey` from dual where <in_optimizer>(('x','x'),<exists>(<index_lookup>(<cache>('x') in it on idx_cvk_cvk2_cik where (isnull(`test`.`it`.`col_int_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key`) and (<cache>('x') = `test`.`it`.`col_varchar_key2`)))))
 
 DROP TABLE it, ot;
+#
+# Bug #11829691: Pure virtual method called in Item_bool_func2::fix...()
+#
+CREATE TABLE t1(a INTEGER);
+CREATE TABLE t2(b INTEGER);
+PREPARE stmt FROM "
+SELECT SUM(b) FROM t2 GROUP BY b HAVING b IN (SELECT b FROM t1)";
+EXECUTE stmt;
+SUM(b)
+EXECUTE stmt;
+SUM(b)
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;
+#
+# Bug #13595212 EXTRA ROWS RETURNED ON RIGHT JOIN WITH VIEW AND
+# IN-SUBQUERY IN WHERE
+#
+CREATE TABLE t1 (
+pk int(11) NOT NULL AUTO_INCREMENT,
+col_int_key int(11) NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+);
+INSERT INTO t1 VALUES (1,0,'j','j'),(2,8,'v','v'),
+(3,1,'c','c'),(4,8,'m','m'),(5,9,'d','d');
+CREATE VIEW v1 AS SELECT * FROM t1;
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	ref	col_int_key	col_int_key	4	test.t1.pk	2	100.00	Using index
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`test`.`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `test`.`t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `test`.`t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+CREATE VIEW v2 AS SELECT alias2.col_varchar_nokey
+FROM v1 AS alias1
+RIGHT JOIN t1 AS alias2 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+)
+;
+EXPLAIN EXTENDED SELECT * FROM v2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index
+3	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+3	DEPENDENT SUBQUERY	sq2_alias2	ref	col_int_key	col_int_key	4	test.t1.pk	2	100.00	Using index
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #3 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #3 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#3 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT * FROM v2;
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+EXPLAIN EXTENDED SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	PRIMARY	alias2	ALL	NULL	NULL	NULL	NULL	5	100.00	
+1	PRIMARY	t1	index	NULL	col_varchar_key	7	NULL	5	100.00	Using where; Using index
+2	DEPENDENT SUBQUERY	t1	ALL	col_varchar_key	NULL	NULL	NULL	5	100.00	Using where
+2	DEPENDENT SUBQUERY	sq2_alias2	ref	col_int_key	col_int_key	4	test.t1.pk	2	100.00	Using index
+Warnings:
+Note	1276	Field or reference 'alias1.col_int_key' of SELECT #2 was resolved in SELECT #1
+Note	1276	Field or reference 'alias1.col_varchar_key' of SELECT #2 was resolved in SELECT #1
+Note	1003	/* select#1 */ select `test`.`alias2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t1` `alias2` left join (`test`.`t1`) on(1) where <in_optimizer>(`test`.`alias2`.`col_varchar_key`,<exists>(/* select#2 */ select 1 from `test`.`t1` left join `test`.`t1` `sq2_alias2` on((`sq2_alias2`.`col_int_key` = `test`.`t1`.`pk`)) where ((`test`.`t1`.`pk` <> `t1`.`col_int_key`) and (`test`.`t1`.`col_varchar_key` > `t1`.`col_varchar_key`) and (<cache>(`test`.`alias2`.`col_varchar_key`) = `test`.`t1`.`col_varchar_nokey`))))
+SELECT alias2.col_varchar_nokey
+FROM t1 AS alias2
+LEFT JOIN v1 AS alias1 ON 1
+WHERE alias2.col_varchar_key IN (
+SELECT sq2_alias1.col_varchar_nokey
+FROM v1 AS sq2_alias1
+LEFT JOIN t1 AS sq2_alias2
+ON (sq2_alias2.col_int_key = sq2_alias1.pk)
+WHERE sq2_alias1.pk != alias1.col_int_key
+AND sq2_alias1.col_varchar_key > alias1.col_varchar_key
+);
+col_varchar_nokey
+d
+j
+m
+m
+m
+v
+v
+v
+v
+DROP TABLE t1;
+DROP VIEW v1,v2;
+#
+# Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY
+# HAS AN EMPTY RESULT
+#
+CREATE TABLE t1 (
+pk int NOT NULL,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+CREATE TABLE t2 (
+pk int NOT NULL AUTO_INCREMENT,
+col_int_nokey int NOT NULL,
+col_int_key int NOT NULL,
+col_time_key time NOT NULL,
+col_varchar_key varchar(1) NOT NULL,
+col_varchar_nokey varchar(1) NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_time_key (col_time_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b');
+SET @var2:=4, @var3:=8;
+
+Testcase without inner subquery
+EXPLAIN SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+EXPLAIN SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+SELECT * FROM ( SELECT @var3:=12, sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR
+sq4_alias1.col_varchar_key = @var3 ) AS alias3;
+@var3:=12	pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+SELECT @var3;
+@var3
+8
+
+Testcase with inner subquery; crashed WL#6095
+SET @var3=8;
+EXPLAIN SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+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	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3));
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+EXPLAIN SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	<derived2>	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DERIVED	NULL	NULL	NULL	NULL	NULL	NULL	NULL	no matching row in const table
+3	DEPENDENT SUBQUERY	c_sq1_alias1	system	PRIMARY,col_varchar_key	NULL	NULL	NULL	1	
+SELECT * FROM ( SELECT sq4_alias1.*
+FROM t1 AS sq4_alias1
+WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey)
+NOT IN
+(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1,
+c_sq1_alias1.col_varchar_nokey AS c_sq1_field2
+FROM t2 AS c_sq1_alias1
+WHERE (c_sq1_alias1.col_int_nokey != @var2
+OR c_sq1_alias1.pk != @var3)) ) AS alias3;
+pk	col_int_nokey	col_int_key	col_time_key	col_varchar_key	col_varchar_nokey
+DROP TABLE t1,t2;
 set optimizer_switch=default;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/type_temporal_fractional.result'
--- a/mysql-test/r/type_temporal_fractional.result	2012-02-02 10:58:18 +0000
+++ b/mysql-test/r/type_temporal_fractional.result	2012-02-07 20:32:47 +0000
@@ -1014,8 +1014,8 @@ a6	t6	HEX(WEIGHT_STRING(t6))
 -00:00:00.000003	-00:00:00.000003	7FFFFFFFFFFD
 -00:00:00.000002	-00:00:00.000002	7FFFFFFFFFFE
 -00:00:00.000001	-00:00:00.000001	7FFFFFFFFFFF
--00:00:00.000000	00:00:00.000000	800000000000
 00:00:00.000000	00:00:00.000000	800000000000
+-00:00:00.000000	00:00:00.000000	800000000000
 00:00:00.000001	00:00:00.000001	800000000001
 00:00:00.000002	00:00:00.000002	800000000002
 00:00:00.000003	00:00:00.000003	800000000003

=== modified file 'mysql-test/suite/funcs_1/r/innodb_views.result'
--- a/mysql-test/suite/funcs_1/r/innodb_views.result	2010-08-31 06:28:15 +0000
+++ b/mysql-test/suite/funcs_1/r/innodb_views.result	2012-02-07 11:56:30 +0000
@@ -15222,456 +15222,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 

=== modified file 'mysql-test/suite/funcs_1/r/memory_views.result'
--- a/mysql-test/suite/funcs_1/r/memory_views.result	2010-08-31 06:28:15 +0000
+++ b/mysql-test/suite/funcs_1/r/memory_views.result	2012-02-07 11:56:30 +0000
@@ -15224,456 +15224,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 

=== modified file 'mysql-test/suite/funcs_1/views/views_master.inc'
--- a/mysql-test/suite/funcs_1/views/views_master.inc	2010-11-29 13:04:34 +0000
+++ b/mysql-test/suite/funcs_1/views/views_master.inc	2012-02-07 11:56:30 +0000
@@ -2262,7 +2262,7 @@ while ($num1)
   dec $num1;
 }
 
-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;
 
 let $message=
 Plausibility checks for INSERTs and UPDATEs ( 4. and 5. above).

=== modified file 'mysql-test/suite/innodb/r/innodb.result'
--- a/mysql-test/suite/innodb/r/innodb.result	2011-12-13 11:44:15 +0000
+++ b/mysql-test/suite/innodb/r/innodb.result	2012-02-07 11:56:30 +0000
@@ -1974,15 +1974,15 @@ i	10
 select sql_big_result v,count(c) from t1 group by v limit 10;
 v	count(c)
 a	1
-a 	10
-b     	10
-c    	10
-d   	10
-e  	10
-f     	10
-g    	10
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
 h	10
-i     	10
+i	10
 select c,count(*) from t1 group by c limit 10;
 c	count(*)
 a	1

=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp	2012-01-29 00:57:40 +0000
+++ b/mysql-test/valgrind.supp	2012-02-07 11:56:30 +0000
@@ -985,7 +985,7 @@
    ...
    fun:my_b_flush_io_cache
    fun:_my_b_write
-   fun:_Z*10write_keysP10Sort_paramPPhjP11st_io_cacheS4_
+   fun:_Z*10write_keysP10Sort_paramP13Filesort_infojP11st_io_cacheS4_
    fun:_Z*13find_all_keysP10Sort_paramP10SQL_SELECTP13Filesort_infoP11st_io_cacheS6_P13Bounded_queueIhhEPy
    fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPyS7_
 }
@@ -1022,6 +1022,6 @@
    ...
    fun:my_b_flush_io_cache
    fun:_my_b_write
-   fun:_Z*10write_keysP10Sort_paramPPhjP11st_io_cacheS4_
+   fun:_Z*10write_keysP10Sort_paramP13Filesort_infojP11st_io_cacheS4_
    fun:_Z8filesortP3THDP5TABLEP13st_sort_fieldjP10SQL_SELECTybPyS7_
 }

=== modified file 'mysys/mf_radix.c'
--- a/mysys/mf_radix.c	2011-06-30 15:50:45 +0000
+++ b/mysys/mf_radix.c	2012-02-07 11:56:30 +0000
@@ -25,6 +25,11 @@
 
 	/* Radixsort */
 
+my_bool radixsort_is_appliccable(uint n_items, size_t size_of_element)
+{
+  return size_of_element <= 20 && n_items >= 1000 && n_items < 100000;
+}
+
 void radixsort_for_str_ptr(uchar **base, uint number_of_elements, size_t size_of_element, uchar **buffer)
 {
   uchar **end,**ptr,**buffer_ptr;

=== modified file 'mysys/mf_sort.c'
--- a/mysys/mf_sort.c	2011-06-30 15:46:53 +0000
+++ b/mysys/mf_sort.c	2012-02-07 11:56:30 +0000
@@ -23,7 +23,7 @@ void my_string_ptr_sort(uchar *base, uin
 #if INT_MAX > 65536L
   uchar **ptr=0;
 
-  if (size <= 20 && items >= 1000 && items < 100000 &&
+  if (radixsort_is_appliccable(items, size) &&
       (ptr= (uchar**) my_malloc(items*sizeof(char*),MYF(0))))
   {
     radixsort_for_str_ptr((uchar**) base,items,size,ptr);

=== modified file 'sql/filesort.cc'
--- a/sql/filesort.cc	2012-01-18 14:42:16 +0000
+++ b/sql/filesort.cc	2012-02-07 11:56:30 +0000
@@ -52,7 +52,7 @@ static ha_rows find_all_keys(Sort_param
                              IO_CACHE *tempfile,
                              Bounded_queue<uchar, uchar> *pq,
                              ha_rows *found_rows);
-static int write_keys(Sort_param *param,uchar * *sort_keys,
+static int write_keys(Sort_param *param, Filesort_info *fs_info,
                       uint count, IO_CACHE *buffer_file, IO_CACHE *tempfile);
 static void make_sortkey(Sort_param *param,uchar *to, uchar *ref_pos);
 static void register_used_fields(Sort_param *param);
@@ -60,7 +60,7 @@ static int merge_index(Sort_param *param
                        BUFFPEK *buffpek,
                        uint maxbuffer,IO_CACHE *tempfile,
                        IO_CACHE *outfile);
-static bool save_index(Sort_param *param,uchar **sort_keys, uint count, 
+static bool save_index(Sort_param *param, uint count,
                        Filesort_info *table_sort);
 static uint suffix_length(ulong string_length);
 static uint sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length,
@@ -346,8 +346,7 @@ ha_rows filesort(THD *thd, TABLE *table,
 
   if (maxbuffer == 0)			// The whole set is in memory
   {
-    if (save_index(&param, table_sort.get_sort_keys(),
-                   (uint) num_rows, &table_sort))
+    if (save_index(&param, (uint) num_rows, &table_sort))
       goto err;
   }
   else
@@ -742,8 +741,7 @@ static ha_rows find_all_keys(Sort_param
       {
         if (idx == param->max_keys_per_buffer)
         {
-          if (write_keys(param, fs_info->get_sort_keys(),
-                         idx, buffpek_pointers, tempfile))
+          if (write_keys(param, fs_info, idx, buffpek_pointers, tempfile))
              DBUG_RETURN(HA_POS_ERROR);
           idx= 0;
           indexpos++;
@@ -777,8 +775,7 @@ static ha_rows find_all_keys(Sort_param
     DBUG_RETURN(HA_POS_ERROR);			/* purecov: inspected */
   }
   if (indexpos && idx &&
-      write_keys(param, fs_info->get_sort_keys(),
-                 idx, buffpek_pointers, tempfile))
+      write_keys(param, fs_info, idx, buffpek_pointers, tempfile))
     DBUG_RETURN(HA_POS_ERROR);			/* purecov: inspected */
   const ha_rows retval= 
     my_b_inited(tempfile) ?
@@ -811,21 +808,19 @@ static ha_rows find_all_keys(Sort_param
 */
 
 static int
-write_keys(Sort_param *param, register uchar **sort_keys, uint count,
+write_keys(Sort_param *param, Filesort_info *fs_info, uint count,
            IO_CACHE *buffpek_pointers, IO_CACHE *tempfile)
 {
-  size_t sort_length, rec_length;
+  size_t rec_length;
   uchar **end;
   BUFFPEK buffpek;
   DBUG_ENTER("write_keys");
 
-  sort_length= param->sort_length;
   rec_length= param->rec_length;
-#ifdef MC68000
-  quicksort(sort_keys,count,sort_length);
-#else
-  my_string_ptr_sort((uchar*) sort_keys, (uint) count, sort_length);
-#endif
+  uchar **sort_keys= fs_info->get_sort_keys();
+
+  fs_info->sort_buffer(param, count);
+
   if (!my_b_inited(tempfile) &&
       open_cached_file(tempfile, mysql_tmpdir, TEMP_PREFIX, DISK_BUFFER_SIZE,
                        MYF(MY_WME)))
@@ -1157,20 +1152,19 @@ static void register_used_fields(Sort_pa
   }
 }
 
-
-static bool save_index(Sort_param *param, uchar **sort_keys, uint count, 
-                       Filesort_info *table_sort)
+static bool save_index(Sort_param *param, uint count, Filesort_info *table_sort)
 {
   uint offset,res_length;
   uchar *to;
   DBUG_ENTER("save_index");
 
-  my_string_ptr_sort((uchar*) sort_keys, count, param->sort_length);
+  table_sort->sort_buffer(param, count);
   res_length= param->res_length;
   offset= param->rec_length-res_length;
   if (!(to= table_sort->record_pointers= 
         (uchar*) my_malloc(res_length*count, MYF(MY_WME))))
     DBUG_RETURN(1);                 /* purecov: inspected */
+  uchar **sort_keys= table_sort->get_sort_keys();
   for (uchar **end= sort_keys+count ; sort_keys != end ; sort_keys++)
   {
     memcpy(to, *sort_keys+offset, res_length);

=== modified file 'sql/filesort_utils.cc'
--- a/sql/filesort_utils.cc	2011-11-07 15:32:36 +0000
+++ b/sql/filesort_utils.cc	2012-02-07 11:56:30 +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
@@ -18,6 +18,9 @@
 #include "sql_sort.h"
 #include "table.h"
 
+#include <algorithm>
+#include <functional>
+#include <vector>
 
 namespace {
 /**
@@ -116,3 +119,84 @@ void Filesort_buffer::free_sort_buffer()
   m_record_length= 0;
   m_start_of_data= NULL;
 }
+
+
+namespace {
+
+/*
+  An inline function which does memcmp().
+  This one turns out to be pretty fast on all platforms, except sparc.
+  See the accompanying unit tests, which measure various implementations.
+ */
+inline bool my_mem_compare(const uchar *s1, const uchar *s2, size_t len)
+{
+  DBUG_ASSERT(len > 0);
+  DBUG_ASSERT(s1 != NULL);
+  DBUG_ASSERT(s2 != NULL);
+  do {
+    if (*s1++ != *s2++)
+      return *--s1 < *--s2;
+  } while (--len != 0);
+  return false;
+}
+
+
+class Mem_compare :
+  public std::binary_function<const uchar*, const uchar*, bool>
+{
+public:
+  Mem_compare(size_t n) : m_size(n) {}
+  bool operator()(const uchar *s1, const uchar *s2) const
+  {
+#ifdef __sun
+    // Usually faster on SUN, see comment for native_compare()
+    return memcmp(s1, s2, m_size) < 0;
+#else
+    return my_mem_compare(s1, s2, m_size);
+#endif
+  }
+private:
+  size_t m_size;
+};
+
+template <typename type>
+size_t try_reserve(std::pair<type*, ptrdiff_t> *buf, ptrdiff_t size)
+{
+  *buf= std::get_temporary_buffer<type>(size);
+  if (buf->second != size)
+  {
+    std::return_temporary_buffer(buf->first);
+    return 0;
+  }
+  return buf->second;
+}
+
+} // namespace
+
+void Filesort_buffer::sort_buffer(const Sort_param *param, uint count)
+{
+  if (count <= 1)
+    return;
+  uchar **keys= get_sort_keys();
+  std::pair<uchar**, ptrdiff_t> buffer;
+  if (radixsort_is_appliccable(count, param->sort_length) &&
+      try_reserve(&buffer, count))
+  {
+    radixsort_for_str_ptr(keys, count, param->sort_length, buffer.first);
+    std::return_temporary_buffer(buffer.first);
+    return;
+  }
+  /*
+    std::stable_sort has some extra overhead in allocating the temp buffer,
+    which takes some time. The cutover point where it starts to get faster
+    than quicksort seems to be somewhere around 10 to 40 records.
+    So we're a bit conservative, and stay with quicksort up to 100 records.
+  */
+  if (count < 100)
+  {
+    size_t size= param->sort_length;
+    my_qsort2(keys, count, sizeof(uchar*), get_ptr_compare(size), &size);
+    return;
+  }
+  std::stable_sort(keys, keys + count, Mem_compare(param->sort_length));
+}

=== modified file 'sql/filesort_utils.h'
--- a/sql/filesort_utils.h	2012-01-18 14:42:16 +0000
+++ b/sql/filesort_utils.h	2012-02-07 11:56:30 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 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
@@ -22,6 +22,7 @@
 
 #include <utility>
 
+class Sort_param;
 /*
   Calculate cost of merge sort
 
@@ -65,6 +66,9 @@ public:
     m_idx_array(), m_record_length(0), m_start_of_data(NULL)
   {}
 
+  /** Sort me... */
+  void sort_buffer(const Sort_param *param, uint count);
+
   /// Initializes a record pointer.
   uchar *get_record_buffer(uint idx)
   {

=== modified file 'sql/item.h'
--- a/sql/item.h	2012-02-06 12:47:30 +0000
+++ b/sql/item.h	2012-02-07 10:30:39 +0000
@@ -2923,7 +2923,16 @@ public:
       (*ref)->update_used_tables(); 
   }
   virtual table_map resolved_used_tables() const;
-  table_map not_null_tables() const { return (*ref)->not_null_tables(); }
+  table_map not_null_tables() const
+  {
+    /*
+      It can happen that our 'depended_from' member is set but the
+      'depended_from' member of the referenced item is not (example: if a
+      field in a subquery belongs to an outer merged view), so we first test
+      ours:
+    */
+    return depended_from ? OUTER_REF_TABLE_BIT : (*ref)->not_null_tables();
+  }
   void set_result_field(Field *field)	{ result_field= field; }
   bool is_result_field() { return 1; }
   void save_in_result_field(bool no_conversions)

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2012-01-31 15:16:16 +0000
+++ b/sql/log_event.cc	2012-02-07 23:33:54 +0000
@@ -4316,11 +4316,11 @@ int Query_log_event::do_apply_event(Rela
         nothing to do.
       */
       /*
-        We do not replicate IGNORE_DIR_IN_CREATE. That is, if the master is a
-        slave which runs with SQL_MODE=IGNORE_DIR_IN_CREATE, this should not
+        We do not replicate MODE_NO_DIR_IN_CREATE. That is, if the master is a
+        slave which runs with SQL_MODE=MODE_NO_DIR_IN_CREATE, this should not
         force us to ignore the dir too. Imagine you are a ring of machines, and
         one has a disk problem so that you temporarily need
-        IGNORE_DIR_IN_CREATE on this machine; you don't want it to propagate
+        MODE_NO_DIR_IN_CREATE on this machine; you don't want it to propagate
         elsewhere (you don't want all slaves to start ignoring the dirs).
       */
       if (sql_mode_inited)

=== modified file 'sql/partition_info.cc'
--- a/sql/partition_info.cc	2011-12-19 12:53:11 +0000
+++ b/sql/partition_info.cc	2012-02-07 23:33:54 +0000
@@ -1233,9 +1233,7 @@ end:
 */
 static void warn_if_dir_in_part_elem(THD *thd, partition_element *part_elem)
 {
-#ifdef HAVE_READLINK
-  if (!my_use_symdir || (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE))
-#endif
+  if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)
   {
     if (part_elem->data_file_name)
       push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,

=== modified file 'sql/sql_executor.cc'
--- a/sql/sql_executor.cc	2012-01-31 11:19:25 +0000
+++ b/sql/sql_executor.cc	2012-02-07 14:50:31 +0000
@@ -2564,9 +2564,9 @@ test_if_quick_select(JOIN_TAB *tab)
    Reads content of constant table
    @param tab  table
    @param pos  position of table in query plan
-   @retval 0   ok
-   @retval >0  error
-   @retval <0  ??
+   @retval 0   ok, one row was found or one NULL-complemented row was created
+   @retval -1  ok, no row was found and no NULL-complemented row was created
+   @retval 1   error
 */
 
 int
@@ -2687,6 +2687,16 @@ join_read_const_table(JOIN_TAB *tab, POS
 }
 
 
+/**
+  Read a constant table when there is at most one matching row, using a table
+  scan.
+
+  @param tab			Table to read
+
+  @retval  0  Row was found
+  @retval  -1 Row was not found
+  @retval  1  Got an error (other than row not found) during read
+*/
 static int
 join_read_system(JOIN_TAB *tab)
 {
@@ -2713,16 +2723,14 @@ join_read_system(JOIN_TAB *tab)
 
 
 /**
-  Read a [constant] table when there is at most one matching row.
+  Read a constant table when there is at most one matching row, using an
+  index lookup.
 
   @param tab			Table to read
 
-  @retval
-    0	Row was found
-  @retval
-    -1   Row was not found
-  @retval
-    1   Got an error (other than row not found) during read
+  @retval 0  Row was found
+  @retval -1 Row was not found
+  @retval 1  Got an error (other than row not found) during read
 */
 
 static int

=== modified file 'sql/sql_optimizer.cc'
--- a/sql/sql_optimizer.cc	2012-02-06 12:47:30 +0000
+++ b/sql/sql_optimizer.cc	2012-02-07 20:32:47 +0000
@@ -377,11 +377,9 @@ JOIN::optimize()
   }
 
   if (const_table_map != found_const_table_map &&
-      !(select_options & SELECT_DESCRIBE) &&
-      (!conds ||
-       !(conds->used_tables() & RAND_TABLE_BIT) ||
-       select_lex->master_unit() == &thd->lex->unit)) // upper level SELECT
+      !(select_options & SELECT_DESCRIBE))
   {
+    // There is at least one empty const table
     zero_result_cause= "no matching row in const table";
     DBUG_PRINT("error",("Error: %s", zero_result_cause));
     goto setup_subq_exit;

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2012-02-03 16:00:30 +0000
+++ b/sql/sql_parse.cc	2012-02-08 09:44:47 +0000
@@ -2603,14 +2603,13 @@ case SQLCOM_PREPARE:
     /* Might have been updated in create_table_precheck */
     create_info.alias= create_table->alias;
 
-#ifdef HAVE_READLINK
-    /* Fix names if symlinked tables */
+    /* Fix names if symlinked or relocated tables */
     if (append_file_to_dir(thd, &create_info.data_file_name,
 			   create_table->table_name) ||
 	append_file_to_dir(thd, &create_info.index_file_name,
 			   create_table->table_name))
       goto end_with_restore_list;
-#endif
+
     /*
       If no engine type was given, work out the default now
       rather than at parse-time.

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2012-01-31 15:16:16 +0000
+++ b/sql/sql_table.cc	2012-02-07 23:33:54 +0000
@@ -4431,7 +4431,6 @@ bool mysql_create_table_no_lock(THD *thd
 
   THD_STAGE_INFO(thd, stage_creating_table);
 
-#ifdef HAVE_READLINK
   {
     size_t dirlen;
     char   dirpath[FN_REFLEN];
@@ -4478,8 +4477,7 @@ bool mysql_create_table_no_lock(THD *thd
   }
 #endif /* WITH_PARTITION_STORAGE_ENGINE */
 
-  if (!my_use_symdir || (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE))
-#endif /* HAVE_READLINK */
+  if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)
   {
     if (create_info->data_file_name)
       push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,

=== modified file 'sql/table.h'
--- a/sql/table.h	2012-01-31 15:16:16 +0000
+++ b/sql/table.h	2012-02-07 11:56:30 +0000
@@ -325,6 +325,10 @@ public:
   uchar     *record_pointers;    /* If sorted in memory */
   ha_rows   found_records;      /* How many records in sort */
 
+  /** Sort filesort_buffer */
+  void sort_buffer(Sort_param *param, uint count)
+  { filesort_buffer.sort_buffer(param, count); }
+
   /**
      Accessors for Filesort_buffer (which @c).
   */

=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc	2012-02-03 14:37:46 +0000
+++ b/storage/archive/ha_archive.cc	2012-02-07 23:33:54 +0000
@@ -737,12 +737,12 @@ void ha_archive::frm_load(const char *na
   {
     if (!mysql_file_fstat(frm_file, &file_stat, MYF(MY_WME)))
     {
-      frm_ptr= (uchar *) my_malloc(sizeof(uchar) * file_stat.st_size, MYF(0));
+      frm_ptr= (uchar *) my_malloc(sizeof(uchar) * (size_t) file_stat.st_size, MYF(0));
       if (frm_ptr)
       {
-        if (my_read(frm_file, frm_ptr, file_stat.st_size, MYF(0)) ==
+        if (my_read(frm_file, frm_ptr, (size_t) file_stat.st_size, MYF(0)) ==
             (size_t) file_stat.st_size)
-          azwrite_frm(dst, (char *) frm_ptr, file_stat.st_size);
+          azwrite_frm(dst, (char *) frm_ptr, (size_t) file_stat.st_size);
         my_free(frm_ptr);
       }
     }
@@ -831,7 +831,10 @@ int ha_archive::create(const char *name,
   /* 
     We reuse name_buff since it is available.
   */
-  if (create_info->data_file_name && create_info->data_file_name[0] != '#')
+#ifdef HAVE_READLINK
+  if (my_use_symdir &&
+      create_info->data_file_name &&
+      create_info->data_file_name[0] != '#')
   {
     DBUG_PRINT("ha_archive", ("archive will create stream file %s", 
                         create_info->data_file_name));
@@ -842,12 +845,29 @@ int ha_archive::create(const char *name,
               MY_REPLACE_EXT | MY_UNPACK_FILENAME);
   }
   else
+#endif /* HAVE_READLINK */
   {
+    if (create_info->data_file_name)
+    {
+      push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN,
+                          WARN_OPTION_IGNORED,
+                          ER_DEFAULT(WARN_OPTION_IGNORED),
+                          "DATA DIRECTORY");
+    }
     fn_format(name_buff, name, "", ARZ,
               MY_REPLACE_EXT | MY_UNPACK_FILENAME);
     linkname[0]= 0;
   }
 
+  /* Archive engine never uses INDEX DIRECTORY. */
+  if (create_info->index_file_name)
+  {
+    push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN,
+                        WARN_OPTION_IGNORED,
+                        ER_DEFAULT(WARN_OPTION_IGNORED),
+                        "INDEX DIRECTORY");
+  }
+
   /*
     There is a chance that the file was "discovered". In this case
     just use whatever file is there.
@@ -1634,15 +1654,14 @@ int ha_archive::optimize(THD* thd, HA_CH
 
   azclose(&writer);
   share->dirty= FALSE;
+  azclose(&archive);
+  archive_reader_open= FALSE;
 
   // make the file we just wrote be our data file
   rc= my_rename(writer_filename, share->data_file_name, MYF(0));
   share->in_optimize= false;
   mysql_mutex_unlock(&share->mutex);
 
-  azclose(&archive);
-  archive_reader_open= FALSE;
-
   DBUG_RETURN(rc);
 error:
   DBUG_PRINT("ha_archive", ("Failed to recover, error was %d", rc));

=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc	2012-02-02 12:48:48 +0000
+++ b/storage/myisam/ha_myisam.cc	2012-02-07 23:33:54 +0000
@@ -1942,10 +1942,27 @@ int ha_myisam::create(const char *name,
                                (ulonglong) 0);
   create_info.data_file_length= ((ulonglong) share->max_rows *
                                  share->avg_row_length);
-  create_info.data_file_name= ha_create_info->data_file_name;
-  create_info.index_file_name= ha_create_info->index_file_name;
   create_info.language= share->table_charset->number;
 
+#ifdef HAVE_READLINK
+  if (my_use_symdir)
+  {
+    create_info.data_file_name= ha_create_info->data_file_name;
+    create_info.index_file_name= ha_create_info->index_file_name;
+  }
+  else
+#endif /* HAVE_READLINK */
+  {
+    if (ha_create_info->data_file_name)
+      push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN,
+                          WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED),
+                          "DATA DIRECTORY");
+    if (ha_create_info->index_file_name)
+      push_warning_printf(table_arg->in_use, Sql_condition::WARN_LEVEL_WARN,
+                          WARN_OPTION_IGNORED, ER(WARN_OPTION_IGNORED),
+                          "INDEX DIRECTORY");
+  }
+
   if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE)
     create_flags|= HA_CREATE_TMP_TABLE;
   if (ha_create_info->options & HA_CREATE_KEEP_FILES)

=== modified file 'storage/myisam/mi_dbug.c'
--- a/storage/myisam/mi_dbug.c	2011-06-30 15:46:53 +0000
+++ b/storage/myisam/mi_dbug.c	2012-02-07 13:06:27 +0000
@@ -36,7 +36,6 @@ void _mi_print_key(FILE *stream, registe
   {
     if (flag++)
       (void) putc('-',stream);
-    end= key+ keyseg->length;
     if (keyseg->flag & HA_NULL_PART)
     {
       /* A NULL value is encoded by a 1-byte flag. Zero means NULL. */
@@ -46,6 +45,7 @@ void _mi_print_key(FILE *stream, registe
 	continue;
       }
     }
+    end= key + keyseg->length;
 
     switch (keyseg->type) {
     case HA_KEYTYPE_BINARY:

=== modified file 'unittest/gunit/CMakeLists.txt'
--- a/unittest/gunit/CMakeLists.txt	2012-01-31 15:16:16 +0000
+++ b/unittest/gunit/CMakeLists.txt	2012-02-07 11:56:30 +0000
@@ -233,6 +233,7 @@ SET(TESTS
   decimal
   dynarray
   filesort_buffer
+  filesort_compare
   mdl
   mdl_mytap
   my_bitmap

=== modified file 'unittest/gunit/dynarray-t.cc'
--- a/unittest/gunit/dynarray-t.cc	2011-12-20 09:51:05 +0000
+++ b/unittest/gunit/dynarray-t.cc	2012-02-07 11:56:30 +0000
@@ -148,7 +148,7 @@ void generate_test_data(Key_use *keys, T
 
 // Play around with these constants to see std::sort speedup vs. my_qsort.
 const int num_elements= 200;
-const int num_iterations= 10;
+const int num_iterations= 1000;
 
 /*
   This class is used for comparing performance of

=== added file 'unittest/gunit/filesort_compare-t.cc'
--- a/unittest/gunit/filesort_compare-t.cc	1970-01-01 00:00:00 +0000
+++ b/unittest/gunit/filesort_compare-t.cc	2012-02-07 11:56:30 +0000
@@ -0,0 +1,466 @@
+/* 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 */
+
+// First include (the generated) my_config.h, to get correct platform defines.
+#include "my_config.h"
+#include <gtest/gtest.h>
+
+#include "filesort_utils.h"
+
+#include <algorithm>
+#include <memory>
+#include <vector>
+
+namespace {
+
+/*
+  Below are some performance microbenchmarks in order to compare our sorting
+  options: 
+  my_qsort2        - requires no extra memory, uses insert sort on small ranges,
+                     uses quicksort on larger ranges
+  radixsort -        requires extra memory: array of n pointers,
+                     seems to be quite fast on intel *when it is appliccable*:
+                     if (size <= 20 && items >= 1000 && items < 100000)
+  std::sort -        requires no extra memory,
+                     typically implemented with introsort/insertion sort
+  std::stable_sort - requires extra memory: array of n pointers,
+                     typically implemented with mergesort
+
+  The record format for filesort is constructed in such a way that we can
+  compare records byte-by-byte, without knowing the data types.
+  Nullable fields (maybe_null()) are pre-pended with an extra byte.
+  If we are sorting in descending mode, all the bytes are simply flipped.
+
+  This means that any variant of memcmp() can be used for comparing record.
+  Below we test different variants, including memcmp() itself.
+*/
+
+// A simple helper function to determine array size.
+template <class T, int size>
+int array_size(const T (&)[size])
+{
+  return size;
+}
+
+inline int bytes_to_int(const uchar *s)
+{
+  int val;
+  longget(val, s);
+  return val ^ 0x80000000;
+}
+
+inline void int_to_bytes(uchar *s, int val)
+{
+  val= val ^ 0x80000000;
+  longstore(s, val);
+}
+
+
+TEST(AlignmentTest, IntsToBytesToInt)
+{
+  uchar buf[10];
+  memset(buf, 0, sizeof(buf));
+  for (int ix= 0; ix < 6; ++ix)
+  {
+    int test_data[]= { INT_MIN32, -42, -1, 0, 1, 42, INT_MAX32 };
+    for (int iy= 0; iy < array_size(test_data); ++iy)
+    {
+      int val= test_data[iy];
+      int_to_bytes(buf+ix, val);
+      EXPECT_EQ(val, bytes_to_int(buf+ix));
+    }
+  }
+}
+
+
+class FileSortCompareTest : public ::testing::Test
+{
+protected:
+  // Do each sort algorithm this many times. Increase value for benchmarking!
+  static const int num_iterations= 1;
+  // Number of records.
+  static const int num_records= 100 * 1000;
+  // Number of keys in each record.
+  static const int keys_per_record= 4;
+  // Size of each record.
+  static const int record_size= keys_per_record * sizeof(int);
+
+  // Static buffer containing data to be sorted.
+  // (actually: we only sort the sort_keys below, data is stable).
+  static std::vector<int> test_data;
+
+  static void SetUpTestCase()
+  {
+    test_data.reserve(num_records * keys_per_record);
+    union { int val; uchar buf[sizeof(int)]; } sort_str;
+
+    for (int ix= 0; ix < num_records * keys_per_record; ++ix)
+    {
+      int val= ix / (10 * keys_per_record);
+      if (ix % 10 == 0) val= -val;
+      int_to_bytes(sort_str.buf, val);
+      test_data.push_back(sort_str.val);
+    }
+    // Comment away shuffling for testing partially pre-sorted data.
+    std::random_shuffle(test_data.begin(), test_data.end());
+  }
+
+  static void TearDownTestCase()
+  {
+    // Delete the data now, rather than during exit().
+    std::vector<int>().swap(test_data);
+  }
+
+  virtual void SetUp()
+  {
+    sort_keys= new uchar* [num_records];
+    for (int ix= 0; ix < num_records; ++ix)
+      sort_keys[ix]=
+        static_cast<uchar*>(static_cast<void*>(&test_data[keys_per_record*ix]));
+  }
+
+  virtual void TearDown()
+  {
+    delete[] sort_keys;
+  }
+
+  uchar **sort_keys;
+};
+std::vector<int> FileSortCompareTest::test_data;
+
+/*
+  Some different mem_compare functions.
+  The first one seems to win on all platforms, except sparc,
+  where the builtin memcmp() wins.
+ */
+inline bool mem_compare_1(const uchar *s1, const uchar *s2, size_t len)
+{
+  do {
+    if (*s1++ != *s2++)
+      return *--s1 < *--s2;
+  } while (--len != 0);
+  return false;
+}
+
+inline bool mem_compare_2(const uchar *s1, const uchar *s2, size_t len)
+{
+  int v= 0;
+  while (len-- > 0 && v == 0)
+  {
+    v= *(s1++) - *(s2++);
+  }
+  return v < 0;
+}
+
+inline bool mem_compare_3(const uchar *s1, const uchar *s2, size_t len)
+{
+  while (--len && (s1[0] == s2[0]))
+  {
+    ++s1; ++s2;
+  }
+  return s1[0] < s2[0];
+}
+
+#if defined(__WIN__)
+#pragma intrinsic(memcmp)
+#endif
+// For gcc, __builtin_memcmp is actually *slower* than the library call:
+// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
+
+
+class Mem_compare_memcmp :
+  public std::binary_function<const uchar*, const uchar*, bool>
+{
+public:
+  Mem_compare_memcmp(size_t n) : m_size(n) {}
+  bool operator()(const uchar *s1, const uchar *s2)
+  {
+    return memcmp(s1, s2, m_size) < 0;
+  }
+  size_t m_size;
+};
+
+
+class Mem_compare_1 :
+  public std::binary_function<const uchar*, const uchar*, bool>
+{
+public:
+  Mem_compare_1(size_t n) : m_size(n) {}
+  bool operator()(const uchar *s1, const uchar *s2)
+  {
+    return mem_compare_1(s1, s2, m_size);
+  }
+  size_t m_size;
+};
+
+
+class Mem_compare_2 :
+  public std::binary_function<const uchar*, const uchar*, bool>
+{
+public:
+  Mem_compare_2(size_t n) : m_size(n) {}
+  bool operator()(const uchar *s1, const uchar *s2)
+  {
+    return mem_compare_2(s1, s2, m_size);
+  }
+  size_t m_size;
+};
+
+
+class Mem_compare_3 :
+  public std::binary_function<const uchar*, const uchar*, bool>
+{
+public:
+  Mem_compare_3(size_t n) : m_size(n) {}
+  bool operator()(const uchar *s1, const uchar *s2)
+  {
+    return mem_compare_3(s1, s2, m_size);
+  }
+  size_t m_size;
+};
+
+
+#define COMPARE(N) if (s1[N] != s2[N]) return s1[N] < s2[N]
+
+class Mem_compare_0 : 
+  public std::binary_function<const uchar*, const uchar*, bool>
+{
+public:
+  Mem_compare_0(size_t n) : m_size(n) {}
+  bool operator()(const uchar *s1, const uchar *s2)
+  {
+    size_t len= m_size;
+    while(len)
+    {
+      COMPARE(0);
+      COMPARE(1);
+      COMPARE(2);
+      COMPARE(3);
+      len-= 4;
+      s1 += 4;
+      s2 += 4;
+    }
+    return s1[0] < s2[0];
+  }
+  size_t m_size;
+};
+
+
+// This one works for any number of keys.
+// We treat the first key as int, the rest byte-by-byte.
+class Mem_compare_int : 
+  public std::binary_function<const uchar*, const uchar*, bool>
+{
+public:
+  Mem_compare_int(size_t n) : m_size(n), rest(n - sizeof(int)) {}
+  bool operator()(const uchar *s1, const uchar *s2)
+  {
+    int int1= bytes_to_int(s1);
+    int int2= bytes_to_int(s2);
+    if (int1 == int2)
+      return mem_compare_1(s1 + rest, s2 + rest, rest);
+    return int1 < int2;
+  }
+private:
+  size_t m_size;
+  const size_t rest;
+};
+
+class Mem_compare_int_4 :
+  public std::binary_function<const uchar*, const uchar*, bool>
+{
+public:
+  Mem_compare_int_4(size_t) : keyno(1) {}
+  bool operator() (const uchar *s1, const uchar *s2)
+  {
+    int inta1= bytes_to_int(s1);
+    int intb1= bytes_to_int(s2);
+    if (keyno < 4 && inta1 == intb1)
+    {
+      ++keyno;
+      return operator()(s1 + sizeof(int), s2 + sizeof(int));
+    }
+    return inta1 < intb1;
+  }
+  int keyno;
+};
+
+/*
+  Several sorting tests below, each one runs num_iterations.
+  For each iteration we take a copy of the key pointers, and sort the copy.
+  Most of the tests below are run with std::sort and std::stable_sort.
+  Stable sort seems to be faster for all test cases, on all platforms.
+ */
+TEST_F(FileSortCompareTest, SetUpOnly)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+  }
+}
+
+TEST_F(FileSortCompareTest, RadixSort)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::pair<uchar**, ptrdiff_t> buffer=
+      std::get_temporary_buffer<uchar*>(num_records);
+    radixsort_for_str_ptr(&keys[0], num_records, record_size, buffer.first);
+    std::return_temporary_buffer(buffer.first);
+  }
+}
+
+TEST_F(FileSortCompareTest, MyQsort)
+{
+  size_t size= record_size;
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    my_qsort2((uchar*) &keys[0], num_records, sizeof(uchar*),
+              get_ptr_compare(record_size), &size);
+  }
+}
+
+TEST_F(FileSortCompareTest, StdSortmemcmp)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::sort(keys.begin(), keys.end(), Mem_compare_memcmp(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdStableSortmemcmp)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::stable_sort(keys.begin(), keys.end(),
+                     Mem_compare_memcmp(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdSortCompare1)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::sort(keys.begin(), keys.end(), Mem_compare_1(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdStableSortCompare1)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::stable_sort(keys.begin(), keys.end(), Mem_compare_1(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdSortCompare2)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::sort(keys.begin(), keys.end(), Mem_compare_2(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdStableSortCompare2)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::stable_sort(keys.begin(), keys.end(), Mem_compare_2(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdSortCompare3)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::sort(keys.begin(), keys.end(), Mem_compare_3(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdStableSortCompare3)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::stable_sort(keys.begin(), keys.end(), Mem_compare_3(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdSortCompare4)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::sort(keys.begin(), keys.end(), Mem_compare_0(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdStableSortCompare4)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::stable_sort(keys.begin(), keys.end(), Mem_compare_0(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdSortIntCompare)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::sort(keys.begin(), keys.end(), Mem_compare_int(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdStableSortIntCompare)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::stable_sort(keys.begin(), keys.end(), Mem_compare_int(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdSortIntIntIntInt)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::sort(keys.begin(), keys.end(),
+              Mem_compare_int_4(record_size));
+  }
+}
+
+TEST_F(FileSortCompareTest, StdStableSortIntIntIntInt)
+{
+  for (int ix= 0; ix < num_iterations; ++ix)
+  {
+    std::vector<uchar*> keys(sort_keys, sort_keys + num_records);
+    std::stable_sort(keys.begin(), keys.end(),
+                     Mem_compare_int_4(record_size));
+  }
+}
+
+}  // namespace

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