List:Commits« Previous MessageNext Message »
From:Ole John Aske Date:February 23 2011 1:09pm
Subject:bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch
(ole.john.aske:3439 to 3440)
View as plain text  
 3440 Ole John Aske	2011-02-23 [merge]
      Merge from mainline 'telco' to SPJ branch.

    added:
      mysql-test/include/check_qep.inc
      mysql-test/include/execute_with_statistics.inc
      mysql-test/include/expect_qep.inc
      mysql-test/suite/ndb/r/ndb_restore_schema_tolerance.result
      mysql-test/suite/ndb/t/ndb_restore_schema_tolerance.test
      storage/ndb/include/util/NdbTypesUtil.hpp
    renamed:
      mysql-test/suite/ndb/r/ndb_blob_restore.result => mysql-test/suite/ndb/r/ndb_restore_schema_blobs.result
      mysql-test/suite/ndb/r/ndb_restore.result => mysql-test/suite/ndb/r/ndb_restore_misc.result
      mysql-test/suite/ndb/r/ndb_restore_compat.result => mysql-test/suite/ndb/r/ndb_restore_compat_downward.result
      mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result => mysql-test/suite/ndb/r/ndb_restore_compat_endianness.result
      mysql-test/suite/ndb/r/ndb_restore_lossy_charbinary_conv.result => mysql-test/suite/ndb/r/ndb_restore_conv_lossy_charbinary.result
      mysql-test/suite/ndb/r/ndb_restore_lossy_integral_conv.result => mysql-test/suite/ndb/r/ndb_restore_conv_lossy_integral.result
      mysql-test/suite/ndb/r/ndb_restore_options.result => mysql-test/suite/ndb/r/ndb_restore_schema_subsets.result
      mysql-test/suite/ndb/r/ndb_restore_padding_preservation.result => mysql-test/suite/ndb/r/ndb_restore_conv_padding.result
      mysql-test/suite/ndb/r/ndb_restore_partition.result => mysql-test/suite/ndb/r/ndb_restore_schema_partitions.result
      mysql-test/suite/ndb/r/ndb_restore_promotion.result => mysql-test/suite/ndb/r/ndb_restore_conv_promotion.result
      mysql-test/suite/ndb/r/ndb_restore_rewrite_db.result => mysql-test/suite/ndb/r/ndb_restore_schema_rewrites.result
      mysql-test/suite/ndb/t/ndb_blob_restore.test => mysql-test/suite/ndb/t/ndb_restore_schema_blobs.test
      mysql-test/suite/ndb/t/ndb_restore.test => mysql-test/suite/ndb/t/ndb_restore_misc.test
      mysql-test/suite/ndb/t/ndb_restore_compat.test => mysql-test/suite/ndb/t/ndb_restore_compat_downward.test
      mysql-test/suite/ndb/t/ndb_restore_compressed-master.opt => mysql-test/suite/ndb/t/ndb_restore_compat_compression-master.opt
      mysql-test/suite/ndb/t/ndb_restore_compressed.test => mysql-test/suite/ndb/t/ndb_restore_compat_compression.test
      mysql-test/suite/ndb/t/ndb_restore_different_endian_data.test => mysql-test/suite/ndb/t/ndb_restore_compat_endianness.test
      mysql-test/suite/ndb/t/ndb_restore_lossy_charbinary_conv.test => mysql-test/suite/ndb/t/ndb_restore_conv_lossy_charbinary.test
      mysql-test/suite/ndb/t/ndb_restore_lossy_integral_conv.test => mysql-test/suite/ndb/t/ndb_restore_conv_lossy_integral.test
      mysql-test/suite/ndb/t/ndb_restore_options.test => mysql-test/suite/ndb/t/ndb_restore_schema_subsets.test
      mysql-test/suite/ndb/t/ndb_restore_padding_preservation.test => mysql-test/suite/ndb/t/ndb_restore_conv_padding.test
      mysql-test/suite/ndb/t/ndb_restore_partition.test => mysql-test/suite/ndb/t/ndb_restore_schema_partitions.test
      mysql-test/suite/ndb/t/ndb_restore_promotion.test => mysql-test/suite/ndb/t/ndb_restore_conv_promotion.test
      mysql-test/suite/ndb/t/ndb_restore_rewrite_db.test => mysql-test/suite/ndb/t/ndb_restore_schema_rewrites.test
    modified:
      client/mysqldump.c
      include/my_bitmap.h
      mysql-test/r/greedy_optimizer.result
      mysql-test/r/join.result
      mysql-test/r/status.result
      mysql-test/r/subselect.result
      mysql-test/suite/ndb/r/ndb_join_pushdown.result
      mysql-test/suite/ndb/t/ndb_restore_print.test
      mysql-test/t/greedy_optimizer.test
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster.h
      sql/ha_ndbcluster_binlog.cc
      sql/ha_ndbcluster_binlog.h
      sql/mysql_priv.h
      sql/mysqld.cc
      sql/rpl_utility.cc
      sql/rpl_utility.h
      sql/set_var.cc
      sql/set_var.h
      sql/sql_class.h
      sql/sql_select.cc
      storage/ndb/include/util/NdbSqlUtil.hpp
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/vm/LongSignal.cpp
      storage/ndb/src/kernel/vm/TransporterCallback.cpp
      storage/ndb/src/mgmsrv/ConfigManager.cpp
      storage/ndb/src/mgmsrv/ConfigManager.hpp
      storage/ndb/test/ndbapi/testDict.cpp
      storage/ndb/test/ndbapi/testMgm.cpp
      storage/ndb/test/ndbapi/testNdbApi.cpp
      storage/ndb/test/ndbapi/testNodeRestart.cpp
      storage/ndb/test/ndbapi/testSystemRestart.cpp
      storage/ndb/test/ndbapi/test_event.cpp
      storage/ndb/test/run-test/conf-dl145a.cnf
      storage/ndb/test/run-test/conf-ndb07.cnf
      storage/ndb/tools/restore/consumer_restore.cpp
      storage/ndb/tools/restore/consumer_restore.hpp
      mysql-test/suite/ndb/r/ndb_restore_schema_subsets.result
      mysql-test/suite/ndb/t/ndb_restore_schema_blobs.test
      mysql-test/suite/ndb/t/ndb_restore_misc.test
      mysql-test/suite/ndb/t/ndb_restore_compat_downward.test
      mysql-test/suite/ndb/t/ndb_restore_compat_compression-master.opt
      mysql-test/suite/ndb/t/ndb_restore_compat_compression.test
      mysql-test/suite/ndb/t/ndb_restore_compat_endianness.test
      mysql-test/suite/ndb/t/ndb_restore_conv_lossy_charbinary.test
      mysql-test/suite/ndb/t/ndb_restore_conv_lossy_integral.test
      mysql-test/suite/ndb/t/ndb_restore_schema_subsets.test
      mysql-test/suite/ndb/t/ndb_restore_conv_padding.test
      mysql-test/suite/ndb/t/ndb_restore_schema_partitions.test
      mysql-test/suite/ndb/t/ndb_restore_conv_promotion.test
      mysql-test/suite/ndb/t/ndb_restore_schema_rewrites.test
 3439 jonas oreland	2011-02-18 [merge]
      ndb spj - merge 70-main

    modified:
      storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
      storage/ndb/include/ndb_constants.h
      storage/ndb/include/ndbapi/NdbDictionary.hpp
      storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/lgman.cpp
      storage/ndb/src/ndbapi/NdbDictionary.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2010-10-18 13:46:27 +0000
+++ b/client/mysqldump.c	2011-02-21 08:55:03 +0000
@@ -3872,6 +3872,8 @@ static int dump_tablespaces(char* ts_whe
   DBUG_RETURN(0);
 }
 
+
+#ifndef MCP_BUG54316
 static int
 is_ndbinfo(MYSQL* mysql, const char* dbname)
 {
@@ -3912,6 +3914,8 @@ is_ndbinfo(MYSQL* mysql, const char* dbn
 
   return 0;
 }
+#endif
+
 
 static int dump_all_databases()
 {
@@ -3927,8 +3931,10 @@ static int dump_all_databases()
         !my_strcasecmp(&my_charset_latin1, row[0], "information_schema"))
       continue;
 
+#ifndef MCP_BUG54316
     if (is_ndbinfo(mysql, row[0]))
       continue;
+#endif
 
     if (dump_all_tables_in_db(row[0]))
       result=1;
@@ -3948,8 +3954,10 @@ static int dump_all_databases()
           !my_strcasecmp(&my_charset_latin1, row[0], "information_schema"))
         continue;
 
+#ifndef MCP_BUG54316
     if (is_ndbinfo(mysql, row[0]))
       continue;
+#endif
 
       if (dump_all_views_in_db(row[0]))
         result=1;
@@ -4057,11 +4065,13 @@ int init_dumping_tables(char *qdatabase)
 
 static int init_dumping(char *database, int init_func(char*))
 {
+#ifndef MCP_BUG54316
   if (is_ndbinfo(mysql, database))
   {
     verbose_msg("-- Skipping dump of ndbinfo database\n");
     return 0;
   }
+#endif
 
   if (mysql_select_db(mysql, database))
   {

=== modified file 'include/my_bitmap.h'
--- a/include/my_bitmap.h	2010-10-12 11:54:35 +0000
+++ b/include/my_bitmap.h	2011-02-21 11:38:36 +0000
@@ -162,22 +162,6 @@ static inline my_bool bitmap_cmp(const M
 #define bitmap_set_all(MAP) \
   (memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP))))
 
-/**
-   check, set and clear a bit of interest of an integer.
-
-   If the bit is out of range @retval -1. Otherwise
-   bit_is_set   @return 0 or 1 reflecting the bit is set or not;
-   bit_do_set   @return 1 (bit is set 1)
-   bit_do_clear @return 0 (bit is cleared to 0)
-*/
-
-#define bit_is_set(I,B)   (sizeof(I) * CHAR_BIT > (B) ?                 \
-                           (((I) & (ULL(1) << (B))) == 0 ? 0 : 1) : -1)
-#define bit_do_set(I,B)   (sizeof(I) * CHAR_BIT > (B) ?         \
-                           ((I) |= (ULL(1) << (B)), 1) : -1)
-#define bit_do_clear(I,B) (sizeof(I) * CHAR_BIT > (B) ?         \
-                           ((I) &= ~(ULL(1) << (B)), 0) : -1)
-
 #ifdef	__cplusplus
 }
 #endif

=== added file 'mysql-test/include/check_qep.inc'
--- a/mysql-test/include/check_qep.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/check_qep.inc	2011-02-23 10:42:16 +0000
@@ -0,0 +1,50 @@
+# include/check_qep.inc
+#
+# SUMMARY
+#
+#    Designed to be used together with include/check_qep.inc
+#
+#    $query should be assigned a select statement using 
+#    straight_join to force the tables to be joined in most 
+#    optimal order.
+#
+#    expect_qep.inc will then store the estimated 'Last_query_cost'
+#    and total # 'Handler_read%' for this straight_joined query.
+#
+#    We should then assign a non-straight_join'ed version of
+#    the same query to $query and execute it using 
+#    'include/check_qep.inc'. Its estimated cost and
+#    #handler_reads will then be verified against the
+#    previous straight_joined query.
+#
+# USAGE
+#
+#    let $query= <select straight_join optimal statement>;
+#    --source include/expect_qep.inc
+#    let $query= <select statement>;
+#    --source include/check_qep.inc
+#
+# EXAMPLE
+#    t/greedy_optimizer.test
+#
+
+flush status;
+eval EXPLAIN $query;
+eval $query;
+
+let $cost=
+ query_get_value(SHOW STATUS LIKE 'Last_query_cost', Value, 1);
+
+let $reads=
+`select sum(variable_value)
+   from information_schema.session_status
+   where VARIABLE_NAME like 'Handler_read%'`;
+
+#echo Cost: $cost, Handler_reads: $reads;
+
+if (`SELECT $cost != $best_cost`)
+{ echo ### FAILED: Query_cost: $cost, expected: $best_cost ###;
+}
+if (`SELECT $reads != $best_reads`)
+{ echo ### FAILED: Handler_reads: $reads, expected: $best_reads ###;
+}

=== added file 'mysql-test/include/execute_with_statistics.inc'
--- a/mysql-test/include/execute_with_statistics.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/execute_with_statistics.inc	2011-02-22 17:44:38 +0000
@@ -0,0 +1,28 @@
+# include/execute_with_statistics.inc
+#
+# SUMMARY
+#
+#    Explain and execute the select statment in $query.
+#    Then report 'Last_query_cost' estimate from the query
+#    optimizer and total number of 'Handler_read%' when the
+#    query was executed.
+#    Intended usage is to verify that there are not regressions
+#    in either calculated or actuall cost for $query.
+#
+# USAGE
+#
+#    let $query= <select statement>;
+#    --source include/execute_with_statistics.inc
+#
+# EXAMPLE
+#    t/greedy_optimizer.test
+#
+
+eval EXPLAIN $query;
+SHOW STATUS LIKE 'Last_query_cost';
+
+FLUSH STATUS;
+eval $query;
+SELECT SUM(variable_value) AS Total_handler_reads
+   FROM information_schema.session_status
+   WHERE variable_name LIKE 'Handler_read%';

=== added file 'mysql-test/include/expect_qep.inc'
--- a/mysql-test/include/expect_qep.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/expect_qep.inc	2011-02-23 10:42:16 +0000
@@ -0,0 +1,44 @@
+# include/expect_qep.inc
+#
+# SUMMARY
+#
+#    Designed to be used together with include/check_qep.inc
+#
+#    $query should be assigned a select statement using 
+#    straight_join to force the tables to be joined in most 
+#    optimal order.
+#
+#    expect_qep.inc will then store the estimated 'Last_query_cost'
+#    and total # 'Handler_read%' for this straight_joined query.
+#
+#    We should then assign a non-straight_join'ed version of
+#    the same query to $query and execute it using 
+#    'include/check_qep.inc'. Its estimated cost and
+#    #handler_reads will then be verified against the
+#    previous straight_joined query.
+#
+# USAGE
+#
+#    let $query= <select straight_join optimal statement>;
+#    --source include/expect_qep.inc
+#    let $query= <select statement>;
+#    --source include/check_qep.inc
+#
+# EXAMPLE
+#    t/greedy_optimizer.test
+#
+
+flush status;
+eval EXPLAIN $query;
+eval $query;
+
+let $best_cost=
+  query_get_value(SHOW STATUS LIKE 'Last_query_cost', Value, 1);
+
+let $best_reads=
+`select sum(variable_value)
+   from information_schema.session_status
+   where VARIABLE_NAME like 'Handler_read%'`;
+
+#echo Expect, cost: $best_cost, Handler_reads: $best_reads;
+

=== modified file 'mysql-test/r/greedy_optimizer.result'
--- a/mysql-test/r/greedy_optimizer.result	2009-01-16 10:45:17 +0000
+++ b/mysql-test/r/greedy_optimizer.result	2011-02-23 10:42:16 +0000
@@ -118,7 +118,7 @@ set optimizer_search_depth=63;
 select @@optimizer_search_depth;
 @@optimizer_search_depth
 63
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -127,10 +127,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
 Last_query_cost	821.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -139,10 +150,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
 Last_query_cost	821.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -151,10 +173,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using index
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
 Last_query_cost	794.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -163,10 +196,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using index
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
 Last_query_cost	794.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -175,10 +219,18 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
 Last_query_cost	794.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+25
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -187,9 +239,17 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
 Last_query_cost	794.837037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+25
 set optimizer_prune_level=0;
 select @@optimizer_prune_level;
 @@optimizer_prune_level
@@ -198,83 +258,143 @@ set optimizer_search_depth=0;
 select @@optimizer_search_depth;
 @@optimizer_search_depth
 0
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
-1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t2.c22	1	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+Last_query_cost	1371.437037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
-1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t2.c22	1	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	1371.437037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using join buffer
 1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.c21	1	Using where
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using index
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	289.418727
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	362.618727
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+114
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using join buffer
 1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.c21	1	Using where
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using index
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	289.418727
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	362.618727
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+114
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.c21	1	Using where
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using where
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
-show status like 'Last_query_cost';
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	289.418727
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	362.618727
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+20
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.c21	1	Using where
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using where
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
-show status like 'Last_query_cost';
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	289.418727
+Last_query_cost	362.618727
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+20
 set optimizer_search_depth=1;
 select @@optimizer_search_depth;
 @@optimizer_search_depth
 1
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -283,10 +403,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+Last_query_cost	1693.637037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -295,10 +426,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	1693.637037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
@@ -307,10 +449,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
@@ -319,10 +472,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	
@@ -331,10 +495,18 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+6
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	
@@ -343,85 +515,153 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+6
 set optimizer_search_depth=62;
 select @@optimizer_search_depth;
 @@optimizer_search_depth
 62
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
-1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t2.c22	1	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+Last_query_cost	1371.437037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
-1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t2.c22	1	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	1371.437037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using join buffer
 1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.c21	1	Using where
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using index
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	289.418727
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	362.618727
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+114
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using join buffer
 1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.c21	1	Using where
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using index
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	289.418727
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	362.618727
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+114
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.c21	1	Using where
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using where
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
-show status like 'Last_query_cost';
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	289.418727
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	362.618727
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+20
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.c21	1	Using where
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using where
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
-show status like 'Last_query_cost';
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	289.418727
+Last_query_cost	362.618727
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+20
 set optimizer_prune_level=1;
 select @@optimizer_prune_level;
 @@optimizer_prune_level
@@ -430,7 +670,7 @@ set optimizer_search_depth=0;
 select @@optimizer_search_depth;
 @@optimizer_search_depth
 0
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -439,10 +679,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+Last_query_cost	1693.637037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -451,62 +702,111 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	1693.637037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
-1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
-1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using index
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
+1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
-1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
-1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using index
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
+1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
+1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	
+1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
+1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
-1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using where
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
-1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+6
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
+1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	
+1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
+1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
-1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using where
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
-1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+6
 set optimizer_search_depth=1;
 select @@optimizer_search_depth;
 @@optimizer_search_depth
 1
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -515,10 +815,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+Last_query_cost	1693.637037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -527,10 +838,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	1693.637037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
@@ -539,10 +861,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
@@ -551,10 +884,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	
@@ -563,10 +907,18 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+6
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	
@@ -575,14 +927,22 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+6
 set optimizer_search_depth=62;
 select @@optimizer_search_depth;
 @@optimizer_search_depth
 62
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -591,10 +951,21 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+Last_query_cost	1693.637037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
@@ -603,57 +974,106 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t4.c42	1	
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t6.c62	1	Using index
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	821.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	1693.637037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
-1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
-1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using index
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
+1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
-1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
 1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
-1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
 1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using index
-1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
 1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using index
-show status like 'Last_query_cost';
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
+1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
+1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+c11
+1
+2
+3
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+46
+EXPLAIN select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
+1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	
+1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
+1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
-1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using where
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
-1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+6
+EXPLAIN select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	PRIMARY	NULL	NULL	NULL	3	
+1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	
+1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
+1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
 1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	6	Using where; Using join buffer
-1	SIMPLE	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using where
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using where; Using join buffer
-1	SIMPLE	t5	eq_ref	PRIMARY	PRIMARY	4	test.t1.c14	1	Using where
 1	SIMPLE	t6	ALL	NULL	NULL	NULL	NULL	18	Using where; Using join buffer
-1	SIMPLE	t7	eq_ref	PRIMARY	PRIMARY	4	test.t1.c16	1	Using where
-show status like 'Last_query_cost';
+SHOW STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	794.837037
+Last_query_cost	844.037037
+FLUSH STATUS;
+select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+c11
+SELECT SUM(variable_value) AS Total_handler_reads
+FROM information_schema.session_status
+WHERE variable_name LIKE 'Handler_read%';
+Total_handler_reads
+6
 drop table t1,t2,t3,t4,t5,t6,t7;
 CREATE TABLE t1 (a int, b int, d int, i int);
 INSERT INTO t1 VALUES (1,1,1,1);
@@ -732,3 +1152,1746 @@ t4 LEFT JOIN (t5 JOIN t5_1 ON t5.l = t5_
 SET optimizer_search_depth = DEFAULT;
 DROP TABLE t1,t2,t2_1,t3,t3_1,t4,t4_1,t5,t5_1;
 End of 5.0 tests
+#
+# Bug #59326: Greedy optimizer produce stupid query execution plans.
+#
+CREATE TABLE t10(
+K INT NOT NULL AUTO_INCREMENT,
+I INT,
+PRIMARY KEY(K)
+);
+INSERT INTO t10(I) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(0);
+CREATE TABLE t100 LIKE t10;
+INSERT INTO t100(I)
+SELECT X.I FROM t10 AS X,t10 AS Y;
+CREATE TABLE t10000 LIKE t10;
+INSERT INTO t10000(I)
+SELECT X.I FROM t100 AS X, t100 AS Y;
+EXPLAIN SELECT * FROM t10,t100,t10000;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using join buffer
+1	SIMPLE	t10000	ALL	NULL	NULL	NULL	NULL	10000	Using join buffer
+EXPLAIN SELECT * FROM t10,t10000,t100;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using join buffer
+1	SIMPLE	t10000	ALL	NULL	NULL	NULL	NULL	10000	Using join buffer
+EXPLAIN SELECT * FROM t100,t10,t10000;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using join buffer
+1	SIMPLE	t10000	ALL	NULL	NULL	NULL	NULL	10000	Using join buffer
+EXPLAIN SELECT * FROM t100,t10000,t10;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using join buffer
+1	SIMPLE	t10000	ALL	NULL	NULL	NULL	NULL	10000	Using join buffer
+EXPLAIN SELECT * FROM t10000,t10,t100;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using join buffer
+1	SIMPLE	t10000	ALL	NULL	NULL	NULL	NULL	10000	Using join buffer
+EXPLAIN SELECT * FROM t10000,t100,t10;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using join buffer
+1	SIMPLE	t10000	ALL	NULL	NULL	NULL	NULL	10000	Using join buffer
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t100.K	1	Using where; Using index
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.K=t10.I;
+COUNT(*)
+9
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+AND t10000.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+AND t10000.K=t10.I;
+COUNT(*)
+9
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t100.K	1	Using where; Using index
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.K=t10.I;
+COUNT(*)
+9
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+AND t10000.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t100.K	1	Using where; Using index
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+AND t10000.K=t10.I;
+COUNT(*)
+9
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	PRIMARY	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.K	1	Using index
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+COUNT(*)
+9
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	PRIMARY	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.K	1	Using index
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+COUNT(*)
+9
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t100,t10,t10000
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	PRIMARY	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.K	1	Using index
+SELECT COUNT(*) FROM t100,t10,t10000
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+COUNT(*)
+9
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t100,t10000,t10
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	PRIMARY	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.K	1	Using index
+SELECT COUNT(*) FROM t100,t10000,t10
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+COUNT(*)
+9
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10000,t10,t100
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	PRIMARY	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.K	1	Using index
+SELECT COUNT(*) FROM t10000,t10,t100
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+COUNT(*)
+9
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10000,t100,t10
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	PRIMARY	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.K	1	Using index
+SELECT COUNT(*) FROM t10000,t100,t10
+WHERE t100.K=t10.I
+AND t10000.K=t10.K;
+COUNT(*)
+9
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	ALL	NULL	NULL	NULL	NULL	10000	Using where; Using join buffer
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	ALL	NULL	NULL	NULL	NULL	10000	Using where; Using join buffer
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	ALL	NULL	NULL	NULL	NULL	10000	Using where; Using join buffer
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+AND t10000.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using where; Using join buffer
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+AND t10000.K=t10.I;
+COUNT(*)
+90
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.I=t10.I
+AND t10000.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using where; Using join buffer
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.I=t10.I
+AND t10000.K=t10.I;
+COUNT(*)
+90
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+AND t10000.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using where; Using join buffer
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+AND t10000.K=t10.I;
+COUNT(*)
+90
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+AND t10000.K=t100.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using where; Using join buffer
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+AND t10000.K=t100.I;
+COUNT(*)
+90
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.I=t10.I
+AND t10000.K=t100.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using where; Using join buffer
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.I=t10.I
+AND t10000.K=t100.I;
+COUNT(*)
+90
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+AND t10000.K=t100.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	t10000	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t100	ALL	NULL	NULL	NULL	NULL	100	Using where; Using join buffer
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+AND t10000.K=t100.I;
+COUNT(*)
+90
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	index	NULL	PRIMARY	4	NULL	10000	Using index; Using join buffer
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+COUNT(*)
+90000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	index	NULL	PRIMARY	4	NULL	10000	Using index; Using join buffer
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+COUNT(*)
+90000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	index	NULL	PRIMARY	4	NULL	10000	Using index; Using join buffer
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I;
+COUNT(*)
+90000
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ALL	NULL	NULL	NULL	NULL	10000	Using where; Using join buffer
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ALL	NULL	NULL	NULL	NULL	10000	Using where; Using join buffer
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ALL	NULL	NULL	NULL	NULL	10000	Using where; Using join buffer
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=X.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ALL	NULL	NULL	NULL	NULL	10000	Using where; Using join buffer
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=X.K;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=X.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ALL	NULL	NULL	NULL	NULL	10000	Using where; Using join buffer
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=X.K;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+AND Y.I=X.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	ALL	NULL	NULL	NULL	NULL	10	
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ALL	NULL	NULL	NULL	NULL	10000	Using where; Using join buffer
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+AND Y.I=X.K;
+COUNT(*)
+9000
+CREATE INDEX IX ON t10(I);
+CREATE INDEX IX ON t100(I);
+CREATE INDEX IX ON t10000(I);
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	ref	IX	IX	5	test.t100.K	1000	Using where; Using index
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	ref	IX	IX	5	test.t100.K	1000	Using where; Using index
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	t100	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	t10000	ref	IX	IX	5	test.t100.K	1000	Using where; Using index
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+AND t10000.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	index	NULL	PRIMARY	4	NULL	10000	Using index; Using join buffer
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+COUNT(*)
+90000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	index	NULL	PRIMARY	4	NULL	10000	Using index; Using join buffer
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+COUNT(*)
+90000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	index	NULL	PRIMARY	4	NULL	10000	Using index; Using join buffer
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I;
+COUNT(*)
+90000
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ref	IX	IX	5	test.X.K	1000	Using where; Using index
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ref	IX	IX	5	test.X.K	1000	Using where; Using index
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ref	IX	IX	5	test.X.K	1000	Using where; Using index
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+AND Y.I=t10.I;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=X.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ref	IX	IX	5	test.X.K	1000	Using where; Using index
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=X.K;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=X.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ref	IX	IX	5	test.X.K	1000	Using where; Using index
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+AND Y.I=X.K;
+COUNT(*)
+9000
+flush status;
+EXPLAIN SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+AND Y.I=X.K;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t10	index	IX	IX	5	NULL	10	Using index
+1	SIMPLE	X	eq_ref	PRIMARY	PRIMARY	4	test.t10.I	1	Using index
+1	SIMPLE	Y	ref	IX	IX	5	test.X.K	1000	Using where; Using index
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+AND Y.I=X.K;
+COUNT(*)
+9000
+#
+# Test improved capabilities of analyzing complex query
+# plans without restricting 'optimizer_search_depth'.
+# Fix problems like those reported as bug#41740 & bug#58225. 
+#
+# EPLAIN of queries using T1-T62 will timeout/hang wo/ fixes
+#
+DROP TABLE t10, t10000;
+CREATE TABLE T1 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T1(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 1;
+CREATE TABLE T2 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T2(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 2;
+CREATE TABLE T3 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T3(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 3;
+CREATE TABLE T4 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T4(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 4;
+CREATE TABLE T5 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T5(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 5;
+CREATE TABLE T6 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T6(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 6;
+CREATE TABLE T7 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T7(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 7;
+CREATE TABLE T8 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T8(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 8;
+CREATE TABLE T9 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T9(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 9;
+CREATE TABLE T10 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T10(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 10;
+CREATE TABLE T11 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T11(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 11;
+CREATE TABLE T12 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T12(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 12;
+CREATE TABLE T13 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T13(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 13;
+CREATE TABLE T14 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T14(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 14;
+CREATE TABLE T15 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T15(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 15;
+CREATE TABLE T16 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T16(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 16;
+CREATE TABLE T17 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T17(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 17;
+CREATE TABLE T18 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T18(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 18;
+CREATE TABLE T19 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T19(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 19;
+CREATE TABLE T20 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T20(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 20;
+CREATE TABLE T21 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T21(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 21;
+CREATE TABLE T22 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T22(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 22;
+CREATE TABLE T23 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T23(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 23;
+CREATE TABLE T24 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T24(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 24;
+CREATE TABLE T25 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T25(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 25;
+CREATE TABLE T26 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T26(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 26;
+CREATE TABLE T27 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T27(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 27;
+CREATE TABLE T28 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T28(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 28;
+CREATE TABLE T29 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T29(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 29;
+CREATE TABLE T30 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T30(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 30;
+CREATE TABLE T31 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T31(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 31;
+CREATE TABLE T32 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T32(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 32;
+CREATE TABLE T33 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T33(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 33;
+CREATE TABLE T34 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T34(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 34;
+CREATE TABLE T35 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T35(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 35;
+CREATE TABLE T36 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T36(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 36;
+CREATE TABLE T37 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T37(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 37;
+CREATE TABLE T38 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T38(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 38;
+CREATE TABLE T39 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T39(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 39;
+CREATE TABLE T40 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T40(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 40;
+CREATE TABLE T41 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T41(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 41;
+CREATE TABLE T42 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T42(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 42;
+CREATE TABLE T43 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T43(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 43;
+CREATE TABLE T44 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T44(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 44;
+CREATE TABLE T45 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T45(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 45;
+CREATE TABLE T46 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T46(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 46;
+CREATE TABLE T47 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T47(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 47;
+CREATE TABLE T48 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T48(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 48;
+CREATE TABLE T49 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T49(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 49;
+CREATE TABLE T50 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T50(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 50;
+CREATE TABLE T51 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T51(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 51;
+CREATE TABLE T52 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T52(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 52;
+CREATE TABLE T53 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T53(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 53;
+CREATE TABLE T54 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T54(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 54;
+CREATE TABLE T55 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T55(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 55;
+CREATE TABLE T56 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T56(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 56;
+CREATE TABLE T57 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T57(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 57;
+CREATE TABLE T58 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T58(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 58;
+CREATE TABLE T59 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T59(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 59;
+CREATE TABLE T60 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T60(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 60;
+CREATE TABLE T61 ( K INT NOT NULL AUTO_INCREMENT,
+I INT,
+A INT,
+PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+INSERT INTO T61(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= 61;
+ANALYZE TABLE t100, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50, T51, T52, T53, T54, T55, T56, T57, T58, T59, T60, T61;
+set optimizer_prune_level=1;
+set optimizer_search_depth=0;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I JOIN T59 ON T59.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I JOIN T59 ON T59.I=X.I JOIN T60 ON T60.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I JOIN T41 as T41 ON T41.I=X.I JOIN T41 as T42 ON T42.I=X.I JOIN T41 as T43 ON T43.I=X.I JOIN T41 as T44 ON T44.I=X.I JOIN T41 as T45 ON T45.I=X.I JOIN T41 as T46 ON T46.I=X.I JOIN T41 as T47 ON T47.I=X.I JOIN T41 as T48 ON T48.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I JOIN T41 as T41 ON T41.I=X.I JOIN T41 as T42 ON T42.I=X.I JOIN T41 as T43 ON T43.I=X.I JOIN T41 as T44 ON T44.I=X.I JOIN T41 as T45 ON T45.I=X.I JOIN T41 as T46 ON T46.I=X.I JOIN T41 as T47 ON T47.I=X.I JOIN T41 as T48 ON T48.I=X.I JOIN T49 as T49 ON T49.I=X.I JOIN T49 as T50 ON T50.I=X.I JOIN T49 as T51 ON T51.I=X.I JOIN T49 as T52 ON T52.I=X.I JOIN T49 as T53 ON T53.I=X.I JOIN T49 as T54 ON T54.I=X.I JOIN T49 as T55 ON T55.I=X.I JOIN T49 as T56 ON T56.I=X.I;
+set optimizer_search_depth=1;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I JOIN T59 ON T59.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I JOIN T59 ON T59.I=X.I JOIN T60 ON T60.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I JOIN T41 as T41 ON T41.I=X.I JOIN T41 as T42 ON T42.I=X.I JOIN T41 as T43 ON T43.I=X.I JOIN T41 as T44 ON T44.I=X.I JOIN T41 as T45 ON T45.I=X.I JOIN T41 as T46 ON T46.I=X.I JOIN T41 as T47 ON T47.I=X.I JOIN T41 as T48 ON T48.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I JOIN T41 as T41 ON T41.I=X.I JOIN T41 as T42 ON T42.I=X.I JOIN T41 as T43 ON T43.I=X.I JOIN T41 as T44 ON T44.I=X.I JOIN T41 as T45 ON T45.I=X.I JOIN T41 as T46 ON T46.I=X.I JOIN T41 as T47 ON T47.I=X.I JOIN T41 as T48 ON T48.I=X.I JOIN T49 as T49 ON T49.I=X.I JOIN T49 as T50 ON T50.I=X.I JOIN T49 as T51 ON T51.I=X.I JOIN T49 as T52 ON T52.I=X.I JOIN T49 as T53 ON T53.I=X.I JOIN T49 as T54 ON T54.I=X.I JOIN T49 as T55 ON T55.I=X.I JOIN T49 as T56 ON T56.I=X.I;
+set optimizer_search_depth=3;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I JOIN T59 ON T59.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I JOIN T59 ON T59.I=X.I JOIN T60 ON T60.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I JOIN T41 as T41 ON T41.I=X.I JOIN T41 as T42 ON T42.I=X.I JOIN T41 as T43 ON T43.I=X.I JOIN T41 as T44 ON T44.I=X.I JOIN T41 as T45 ON T45.I=X.I JOIN T41 as T46 ON T46.I=X.I JOIN T41 as T47 ON T47.I=X.I JOIN T41 as T48 ON T48.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I JOIN T41 as T41 ON T41.I=X.I JOIN T41 as T42 ON T42.I=X.I JOIN T41 as T43 ON T43.I=X.I JOIN T41 as T44 ON T44.I=X.I JOIN T41 as T45 ON T45.I=X.I JOIN T41 as T46 ON T46.I=X.I JOIN T41 as T47 ON T47.I=X.I JOIN T41 as T48 ON T48.I=X.I JOIN T49 as T49 ON T49.I=X.I JOIN T49 as T50 ON T50.I=X.I JOIN T49 as T51 ON T51.I=X.I JOIN T49 as T52 ON T52.I=X.I JOIN T49 as T53 ON T53.I=X.I JOIN T49 as T54 ON T54.I=X.I JOIN T49 as T55 ON T55.I=X.I JOIN T49 as T56 ON T56.I=X.I;
+set optimizer_search_depth=62;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I JOIN T59 ON T59.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 ON T1.I=X.I JOIN T2 ON T2.I=X.I JOIN T3 ON T3.I=X.I JOIN T4 ON T4.I=X.I JOIN T5 ON T5.I=X.I JOIN T6 ON T6.I=X.I JOIN T7 ON T7.I=X.I JOIN T8 ON T8.I=X.I JOIN T9 ON T9.I=X.I JOIN T10 ON T10.I=X.I JOIN T11 ON T11.I=X.I JOIN T12 ON T12.I=X.I JOIN T13 ON T13.I=X.I JOIN T14 ON T14.I=X.I JOIN T15 ON T15.I=X.I JOIN T16 ON T16.I=X.I JOIN T17 ON T17.I=X.I JOIN T18 ON T18.I=X.I JOIN T19 ON T19.I=X.I JOIN T20 ON T20.I=X.I JOIN T21 ON T21.I=X.I JOIN T22 ON T22.I=X.I JOIN T23 ON T23.I=X.I JOIN T24 ON T24.I=X.I JOIN T25 ON T25.I=X.I JOIN T26 ON T26.I=X.I JOIN T27 ON T27.I=X.I JOIN T28 ON T28.I=X.I JOIN T29 ON T29.I=X.I JOIN T30 ON T30.I=X.I JOIN T31 ON T31.I=X.I JOIN T32 ON T32.I=X.I JOIN T33 ON T33.I=X.I JOIN T34 ON T34.I=X.I JOIN T35 ON T35.I=X.I JOIN T36 ON T36.I=X.I JOIN T37 ON T37.I=X.I JOIN T38 ON T38.I=X.I JOIN T39 ON T39.I=X.I JOIN T40 ON T40.I=X.I JOIN T41 ON T41.I=X.I JOIN T42 ON T42.I=X.I JOIN T43 ON T43.I=X.I JOIN T44 ON T44.I=X.I JO
 IN T45 ON T45.I=X.I JOIN T46 ON T46.I=X.I JOIN T47 ON T47.I=X.I JOIN T48 ON T48.I=X.I JOIN T49 ON T49.I=X.I JOIN T50 ON T50.I=X.I JOIN T51 ON T51.I=X.I JOIN T52 ON T52.I=X.I JOIN T53 ON T53.I=X.I JOIN T54 ON T54.I=X.I JOIN T55 ON T55.I=X.I JOIN T56 ON T56.I=X.I JOIN T57 ON T57.I=X.I JOIN T58 ON T58.I=X.I JOIN T59 ON T59.I=X.I JOIN T60 ON T60.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I JOIN T41 as T41 ON T41.I=X.I JOIN T41 as T42 ON T42.I=X.I JOIN T41 as T43 ON T43.I=X.I JOIN T41 as T44 ON T44.I=X.I JOIN T41 as T45 ON T45.I=X.I JOIN T41 as T46 ON T46.I=X.I JOIN T41 as T47 ON T47.I=X.I JOIN T41 as T48 ON T48.I=X.I;
+select @@optimizer_prune_level;
+select @@optimizer_search_depth;
+EXPLAIN SELECT COUNT(*) FROM T1 AS X JOIN T1 as T1 ON T1.I=X.I JOIN T1 as T2 ON T2.I=X.I JOIN T1 as T3 ON T3.I=X.I JOIN T1 as T4 ON T4.I=X.I JOIN T1 as T5 ON T5.I=X.I JOIN T1 as T6 ON T6.I=X.I JOIN T1 as T7 ON T7.I=X.I JOIN T1 as T8 ON T8.I=X.I JOIN T9 as T9 ON T9.I=X.I JOIN T9 as T10 ON T10.I=X.I JOIN T9 as T11 ON T11.I=X.I JOIN T9 as T12 ON T12.I=X.I JOIN T9 as T13 ON T13.I=X.I JOIN T9 as T14 ON T14.I=X.I JOIN T9 as T15 ON T15.I=X.I JOIN T9 as T16 ON T16.I=X.I JOIN T17 as T17 ON T17.I=X.I JOIN T17 as T18 ON T18.I=X.I JOIN T17 as T19 ON T19.I=X.I JOIN T17 as T20 ON T20.I=X.I JOIN T17 as T21 ON T21.I=X.I JOIN T17 as T22 ON T22.I=X.I JOIN T17 as T23 ON T23.I=X.I JOIN T17 as T24 ON T24.I=X.I JOIN T25 as T25 ON T25.I=X.I JOIN T25 as T26 ON T26.I=X.I JOIN T25 as T27 ON T27.I=X.I JOIN T25 as T28 ON T28.I=X.I JOIN T25 as T29 ON T29.I=X.I JOIN T25 as T30 ON T30.I=X.I JOIN T25 as T31 ON T31.I=X.I JOIN T25 as T32 ON T32.I=X.I JOIN T33 as T33 ON T33.I=X.I JOIN T33 as T34 ON T34.I=X.I 
 JOIN T33 as T35 ON T35.I=X.I JOIN T33 as T36 ON T36.I=X.I JOIN T33 as T37 ON T37.I=X.I JOIN T33 as T38 ON T38.I=X.I JOIN T33 as T39 ON T39.I=X.I JOIN T33 as T40 ON T40.I=X.I JOIN T41 as T41 ON T41.I=X.I JOIN T41 as T42 ON T42.I=X.I JOIN T41 as T43 ON T43.I=X.I JOIN T41 as T44 ON T44.I=X.I JOIN T41 as T45 ON T45.I=X.I JOIN T41 as T46 ON T46.I=X.I JOIN T41 as T47 ON T47.I=X.I JOIN T41 as T48 ON T48.I=X.I JOIN T49 as T49 ON T49.I=X.I JOIN T49 as T50 ON T50.I=X.I JOIN T49 as T51 ON T51.I=X.I JOIN T49 as T52 ON T52.I=X.I JOIN T49 as T53 ON T53.I=X.I JOIN T49 as T54 ON T54.I=X.I JOIN T49 as T55 ON T55.I=X.I JOIN T49 as T56 ON T56.I=X.I;
+DROP TABLE t100, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50, T51, T52, T53, T54, T55, T56, T57, T58, T59, T60, T61;
+SET OPTIMIZER_SEARCH_DEPTH = DEFAULT;
+END OF 5.6 TESTS

=== modified file 'mysql-test/r/join.result'
--- a/mysql-test/r/join.result	2010-10-06 10:06:47 +0000
+++ b/mysql-test/r/join.result	2011-02-23 10:42:16 +0000
@@ -894,7 +894,7 @@ id	select_type	table	type	possible_keys	
 1	SIMPLE	B	eq_ref	PRIMARY	PRIMARY	4	test.A.b	1	
 show status like '%cost%';
 Variable_name	Value
-Last_query_cost	24.016090
+Last_query_cost	28.016090
 select '^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error' Z;
 Z
 ^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error

=== modified file 'mysql-test/r/status.result'
--- a/mysql-test/r/status.result	2009-08-25 19:44:04 +0000
+++ b/mysql-test/r/status.result	2011-02-23 10:42:16 +0000
@@ -149,7 +149,7 @@ a	a
 1	1
 SHOW SESSION STATUS LIKE 'Last_query_cost';
 Variable_name	Value
-Last_query_cost	4.805836
+Last_query_cost	5.205836
 DROP TABLE t1;
 show status like 'com_show_status';
 Variable_name	Value

=== modified file 'mysql-test/r/subselect.result'
--- a/mysql-test/r/subselect.result	2011-02-02 15:16:35 +0000
+++ b/mysql-test/r/subselect.result	2011-02-23 13:09:10 +0000
@@ -1353,10 +1353,10 @@ a
 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	PRIMARY	t2	index	NULL	a	5	NULL	4	100.00	Using where; Using index
-2	DEPENDENT SUBQUERY	t1	ref	a	a	5	func	1001	100.00	Using where; Using index
-2	DEPENDENT SUBQUERY	t3	index	a	a	5	NULL	3	100.00	Using where; Using index; Using join buffer
+2	DEPENDENT SUBQUERY	t3	index	a	a	5	NULL	3	100.00	Using index
+2	DEPENDENT SUBQUERY	t1	ref	a	a	10	func,test.t3.a	1167	100.01	Using where; Using index
 Warnings:
-Note	1003	select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
+Note	1003	select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 from `test`.`t1` join `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
 insert into t1 values (3,31);
 select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
 a

=== modified file 'mysql-test/suite/ndb/r/ndb_join_pushdown.result'
--- a/mysql-test/suite/ndb/r/ndb_join_pushdown.result	2011-02-14 10:50:42 +0000
+++ b/mysql-test/suite/ndb/r/ndb_join_pushdown.result	2011-02-23 13:09:10 +0000
@@ -51,13 +51,11 @@ from t1 as x1 
 join t1 as x2 on x1.d > x2.a + 1000 
 join t1 as x3 on x1.c=x3.a and x1.d=x3.b;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
-1	SIMPLE	x1	ALL	NULL	NULL	NULL	NULL	16	100.00	
+1	SIMPLE	x1	ALL	NULL	NULL	NULL	NULL	16	100.00	Parent of 2 pushed join@1
+1	SIMPLE	x3	eq_ref	PRIMARY	PRIMARY	8	test.x1.c,test.x1.d	1	100.00	Child of pushed join@1
 1	SIMPLE	x2	ALL	NULL	NULL	NULL	NULL	16	100.00	Using where; Using join buffer
-1	SIMPLE	x3	eq_ref	PRIMARY	PRIMARY	8	test.x1.c,test.x1.d	1	100.00	
 Warnings:
 Note	1644	Can't push table 'x2' as child, 'type' must be a 'ref' access
-Note	1644	Cannot push table 'x3' as child of table 'x1'. Doing so would prevent using join buffer for table 'x2'.
-Note	1644	Cannot push table 'x3' as child of 'x2', since it referes to column 'x1.c' which will be stored in a join buffer.
 Note	1003	select count(0) AS `count(*)` from `test`.`t1` `x1` join `test`.`t1` `x2` join `test`.`t1` `x3` where ((`test`.`x3`.`b` = `test`.`x1`.`d`) and (`test`.`x3`.`a` = `test`.`x1`.`c`) and (`test`.`x1`.`d` > (`test`.`x2`.`a` + 1000)))
 select count(*) 
 from t1 as x1 
@@ -4202,10 +4200,10 @@ explain extended select count(*) from 
 left outer join t1 as z on z.u = x.a;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	SIMPLE	x	ALL	NULL	NULL	NULL	NULL	13	100.00	Parent of 3 pushed join@1
+1	SIMPLE	z	eq_ref	ix2	ix2	4	test.x.a	1	100.00	Child of pushed join@1
 1	SIMPLE	y	ref	ix1	ix1	5	test.x.a	2	100.00	Child of pushed join@1; Using where
-1	SIMPLE	z	eq_ref	ix2	ix2	4	test.y.b	1	100.00	Child of pushed join@1
 Warnings:
-Note	1003	select count(0) AS `count(*)` from `test`.`t1` `x` join `test`.`t1` `y` left join `test`.`t1` `z` on(((`test`.`y`.`b` = `test`.`x`.`a`) and (`test`.`z`.`u` = `test`.`x`.`a`))) where (`test`.`y`.`b` = `test`.`x`.`a`)
+Note	1003	select count(0) AS `count(*)` from `test`.`t1` `x` join `test`.`t1` `y` left join `test`.`t1` `z` on(((`test`.`z`.`u` = `test`.`x`.`a`) and (`test`.`y`.`b` = `test`.`x`.`a`))) where (`test`.`y`.`b` = `test`.`x`.`a`)
 select count(*) from 
 (t1 as x join t1 as y on y.b = x.a)
 left outer join t1 as z on z.u = x.a;
@@ -4852,32 +4850,32 @@ and spj_counts_at_end.counter_name <> 'L
        and spj_counts_at_end.counter_name <> 'SCAN_BATCHES_RETURNED';
 counter_name	spj_counts_at_end.val - spj_counts_at_startup.val
 CONST_PRUNED_RANGE_SCANS_RECEIVED	6
-LOCAL_TABLE_SCANS_SENT	226
+LOCAL_TABLE_SCANS_SENT	230
 PRUNED_RANGE_SCANS_RECEIVED	17
 RANGE_SCANS_RECEIVED	718
-READS_NOT_FOUND	404
-READS_RECEIVED	61
-SCAN_ROWS_RETURNED	78712
-TABLE_SCANS_RECEIVED	226
+READS_NOT_FOUND	409
+READS_RECEIVED	49
+SCAN_ROWS_RETURNED	78755
+TABLE_SCANS_RECEIVED	230
 select sum(spj_counts_at_end.val - spj_counts_at_startup.val) as 'LOCAL+REMOTE READS_SENT'
        from spj_counts_at_end, spj_counts_at_startup 
 where spj_counts_at_end.counter_name = spj_counts_at_startup.counter_name
 and (spj_counts_at_end.counter_name = 'LOCAL_READS_SENT'
        or spj_counts_at_end.counter_name = 'REMOTE_READS_SENT');
 LOCAL+REMOTE READS_SENT
-28877
+28879
 drop table spj_counts_at_startup;
 drop table spj_counts_at_end;
 scan_count
-2681
+2677
 pruned_scan_count
 8
 sorted_scan_count
 9
 pushed_queries_defined
-354
+356
 pushed_queries_dropped
 11
 pushed_queries_executed
-537
+527
 set ndb_join_pushdown = @save_ndb_join_pushdown;

=== renamed file 'mysql-test/suite/ndb/r/ndb_restore_compat.result' => 'mysql-test/suite/ndb/r/ndb_restore_compat_downward.result'
=== renamed file 'mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result' => 'mysql-test/suite/ndb/r/ndb_restore_compat_endianness.result'
=== renamed file 'mysql-test/suite/ndb/r/ndb_restore_lossy_charbinary_conv.result' => 'mysql-test/suite/ndb/r/ndb_restore_conv_lossy_charbinary.result'
=== renamed file 'mysql-test/suite/ndb/r/ndb_restore_lossy_integral_conv.result' => 'mysql-test/suite/ndb/r/ndb_restore_conv_lossy_integral.result'
=== renamed file 'mysql-test/suite/ndb/r/ndb_restore_padding_preservation.result' => 'mysql-test/suite/ndb/r/ndb_restore_conv_padding.result'
=== renamed file 'mysql-test/suite/ndb/r/ndb_restore_promotion.result' => 'mysql-test/suite/ndb/r/ndb_restore_conv_promotion.result'
=== renamed file 'mysql-test/suite/ndb/r/ndb_restore.result' => 'mysql-test/suite/ndb/r/ndb_restore_misc.result'
=== renamed file 'mysql-test/suite/ndb/r/ndb_blob_restore.result' => 'mysql-test/suite/ndb/r/ndb_restore_schema_blobs.result'
=== renamed file 'mysql-test/suite/ndb/r/ndb_restore_partition.result' => 'mysql-test/suite/ndb/r/ndb_restore_schema_partitions.result'
=== renamed file 'mysql-test/suite/ndb/r/ndb_restore_rewrite_db.result' => 'mysql-test/suite/ndb/r/ndb_restore_schema_rewrites.result'
=== renamed file 'mysql-test/suite/ndb/r/ndb_restore_options.result' => 'mysql-test/suite/ndb/r/ndb_restore_schema_subsets.result'
--- a/mysql-test/suite/ndb/r/ndb_restore_options.result	2010-06-11 20:30:56 +0000
+++ b/mysql-test/suite/ndb/r/ndb_restore_schema_subsets.result	2011-02-22 03:29:24 +0000
@@ -510,181 +510,3 @@ tab2
 drop table db2.tab1, db2.tab2;
 drop database db1;
 drop database db2;
-Test ndb_restore ability to ignore some schema differences
-use test;
-create table t1 (
-a int,
-b int,
-c int,
-d int,
-e varchar(200),
-f int,
-g char(20),
-h text,
-i int,
-primary key(a,b)) TABLESPACE ts1 engine = ndb;
-insert into t1 values
-(1, 1, 1, 1, '1', 1, 'Rankin', 'Rebus', 1),
-(2, 2, 2, 2, '2', 2, 'Doyle', 'Holmes', 2),
-(3, 3, 3, 3, '3', 3, 'Burns', 'Mouse', 3),
-(4, 4, 4, 4, '4', 4, 'Gibbon', 'Chris', 4),
-(5, 5, 5, 5, '5', 5, 'Gray', 'Lanark', 5);
-select * from t1 order by a;
-a	b	c	d	e	f	g	h	i
-1	1	1	1	1	1	Rankin	Rebus	1
-2	2	2	2	2	2	Doyle	Holmes	2
-3	3	3	3	3	3	Burns	Mouse	3
-4	4	4	4	4	4	Gibbon	Chris	4
-5	5	5	5	5	5	Gray	Lanark	5
-Backing up data
-drop table t1;
-Normal restore
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL DEFAULT '0',
-  `b` int(11) NOT NULL DEFAULT '0',
-  `c` int(11) DEFAULT NULL,
-  `d` int(11) DEFAULT NULL,
-  `e` varchar(200) DEFAULT NULL,
-  `f` int(11) DEFAULT NULL,
-  `g` char(20) DEFAULT NULL,
-  `h` text,
-  `i` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`,`b`)
-) /*!50100 TABLESPACE ts1 */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-select * from t1 order by a;
-a	b	c	d	e	f	g	h	i
-1	1	1	1	1	1	Rankin	Rebus	1
-2	2	2	2	2	2	Doyle	Holmes	2
-3	3	3	3	3	3	Burns	Mouse	3
-4	4	4	4	4	4	Gibbon	Chris	4
-5	5	5	5	5	5	Gray	Lanark	5
-truncate t1;
-Column name change, should fail without --exclude-missing-columns
-alter table t1 change c cc int;
-Retry with --exclude-missing-columns
-select * from t1 order by a;
-a	b	cc	d	e	f	g	h	i
-1	1	NULL	1	1	1	Rankin	Rebus	1
-2	2	NULL	2	2	2	Doyle	Holmes	2
-3	3	NULL	3	3	3	Burns	Mouse	3
-4	4	NULL	4	4	4	Gibbon	Chris	4
-5	5	NULL	5	5	5	Gray	Lanark	5
-truncate t1;
-Column type change, should fail
-alter table t1 change cc c bigint;
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL DEFAULT '0',
-  `b` int(11) NOT NULL DEFAULT '0',
-  `c` bigint(20) DEFAULT NULL,
-  `d` int(11) DEFAULT NULL,
-  `e` varchar(200) DEFAULT NULL,
-  `f` int(11) DEFAULT NULL,
-  `g` char(20) DEFAULT NULL,
-  `h` text,
-  `i` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`,`b`)
-) /*!50100 TABLESPACE ts1 */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-Retry with --promote-attribute
-select * from t1 order by a;
-a	b	c	d	e	f	g	h	i
-1	1	1	1	1	1	Rankin	Rebus	1
-2	2	2	2	2	2	Doyle	Holmes	2
-3	3	3	3	3	3	Burns	Mouse	3
-4	4	4	4	4	4	Gibbon	Chris	4
-5	5	5	5	5	5	Gray	Lanark	5
-truncate t1;
-Column nullability change, should fail
-alter table t1 change c c int not null;
-alter table t1 change c c int;
-Column length change, should fail
-alter table t1 change g g char(22);
-Character set difference, should fail
-alter table t1 change g g char(20) character set binary;
-alter table t1 change g g char(20);
-AutoIncrement difference, should fail
-alter table t1 change b b int auto_increment;
-Default difference, should pass 
-alter table t1 change b b int default 22;
-select * from t1 order by a;
-a	b	c	d	e	f	g	h	i
-1	1	1	1	1	1	Rankin	Rebus	1
-2	2	2	2	2	2	Doyle	Holmes	2
-3	3	3	3	3	3	Burns	Mouse	3
-4	4	4	4	4	4	Gibbon	Chris	4
-5	5	5	5	5	5	Gray	Lanark	5
-truncate t1;
-alter table t1 change b b int;
-ArrayType difference, should fail
-alter table t1 change e e varchar(300);
-alter table t1 change e e varchar(200);
-StorageType difference, should pass
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-alter table t1 change i i int storage disk;
-select * from t1 order by a;
-a	b	c	d	e	f	g	h	i
-1	1	1	1	1	1	Rankin	Rebus	1
-2	2	2	2	2	2	Doyle	Holmes	2
-3	3	3	3	3	3	Burns	Mouse	3
-4	4	4	4	4	4	Gibbon	Chris	4
-5	5	5	5	5	5	Gray	Lanark	5
-alter table t1 change i i int storage memory;
-truncate t1;
-Dynamic property difference, should pass
-alter table t1 change c c int column_format dynamic;
-select * from t1 order by a;
-a	b	c	d	e	f	g	h	i
-1	1	1	1	1	1	Rankin	Rebus	1
-2	2	2	2	2	2	Doyle	Holmes	2
-3	3	3	3	3	3	Burns	Mouse	3
-4	4	4	4	4	4	Gibbon	Chris	4
-5	5	5	5	5	5	Gray	Lanark	5
-drop table t1;
-alter tablespace ts1 drop datafile 'datafile.dat' engine=ndb;
-drop tablespace ts1 engine=ndb;
-drop logfile group lg1 engine=ndb;
-Different PK columns, should fail
-create table t1 (
-a int,
-b int,
-c int,
-d int,
-e varchar(200),
-f int,
-g char(20),
-h text,
-i int,
-primary key (a)) TABLESPACE ts1 engine = ndb;
-drop table t1;
-Different distribution keys, should pass
-create table t1 (
-a int,
-b int,
-c int,
-d int,
-e varchar(200),
-f int,
-g char(20),
-h text,
-i int,
-primary key(a,b)) TABLESPACE ts1 engine = ndb partition by key(a);
-select * from t1 order by a;
-a	b	c	d	e	f	g	h	i
-1	1	1	1	1	1	Rankin	Rebus	1
-2	2	2	2	2	2	Doyle	Holmes	2
-3	3	3	3	3	3	Burns	Mouse	3
-4	4	4	4	4	4	Gibbon	Chris	4
-5	5	5	5	5	5	Gray	Lanark	5
-drop table t1;

=== added file 'mysql-test/suite/ndb/r/ndb_restore_schema_tolerance.result'
--- a/mysql-test/suite/ndb/r/ndb_restore_schema_tolerance.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_restore_schema_tolerance.result	2011-02-22 03:29:24 +0000
@@ -0,0 +1,178 @@
+Test ndb_restore ability to ignore some schema differences
+use test;
+create table t1 (
+a int,
+b int,
+c int,
+d int,
+e varchar(200),
+f int,
+g char(20),
+h text,
+i int,
+primary key(a,b)) TABLESPACE ts1 engine = ndb;
+insert into t1 values
+(1, 1, 1, 1, '1', 1, 'Rankin', 'Rebus', 1),
+(2, 2, 2, 2, '2', 2, 'Doyle', 'Holmes', 2),
+(3, 3, 3, 3, '3', 3, 'Burns', 'Mouse', 3),
+(4, 4, 4, 4, '4', 4, 'Gibbon', 'Chris', 4),
+(5, 5, 5, 5, '5', 5, 'Gray', 'Lanark', 5);
+select * from t1 order by a;
+a	b	c	d	e	f	g	h	i
+1	1	1	1	1	1	Rankin	Rebus	1
+2	2	2	2	2	2	Doyle	Holmes	2
+3	3	3	3	3	3	Burns	Mouse	3
+4	4	4	4	4	4	Gibbon	Chris	4
+5	5	5	5	5	5	Gray	Lanark	5
+Backing up data
+drop table t1;
+Normal restore
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL DEFAULT '0',
+  `b` int(11) NOT NULL DEFAULT '0',
+  `c` int(11) DEFAULT NULL,
+  `d` int(11) DEFAULT NULL,
+  `e` varchar(200) DEFAULT NULL,
+  `f` int(11) DEFAULT NULL,
+  `g` char(20) DEFAULT NULL,
+  `h` text,
+  `i` int(11) DEFAULT NULL,
+  PRIMARY KEY (`a`,`b`)
+) /*!50100 TABLESPACE ts1 */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+select * from t1 order by a;
+a	b	c	d	e	f	g	h	i
+1	1	1	1	1	1	Rankin	Rebus	1
+2	2	2	2	2	2	Doyle	Holmes	2
+3	3	3	3	3	3	Burns	Mouse	3
+4	4	4	4	4	4	Gibbon	Chris	4
+5	5	5	5	5	5	Gray	Lanark	5
+truncate t1;
+Column name change, should fail without --exclude-missing-columns
+alter table t1 change c cc int;
+Retry with --exclude-missing-columns
+select * from t1 order by a;
+a	b	cc	d	e	f	g	h	i
+1	1	NULL	1	1	1	Rankin	Rebus	1
+2	2	NULL	2	2	2	Doyle	Holmes	2
+3	3	NULL	3	3	3	Burns	Mouse	3
+4	4	NULL	4	4	4	Gibbon	Chris	4
+5	5	NULL	5	5	5	Gray	Lanark	5
+truncate t1;
+Column type change, should fail
+alter table t1 change cc c bigint;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) NOT NULL DEFAULT '0',
+  `b` int(11) NOT NULL DEFAULT '0',
+  `c` bigint(20) DEFAULT NULL,
+  `d` int(11) DEFAULT NULL,
+  `e` varchar(200) DEFAULT NULL,
+  `f` int(11) DEFAULT NULL,
+  `g` char(20) DEFAULT NULL,
+  `h` text,
+  `i` int(11) DEFAULT NULL,
+  PRIMARY KEY (`a`,`b`)
+) /*!50100 TABLESPACE ts1 */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
+Retry with --promote-attribute
+select * from t1 order by a;
+a	b	c	d	e	f	g	h	i
+1	1	1	1	1	1	Rankin	Rebus	1
+2	2	2	2	2	2	Doyle	Holmes	2
+3	3	3	3	3	3	Burns	Mouse	3
+4	4	4	4	4	4	Gibbon	Chris	4
+5	5	5	5	5	5	Gray	Lanark	5
+truncate t1;
+Column nullability change, should fail
+alter table t1 change c c int not null;
+alter table t1 change c c int;
+Column length change, should fail
+alter table t1 change g g char(22);
+Character set difference, should fail
+alter table t1 change g g char(20) character set binary;
+alter table t1 change g g char(20);
+AutoIncrement difference, should fail
+alter table t1 change b b int auto_increment;
+Default difference, should pass 
+alter table t1 change b b int default 22;
+select * from t1 order by a;
+a	b	c	d	e	f	g	h	i
+1	1	1	1	1	1	Rankin	Rebus	1
+2	2	2	2	2	2	Doyle	Holmes	2
+3	3	3	3	3	3	Burns	Mouse	3
+4	4	4	4	4	4	Gibbon	Chris	4
+5	5	5	5	5	5	Gray	Lanark	5
+truncate t1;
+alter table t1 change b b int;
+ArrayType difference, should fail
+alter table t1 change e e varchar(300);
+alter table t1 change e e varchar(200);
+StorageType difference, should pass
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+alter table t1 change i i int storage disk;
+select * from t1 order by a;
+a	b	c	d	e	f	g	h	i
+1	1	1	1	1	1	Rankin	Rebus	1
+2	2	2	2	2	2	Doyle	Holmes	2
+3	3	3	3	3	3	Burns	Mouse	3
+4	4	4	4	4	4	Gibbon	Chris	4
+5	5	5	5	5	5	Gray	Lanark	5
+alter table t1 change i i int storage memory;
+truncate t1;
+Dynamic property difference, should pass
+alter table t1 change c c int column_format dynamic;
+select * from t1 order by a;
+a	b	c	d	e	f	g	h	i
+1	1	1	1	1	1	Rankin	Rebus	1
+2	2	2	2	2	2	Doyle	Holmes	2
+3	3	3	3	3	3	Burns	Mouse	3
+4	4	4	4	4	4	Gibbon	Chris	4
+5	5	5	5	5	5	Gray	Lanark	5
+drop table t1;
+alter tablespace ts1 drop datafile 'datafile.dat' engine=ndb;
+drop tablespace ts1 engine=ndb;
+drop logfile group lg1 engine=ndb;
+Different PK columns, should fail
+create table t1 (
+a int,
+b int,
+c int,
+d int,
+e varchar(200),
+f int,
+g char(20),
+h text,
+i int,
+primary key (a)) TABLESPACE ts1 engine = ndb;
+drop table t1;
+Different distribution keys, should pass
+create table t1 (
+a int,
+b int,
+c int,
+d int,
+e varchar(200),
+f int,
+g char(20),
+h text,
+i int,
+primary key(a,b)) TABLESPACE ts1 engine = ndb partition by key(a);
+select * from t1 order by a;
+a	b	c	d	e	f	g	h	i
+1	1	1	1	1	1	Rankin	Rebus	1
+2	2	2	2	2	2	Doyle	Holmes	2
+3	3	3	3	3	3	Burns	Mouse	3
+4	4	4	4	4	4	Gibbon	Chris	4
+5	5	5	5	5	5	Gray	Lanark	5
+drop table t1;

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_compressed-master.opt' => 'mysql-test/suite/ndb/t/ndb_restore_compat_compression-master.opt'
--- a/mysql-test/suite/ndb/t/ndb_restore_compressed-master.opt	2009-04-09 15:27:21 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_compat_compression-master.opt	2011-02-22 01:15:42 +0000
@@ -1 +1 @@
---result-file=../suite/ndb/r/ndb_restore
+--result-file=../suite/ndb/r/ndb_restore_misc

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_compressed.test' => 'mysql-test/suite/ndb/t/ndb_restore_compat_compression.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_compressed.test	2009-10-06 12:03:16 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_compat_compression.test	2011-02-22 03:29:24 +0000
@@ -1,8 +1,12 @@
-# Turn on compressed backup with magic DUMP command
+######################################################################
+# Test restoring compressed backups
+######################################################################
+
+# turn on compressed backup with magic DUMP command
 --exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all dump 13001 1" >> $NDB_TOOLS_OUTPUT
 
-# Run the ndb_restore test, should produce exactly the same output 
-source ndb_restore.test;
+# run the ndb_restore test, should produce exactly the same output 
+source ndb_restore_misc.test;
 
-# Turn off compressed backups
+# turn off compressed backups
 --exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all dump 13001 0" >> $NDB_TOOLS_OUTPUT

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_compat.test' => 'mysql-test/suite/ndb/t/ndb_restore_compat_downward.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_compat.test	2010-12-03 09:36:45 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_compat_downward.test	2011-02-22 03:29:24 +0000
@@ -1,3 +1,7 @@
+######################################################################
+# Test restoring backups of older/packed formats
+######################################################################
+
 -- source include/have_ndb.inc
 -- source include/have_case_sensitive_file_system.inc
 

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_different_endian_data.test' => 'mysql-test/suite/ndb/t/ndb_restore_compat_endianness.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_different_endian_data.test	2010-10-25 09:15:03 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_compat_endianness.test	2011-02-22 03:29:24 +0000
@@ -1,3 +1,7 @@
+######################################################################
+# Test restoring backups of different endianness
+######################################################################
+
 -- source include/have_ndb.inc
 -- source include/ndb_default_cluster.inc
 

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_lossy_charbinary_conv.test' => 'mysql-test/suite/ndb/t/ndb_restore_conv_lossy_charbinary.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_lossy_charbinary_conv.test	2010-10-23 06:46:02 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_conv_lossy_charbinary.test	2011-02-22 03:29:24 +0000
@@ -1,7 +1,5 @@
 ######################################################################
-# Author: Martin Zaun
-# Date: 2010-10
-# Purpose: Lossy conversion test for [var]char and [var]binary types
+# Test restoring backups with lossy conversions on [var]char|binary types
 ######################################################################
 
 -- source include/have_ndb.inc

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_lossy_integral_conv.test' => 'mysql-test/suite/ndb/t/ndb_restore_conv_lossy_integral.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_lossy_integral_conv.test	2010-10-23 06:46:02 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_conv_lossy_integral.test	2011-02-22 03:29:24 +0000
@@ -1,7 +1,5 @@
 ######################################################################
-# Author: Martin Zaun
-# Date: 2010-10
-# Purpose: Lossy conversion test for integral types
+# Test restoring backups with lossy conversions on integral types
 ######################################################################
 
 -- source include/have_ndb.inc

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_padding_preservation.test' => 'mysql-test/suite/ndb/t/ndb_restore_conv_padding.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_padding_preservation.test	2010-10-23 06:46:02 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_conv_padding.test	2011-02-22 03:29:24 +0000
@@ -1,7 +1,5 @@
 ######################################################################
-# Author: Martin Zaun
-# Date: 2010-10
-# Purpose: Right-padding preservation test for char and binary types
+# Test restoring backups with preserving padding in char/bin conversions
 ######################################################################
 
 -- source include/have_ndb.inc

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_promotion.test' => 'mysql-test/suite/ndb/t/ndb_restore_conv_promotion.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_promotion.test	2010-04-29 14:52:05 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_conv_promotion.test	2011-02-22 03:29:24 +0000
@@ -1,8 +1,6 @@
-#############################################################
-# Author: Guangbao
-# Date: 2007-11
-# Purpose: Basic Integer,Char and Binary type promotion test 
-##############################################################
+######################################################################
+# Test restoring backups with widening type conversions (promotion)
+######################################################################
 
 -- source include/have_ndb.inc
 -- source include/not_embedded.inc

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore.test' => 'mysql-test/suite/ndb/t/ndb_restore_misc.test'
--- a/mysql-test/suite/ndb/t/ndb_restore.test	2011-01-21 10:29:46 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_misc.test	2011-02-22 03:29:24 +0000
@@ -1,3 +1,7 @@
+######################################################################
+# Test various issues ndb_restore had at some time
+######################################################################
+
 -- source include/have_ndb.inc
 -- source include/ndb_default_cluster.inc
 

=== modified file 'mysql-test/suite/ndb/t/ndb_restore_print.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_print.test	2009-04-08 13:19:57 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_print.test	2011-02-22 01:15:42 +0000
@@ -1,3 +1,7 @@
+######################################################################
+# Test ndb_restore's print_data feature
+######################################################################
+
 -- source include/have_ndb.inc
 -- source include/ndb_default_cluster.inc
 

=== renamed file 'mysql-test/suite/ndb/t/ndb_blob_restore.test' => 'mysql-test/suite/ndb/t/ndb_restore_schema_blobs.test'
--- a/mysql-test/suite/ndb/t/ndb_blob_restore.test	2008-12-22 11:10:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_schema_blobs.test	2011-02-22 03:29:24 +0000
@@ -1,3 +1,7 @@
+######################################################################
+# Test restoring backups with blob columns
+######################################################################
+
 -- source include/have_ndb.inc
 -- source include/ndb_default_cluster.inc
 

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_partition.test' => 'mysql-test/suite/ndb/t/ndb_restore_schema_partitions.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_partition.test	2009-10-09 15:08:04 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_schema_partitions.test	2011-02-22 03:29:24 +0000
@@ -1,3 +1,7 @@
+######################################################################
+# Test restoring backups into partitioned tables
+######################################################################
+
 -- source include/have_ndb.inc
 -- source include/ndb_default_cluster.inc
 

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_rewrite_db.test' => 'mysql-test/suite/ndb/t/ndb_restore_schema_rewrites.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_rewrite_db.test	2011-02-02 10:17:58 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_schema_rewrites.test	2011-02-22 03:29:24 +0000
@@ -1,7 +1,5 @@
 ######################################################################
-# Author: Martin Zaun
-# Date: 2011-01
-# Purpose: test of rewrite-database feature
+# Test restoring backups into renamed databases
 ######################################################################
 
 -- source include/have_ndb.inc

=== renamed file 'mysql-test/suite/ndb/t/ndb_restore_options.test' => 'mysql-test/suite/ndb/t/ndb_restore_schema_subsets.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_options.test	2010-06-11 20:30:56 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_schema_subsets.test	2011-02-22 03:29:24 +0000
@@ -1,8 +1,10 @@
+######################################################################
+# Test restoring backups with in- or excluding tables or databases
+######################################################################
+
 -- source include/have_ndb.inc
 -- source include/ndb_default_cluster.inc
 
-# Bug#40429 Ignore tables when restoring
-
 --echo *************************************
 --echo Creating various databases and tables
 --echo *************************************
@@ -346,206 +348,3 @@ drop table db2.tab1, db2.tab2;
 
 drop database db1;
 drop database db2;
-
-# End of bug 40429
-
-
---echo Test ndb_restore ability to ignore some schema differences
-
-use test;
-create table t1 (
-  a int,
-  b int,
-  c int,
-  d int,
-  e varchar(200),
-  f int,
-  g char(20),
-  h text,
-  i int,
-  primary key(a,b)) TABLESPACE ts1 engine = ndb;
-
-insert into t1 values
-        (1, 1, 1, 1, '1', 1, 'Rankin', 'Rebus', 1),
-        (2, 2, 2, 2, '2', 2, 'Doyle', 'Holmes', 2),
-        (3, 3, 3, 3, '3', 3, 'Burns', 'Mouse', 3),
-        (4, 4, 4, 4, '4', 4, 'Gibbon', 'Chris', 4),
-        (5, 5, 5, 5, '5', 5, 'Gray', 'Lanark', 5);
-
-select * from t1 order by a;
-
---echo Backing up data
---source include/ndb_backup.inc
-
-drop table t1;
-
---echo Normal restore
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r -m  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r     $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-show create table t1;
-
-select * from t1 order by a;
-
-truncate t1;
-
---echo Column name change, should fail without --exclude-missing-columns
-
-alter table t1 change c cc int;
-
---error 1
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
---echo Retry with --exclude-missing-columns
-
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r --exclude-missing-columns $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r --exclude-missing-columns $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-select * from t1 order by a;
-truncate t1;
-
---echo Column type change, should fail
-
-alter table t1 change cc c bigint;
-show create table t1; #REMOVE!
---error 1
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
---echo Retry with --promote-attribute
-
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r --promote-attribute $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r --promote-attribute $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-select * from t1 order by a;
-truncate t1;
-
---echo Column nullability change, should fail
-
-alter table t1 change c c int not null;
-
---error 1
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-alter table t1 change c c int;
-
-# Skip Precision and scale differences - should fail
-
---echo Column length change, should fail
-
-alter table t1 change g g char(22);
-
---error 1
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
---echo Character set difference, should fail
-
-alter table t1 change g g char(20) character set binary;
-
---error 1
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-alter table t1 change g g char(20);
-
---echo AutoIncrement difference, should fail
-
-alter table t1 change b b int auto_increment;
-
---error 1
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
---echo Default difference, should pass 
-alter table t1 change b b int default 22;
-
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-select * from t1 order by a;
-truncate t1;
-
-alter table t1 change b b int;
-
---echo ArrayType difference, should fail
-alter table t1 change e e varchar(300);
-
---error 1
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-alter table t1 change e e varchar(200);
-
---echo StorageType difference, should pass
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB;
-
-alter table t1 change i i int storage disk;
-
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-select * from t1 order by a;
-
-alter table t1 change i i int storage memory;
-truncate t1;
-
-# Skip BlobType difference (should fail)
-
---echo Dynamic property difference, should pass
-
-alter table t1 change c c int column_format dynamic;
-
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-select * from t1 order by a;
-
-drop table t1;
-alter tablespace ts1 drop datafile 'datafile.dat' engine=ndb;
-drop tablespace ts1 engine=ndb;
-drop logfile group lg1 engine=ndb;
-
---echo Different PK columns, should fail
-create table t1 (
-  a int,
-  b int,
-  c int,
-  d int,
-  e varchar(200),
-  f int,
-  g char(20),
-  h text,
-  i int,
-  primary key (a)) TABLESPACE ts1 engine = ndb;
-
---error 1
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-drop table t1;
-
---echo Different distribution keys, should pass
-
-create table t1 (
-  a int,
-  b int,
-  c int,
-  d int,
-  e varchar(200),
-  f int,
-  g char(20),
-  h text,
-  i int,
-  primary key(a,b)) TABLESPACE ts1 engine = ndb partition by key(a);
-
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
---exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-select * from t1 order by a;
-
-drop table t1;

=== added file 'mysql-test/suite/ndb/t/ndb_restore_schema_tolerance.test'
--- a/mysql-test/suite/ndb/t/ndb_restore_schema_tolerance.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_restore_schema_tolerance.test	2011-02-22 03:29:24 +0000
@@ -0,0 +1,206 @@
+######################################################################
+# Test restoring backups into similar schemas
+######################################################################
+
+-- source include/have_ndb.inc
+-- source include/ndb_default_cluster.inc
+
+--echo Test ndb_restore ability to ignore some schema differences
+
+use test;
+create table t1 (
+  a int,
+  b int,
+  c int,
+  d int,
+  e varchar(200),
+  f int,
+  g char(20),
+  h text,
+  i int,
+  primary key(a,b)) TABLESPACE ts1 engine = ndb;
+
+insert into t1 values
+        (1, 1, 1, 1, '1', 1, 'Rankin', 'Rebus', 1),
+        (2, 2, 2, 2, '2', 2, 'Doyle', 'Holmes', 2),
+        (3, 3, 3, 3, '3', 3, 'Burns', 'Mouse', 3),
+        (4, 4, 4, 4, '4', 4, 'Gibbon', 'Chris', 4),
+        (5, 5, 5, 5, '5', 5, 'Gray', 'Lanark', 5);
+
+select * from t1 order by a;
+
+--echo Backing up data
+--source include/ndb_backup.inc
+
+drop table t1;
+
+--echo Normal restore
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r -m  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r     $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+show create table t1;
+
+select * from t1 order by a;
+
+truncate t1;
+
+--echo Column name change, should fail without --exclude-missing-columns
+
+alter table t1 change c cc int;
+
+--error 1
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+--echo Retry with --exclude-missing-columns
+
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r --exclude-missing-columns $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r --exclude-missing-columns $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+select * from t1 order by a;
+truncate t1;
+
+--echo Column type change, should fail
+
+alter table t1 change cc c bigint;
+show create table t1; #REMOVE!
+--error 1
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+--echo Retry with --promote-attribute
+
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r --promote-attribute $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r --promote-attribute $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+select * from t1 order by a;
+truncate t1;
+
+--echo Column nullability change, should fail
+
+alter table t1 change c c int not null;
+
+--error 1
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+alter table t1 change c c int;
+
+# Skip Precision and scale differences - should fail
+
+--echo Column length change, should fail
+
+alter table t1 change g g char(22);
+
+--error 1
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+--echo Character set difference, should fail
+
+alter table t1 change g g char(20) character set binary;
+
+--error 1
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+alter table t1 change g g char(20);
+
+--echo AutoIncrement difference, should fail
+
+alter table t1 change b b int auto_increment;
+
+--error 1
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+--echo Default difference, should pass 
+alter table t1 change b b int default 22;
+
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+select * from t1 order by a;
+truncate t1;
+
+alter table t1 change b b int;
+
+--echo ArrayType difference, should fail
+alter table t1 change e e varchar(300);
+
+--error 1
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+alter table t1 change e e varchar(200);
+
+--echo StorageType difference, should pass
+CREATE LOGFILE GROUP lg1
+ADD UNDOFILE 'undofile.dat'
+INITIAL_SIZE 16M
+UNDO_BUFFER_SIZE = 1M
+ENGINE=NDB;
+
+CREATE TABLESPACE ts1
+ADD DATAFILE 'datafile.dat'
+USE LOGFILE GROUP lg1
+INITIAL_SIZE 12M
+ENGINE NDB;
+
+alter table t1 change i i int storage disk;
+
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+select * from t1 order by a;
+
+alter table t1 change i i int storage memory;
+truncate t1;
+
+# Skip BlobType difference (should fail)
+
+--echo Dynamic property difference, should pass
+
+alter table t1 change c c int column_format dynamic;
+
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+select * from t1 order by a;
+
+drop table t1;
+alter tablespace ts1 drop datafile 'datafile.dat' engine=ndb;
+drop tablespace ts1 engine=ndb;
+drop logfile group lg1 engine=ndb;
+
+--echo Different PK columns, should fail
+create table t1 (
+  a int,
+  b int,
+  c int,
+  d int,
+  e varchar(200),
+  f int,
+  g char(20),
+  h text,
+  i int,
+  primary key (a)) TABLESPACE ts1 engine = ndb;
+
+--error 1
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+drop table t1;
+
+--echo Different distribution keys, should pass
+
+create table t1 (
+  a int,
+  b int,
+  c int,
+  d int,
+  e varchar(200),
+  f int,
+  g char(20),
+  h text,
+  i int,
+  primary key(a,b)) TABLESPACE ts1 engine = ndb partition by key(a);
+
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 1 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+--exec $NDB_RESTORE --no-defaults --core-file=false -b $the_backup_id -n 2 -r  $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
+
+select * from t1 order by a;
+
+drop table t1;

=== modified file 'mysql-test/t/greedy_optimizer.test'
--- a/mysql-test/t/greedy_optimizer.test	2009-01-16 10:45:17 +0000
+++ b/mysql-test/t/greedy_optimizer.test	2011-02-23 10:42:16 +0000
@@ -171,20 +171,31 @@ set optimizer_search_depth=63;
 select @@optimizer_search_depth;
 
 # 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, star
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, clique
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
 
 
 # Test the new optimization procedures
@@ -196,58 +207,92 @@ set optimizer_search_depth=0;
 select @@optimizer_search_depth;
 
 # 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, star
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, clique
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
+
 
 set optimizer_search_depth=1;
 select @@optimizer_search_depth;
 
 # 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, star
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, clique
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
 
 set optimizer_search_depth=62;
 select @@optimizer_search_depth;
 
 # 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, star
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, clique
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
 
 
 set optimizer_prune_level=1;
@@ -257,58 +302,91 @@ set optimizer_search_depth=0;
 select @@optimizer_search_depth;
 
 # 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, star
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, clique
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
 
 set optimizer_search_depth=1;
 select @@optimizer_search_depth;
 
 # 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, star
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, clique
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
 
 set optimizer_search_depth=62;
 select @@optimizer_search_depth;
 
 # 6-table join, chain
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, star
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
-show status like 'Last_query_cost';
-# 6-table join, clique
-explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
-explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
-show status like 'Last_query_cost';
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, star
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
+--source include/execute_with_statistics.inc
+
+# 6-table join, clique
+let $query=
+ select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
+
+let $query=
+ select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
+--source include/execute_with_statistics.inc
 
 drop table t1,t2,t3,t4,t5,t6,t7;
 
@@ -384,3 +462,472 @@ SET optimizer_search_depth = DEFAULT;
 DROP TABLE t1,t2,t2_1,t3,t3_1,t4,t4_1,t5,t5_1;
 
 --echo End of 5.0 tests
+
+
+
+--echo #
+--echo # Bug #59326: Greedy optimizer produce stupid query execution plans.
+--echo #
+
+CREATE TABLE t10(
+  K INT NOT NULL AUTO_INCREMENT,
+  I INT,
+  PRIMARY KEY(K)
+);
+INSERT INTO t10(I) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(0);
+
+CREATE TABLE t100 LIKE t10;
+INSERT INTO t100(I)
+SELECT X.I FROM t10 AS X,t10 AS Y;
+
+CREATE TABLE t10000 LIKE t10;
+INSERT INTO t10000(I)
+SELECT X.I FROM t100 AS X, t100 AS Y;
+
+let $total_handler_reads=
+select sum(variable_value) from information_schema.session_status
+ where VARIABLE_NAME like 'Handler_read%';
+
+
+## All crossproducts should be executed in order t10,t100,t10000
+EXPLAIN SELECT * FROM t10,t100,t10000;
+EXPLAIN SELECT * FROM t10,t10000,t100;
+EXPLAIN SELECT * FROM t100,t10,t10000;
+EXPLAIN SELECT * FROM t100,t10000,t10;
+EXPLAIN SELECT * FROM t10000,t10,t100;
+EXPLAIN SELECT * FROM t10000,t100,t10;
+
+######
+## Ordering between T100,T10000 EQ-joined T10 will
+## normally be with smallest EQ-table joined first
+######
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+  AND t10000.K=t10.I;
+--source include/expect_qep.inc
+
+## However, swapping EQ_REF-joined tables gives the same cost
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+  AND t10000.K=t10.I;
+--source include/check_qep.inc
+
+#####
+# Expect all variants of EQ joining t100 & t10000 with T10
+# to have same cost # handler_reads:
+let $query=
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+  AND t10000.K=t10.I;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+  AND t10000.K=t10.I;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+  AND t10000.K=t10.K;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+  AND t10000.K=t10.K;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t100,t10,t10000
+WHERE t100.K=t10.I
+  AND t10000.K=t10.K;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t100,t10000,t10
+WHERE t100.K=t10.I
+  AND t10000.K=t10.K;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10000,t10,t100
+WHERE t100.K=t10.I
+  AND t10000.K=t10.K;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10000,t100,t10
+WHERE t100.K=t10.I
+  AND t10000.K=t10.K;
+--source include/check_qep.inc
+
+
+#####
+## EQ_REF Should be executed before table scan(ALL)
+## - Independent of #records in table being EQ_REF-joined
+#####
+#####
+# Expect: Join EQ_REF(t100) before ALL(t10000)
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+  AND t10000.I=t10.I;
+--source include/expect_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+  AND t10000.I=t10.I;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+  AND t10000.I=t10.I;
+--source include/check_qep.inc
+
+#####
+# Expect: Join EQ_REF(t10000) before ALL(t100) (star-join)
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+  AND t10000.K=t10.I;
+--source include/expect_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.I=t10.I
+  AND t10000.K=t10.I;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+  AND t10000.K=t10.I;
+--source include/check_qep.inc
+
+#####
+# Expect: Join EQ_REF(t10000) before ALL(t100)
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+  AND t10000.K=t100.I;
+--source include/expect_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.I=t10.I
+  AND t10000.K=t100.I;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.I=t10.I
+  AND t10000.K=t100.I;
+--source include/check_qep.inc
+
+
+#####
+## EQ_REF & ALL join two instances of t10000 with t10:
+## Always EQ_REF join first before producing cross product
+#####
+
+#####
+# Expected QEP: 'join EQ_REF(X) on X.K=t10.I' before 'cross' ALL(Y)
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+--source include/expect_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I;
+--source include/check_qep.inc
+
+#####
+# Expected QEP: 'join EQ_REF(X) on X.K=t10.I' before ALL(Y)
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+  AND Y.I=t10.I;
+--source include/expect_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+  AND Y.I=t10.I;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+  AND Y.I=t10.I;
+--source include/check_qep.inc
+
+#####
+# Expected QEP: 'join EQ_REF(X) on X.K=t10.I' before ALL(Y)
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+  AND Y.I=X.K;
+--source include/expect_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+  AND Y.I=X.K;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+  AND Y.I=X.K;
+--source include/check_qep.inc
+
+
+
+## Create indexes to test REF access
+CREATE INDEX IX ON t10(I);
+CREATE INDEX IX ON t100(I);
+CREATE INDEX IX ON t10000(I);
+
+########
+## EQ_REF Should be executed before 'REF'
+## - Independent of #records in table being EQ_REF-joined
+
+####
+# Expected QEP: 'join EQ_REF(t100) on t100.K=t10.I' before REF(t10000)
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+  AND t10000.I=t10.I;
+--source include/expect_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t100,t10000
+WHERE t100.K=t10.I
+  AND t10000.I=t10.I;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000,t100
+WHERE t100.K=t10.I
+  AND t10000.I=t10.I;
+--source include/check_qep.inc
+
+
+#####
+## EQ_REF & REF join two instances of t10000 with t10:
+#####
+
+#####
+## Expect this QEP, cost & #handler_read
+# Expected QEP: 'join EQ_REF(X) on X.K=t10.I' before 'cross' ALL(Y)
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+--source include/expect_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I;
+--source include/check_qep.inc
+
+#####
+# Expected QEP: 'join EQ_REF(X) on X.K=t10.I' before REF(Y)
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+  AND Y.I=t10.I;
+--source include/expect_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+  AND Y.I=t10.I;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+  AND Y.I=t10.I;
+--source include/check_qep.inc
+
+#####
+# Expected QEP: 'join EQ_REF(X) on X.K=t10.I' before REF(Y)
+let $query=
+SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+  AND Y.I=X.K;
+--source include/expect_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 X,t10000 Y
+WHERE X.K=t10.I
+  AND Y.I=X.K;
+--source include/check_qep.inc
+
+let $query=
+SELECT COUNT(*) FROM t10,t10000 Y,t10000 X
+WHERE X.K=t10.I
+  AND Y.I=X.K;
+--source include/check_qep.inc
+
+########
+
+
+
+########
+
+--echo #
+--echo # Test improved capabilities of analyzing complex query
+--echo # plans without restricting 'optimizer_search_depth'.
+--echo # Fix problems like those reported as bug#41740 & bug#58225. 
+--echo #
+--echo # EPLAIN of queries using T1-T62 will timeout/hang wo/ fixes
+--echo #
+
+DROP TABLE t10, t10000;
+
+
+--disable_result_log
+
+let $tabledef=
+( K INT NOT NULL AUTO_INCREMENT,
+  I INT,
+  A INT,
+  PRIMARY KEY(K), KEY IX(A)
+) engine = InnoDB;
+
+let $analyze = ANALYZE TABLE t100;
+
+let $i= 1;
+while (`SELECT $i < 62`)
+{
+  let $create= CREATE TABLE T$i $tabledef;
+  eval $create;
+
+  let $insert =
+  INSERT INTO T$i(I,A) SELECT X.K,X.K FROM t100 AS X, t100 AS Y WHERE X.K < 20 AND Y.K <= $i;
+  eval $insert;
+
+  let $analyze = $analyze, T$i;
+  inc $i;
+}
+eval $analyze;
+
+set optimizer_prune_level=1;
+
+
+#################
+## The EXPLAIN'ed query itself can't be part of the verified 
+## result as the QEP is not 100% predictable due to variation
+## in statistics from the engines. This is believed to be
+## caused by:
+##  - Variations in table fill degree.
+##  - 'Fuzzy' statistics provided by engines.
+##  - Round errors caused by 'cost' calculation using 
+##    'only' 64-bit double precision.
+##  - Other bugs...?
+##
+###############
+
+## Will test with optimizer_search_depth= [0,1,3,62]
+let $depth= 0;
+while (`SELECT $depth<4`)
+{
+  if (`SELECT $depth=0`)
+  {
+    set optimizer_search_depth=0; 
+  }
+  if (`SELECT $depth=1`)
+  {
+    set optimizer_search_depth=1;
+  }
+  if (`SELECT $depth=2`)
+  {
+    set optimizer_search_depth=3;
+  }
+  if (`SELECT $depth=3`)
+  {
+    set optimizer_search_depth=62;
+  }
+  inc $depth;
+
+
+  ## Test pruning of joined table scans (ALL) 
+  ## Prepare of QEP without timeout is heavily dependent
+  ## on maintaining correctly '#rows-sorted' plan
+  ##
+  let $query= SELECT COUNT(*) FROM T1 AS X;
+  let $i= 1;
+  while (`SELECT $i < 61`)
+  {
+    let $query= $query JOIN T$i ON T$i.I=X.I;
+    inc $i;
+
+    select @@optimizer_prune_level;
+    select @@optimizer_search_depth;
+    eval EXPLAIN $query;
+  }
+
+  ## Test pruning of joined table scans (ALL) 
+  ## with multiple instances of same table.
+  ## (All instances being equally expensive)
+  let $query= SELECT COUNT(*) FROM T1 AS X;
+  let $i= 1;
+  while (`SELECT $i <= 56`)
+  {
+    let $t= T$i;
+    let $query= $query JOIN $t as T$i ON T$i.I=X.I;
+    inc $i;
+    let $query= $query JOIN $t as T$i ON T$i.I=X.I;
+    inc $i;
+    let $query= $query JOIN $t as T$i ON T$i.I=X.I;
+    inc $i;
+    let $query= $query JOIN $t as T$i ON T$i.I=X.I;
+    inc $i;
+    let $query= $query JOIN $t as T$i ON T$i.I=X.I;
+    inc $i;
+    let $query= $query JOIN $t as T$i ON T$i.I=X.I;
+    inc $i;
+    let $query= $query JOIN $t as T$i ON T$i.I=X.I;
+    inc $i;
+    let $query= $query JOIN $t as T$i ON T$i.I=X.I;
+    inc $i;
+
+    select @@optimizer_prune_level;
+    select @@optimizer_search_depth;
+    eval EXPLAIN $query;
+  }
+}
+
+let $drop = DROP TABLE t100;
+let $i= 1;
+while (`SELECT $i < 62`)
+{
+  let $drop = $drop, T$i;
+  inc $i;
+}
+eval $drop;
+
+--enable_result_log
+
+SET OPTIMIZER_SEARCH_DEPTH = DEFAULT;
+
+--ECHO END OF 5.6 TESTS
+

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-02-16 12:28:43 +0000
+++ b/sql/ha_ndbcluster.cc	2011-02-23 13:09:10 +0000
@@ -2852,15 +2852,19 @@ int ha_ndbcluster::get_metadata(THD *thd
     Approx. write size in bytes over transporter
   */
   m_bytes_per_write= 12 + tab->getRowSizeInBytes() + 4 * tab->getNoOfColumns();
-  if ((error= open_indexes(thd, ndb, table, FALSE)) == 0)
-  {
-    ndbtab_g.release();
+
+  /* Open indexes */
+  if ((error= open_indexes(thd, ndb, table, FALSE)) != 0)
+    goto err;
+
+  ndbtab_g.release();
+
 #ifdef HAVE_NDB_BINLOG
-    ndbcluster_read_binlog_replication(thd, ndb, m_share, m_table,
-                                       ::server_id, table, FALSE);
+  ndbcluster_read_binlog_replication(thd, ndb, m_share, m_table,
+                                     ::server_id, table, FALSE);
 #endif
-    DBUG_RETURN(0);
-  }
+
+  DBUG_RETURN(0);
 
 err:
   ndbtab_g.invalidate();
@@ -10768,16 +10772,6 @@ ha_ndbcluster::ha_ndbcluster(handlerton 
 }
 
 
-int ha_ndbcluster::ha_initialise()
-{
-  DBUG_ENTER("ha_ndbcluster::ha_initialise");
-  if (check_ndb_in_thd(current_thd))
-  {
-    DBUG_RETURN(FALSE);
-  }
-  DBUG_RETURN(TRUE);
-}
-
 /**
   Destructor for NDB Cluster table handler.
 */
@@ -10855,30 +10849,31 @@ int ha_ndbcluster::open(const char *name
   DBUG_ENTER("ha_ndbcluster::open");
   DBUG_PRINT("enter", ("name: %s  mode: %d  test_if_locked: %d",
                        name, mode, test_if_locked));
-  
-  /*
-    Setup ref_length to make room for the whole 
-    primary key to be written in the ref variable
-  */
-  
+
   if (bitmap_init(&m_save_read_set, NULL, table_share->fields, FALSE))
   {
     DBUG_RETURN(1);
   }
-  if (table_share->primary_key != MAX_KEY) 
+
+  if (table_share->primary_key != MAX_KEY)
   {
+    /*
+      Setup ref_length to make room for the whole
+      primary key to be written in the ref variable
+    */
     key= table->key_info+table_share->primary_key;
     ref_length= key->key_length;
   }
-  else // (table_share->primary_key == MAX_KEY) 
+  else
   {
     if (m_user_defined_partitioning)
     {
+      /* Add space for partid in ref */
       ref_length+= sizeof(m_part_id);
     }
   }
-
   DBUG_PRINT("info", ("ref_length: %d", ref_length));
+
   {
     char* bitmap_array;
     uint extra_hidden_keys= table_share->primary_key != MAX_KEY ? 0 : 1;

=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h	2011-02-16 12:28:43 +0000
+++ b/sql/ha_ndbcluster.h	2011-02-23 13:09:10 +0000
@@ -421,7 +421,6 @@ class ha_ndbcluster: public handler
 
   int get_pushability() const;
 
-  int ha_initialise();
 #ifndef NDB_WITHOUT_READ_BEFORE_WRITE_REMOVAL
   void column_bitmaps_signal(uint sig_type);
 #endif

=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2011-02-16 06:10:50 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2011-02-18 13:55:27 +0000
@@ -5048,44 +5048,6 @@ ndbcluster_drop_event(THD *thd, Ndb *ndb
   DBUG_RETURN(0);
 }
 
-int
-ndbcluster_handle_alter_table(THD *thd, NDB_SHARE *share, const char *type_str)
-{
-  DBUG_ENTER("ndbcluster_handle_alter_table");
-  const char *save_proc_info= thd->proc_info;
-  thd->proc_info= "Syncing ndb table schema operation and binlog";
-  pthread_mutex_lock(&share->mutex);
-  int max_timeout= DEFAULT_SYNC_TIMEOUT;
-  while (share->state == NSS_ALTERED)
-  {
-    struct timespec abstime;
-    set_timespec(abstime, 1);
-    int ret= pthread_cond_timedwait(&injector_cond,
-                                    &share->mutex,
-                                    &abstime);
-    if (thd->killed ||
-        (share->state != NSS_ALTERED))
-      break;
-    if (ret)
-    {
-      max_timeout--;
-      if (max_timeout == 0)
-      {
-        sql_print_error("NDB %s: %s timed out. Ignoring...",
-                        type_str, share->key);
-        DBUG_ASSERT(false);
-        break;
-      }
-      if (opt_ndb_extra_logging)
-        ndb_report_waiting(type_str, max_timeout,
-                           type_str, share->key, 0);
-    }
-  }
-  pthread_mutex_unlock(&share->mutex);
-  thd->proc_info= save_proc_info;
-  DBUG_RETURN(0);
-}
-
 /*
   when entering the calling thread should have a share lock id share != 0
   then the injector thread will have  one as well, i.e. share->use_count == 0

=== modified file 'sql/ha_ndbcluster_binlog.h'
--- a/sql/ha_ndbcluster_binlog.h	2011-02-16 06:10:50 +0000
+++ b/sql/ha_ndbcluster_binlog.h	2011-02-18 13:55:27 +0000
@@ -230,8 +230,6 @@ int ndbcluster_log_schema_op(THD *thd,
 int ndbcluster_drop_event(THD *thd, Ndb *ndb, NDB_SHARE *share,
                           const char *type_str,
                           const char * dbname, const char * tabname);
-int ndbcluster_handle_alter_table(THD *thd, NDB_SHARE *share,
-                                  const char *type_str);
 int ndbcluster_handle_drop_table(THD *thd, Ndb *ndb, NDB_SHARE *share,
                                  const char *type_str,
                                  const char * db, const char * tabname);

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2010-10-22 14:13:23 +0000
+++ b/sql/mysql_priv.h	2011-02-21 11:38:36 +0000
@@ -1992,7 +1992,9 @@ extern my_bool opt_sql_bin_update, opt_s
 extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
 extern my_bool opt_slave_compressed_protocol, use_temp_pool;
 extern ulong slave_exec_mode_options;
+#ifndef MCP_WL5151
 extern ulong slave_type_conversions_options;
+#endif
 extern my_bool opt_readonly, lower_case_file_system;
 extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
 extern my_bool opt_secure_auth;

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-11-15 10:26:48 +0000
+++ b/sql/mysqld.cc	2011-02-23 13:09:10 +0000
@@ -547,8 +547,10 @@ static const char *slave_exec_mode_str= 
 #ifndef MCP_WL3733
 my_bool slave_allow_batching;
 #endif
+#ifndef MCP_WL5151
 ulong slave_type_conversions_options;
 const char *slave_type_conversions_default= "";
+#endif
 ulong thread_cache_size=0, thread_pool_size= 0;
 ulong binlog_cache_size=0;
 ulonglong  max_binlog_cache_size=0;
@@ -5834,7 +5836,9 @@ enum options_mysqld
 #endif /* defined(ENABLED_DEBUG_SYNC) */
   OPT_OLD_MODE,
   OPT_SLAVE_EXEC_MODE,
+#ifndef MCP_WL5151
   OPT_SLAVE_TYPE_CONVERSIONS,
+#endif
   OPT_GENERAL_LOG_FILE,
   OPT_SLOW_QUERY_LOG_FILE,
   OPT_IGNORE_BUILTIN_INNODB,
@@ -6530,6 +6534,7 @@ thread is in the relay logs.",
    "not stop for operations that are idempotent. In STRICT mode, replication "
    "will stop on any unexpected difference between the master and the slave.",
    &slave_exec_mode_str, &slave_exec_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#ifndef MCP_WL5151
   {"slave-type-conversions", OPT_SLAVE_TYPE_CONVERSIONS,
    "Set of slave type conversions that are enabled. Legal values are:"
    " ALL_LOSSY to enable lossy conversions and"
@@ -6540,6 +6545,7 @@ thread is in the relay logs.",
    &slave_type_conversions_default,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
+#endif
   {"slow-query-log", OPT_SLOW_LOG,
    "Enable/disable slow query log.", &opt_slow_log,
    &opt_slow_log, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -7899,6 +7905,7 @@ static int mysql_init_variables(void)
                                                  &slave_exec_mode_typelib,
                                                  NULL,
                                                  &error);
+#ifndef MCP_WL5151
   /* Slave type conversions */
   slave_type_conversions_options= 0;
   slave_type_conversions_options=
@@ -7906,6 +7913,7 @@ static int mysql_init_variables(void)
                           &slave_type_conversions_typelib,
                           NULL,
                           &error);
+#endif
   /* Default mode string must not yield a error. */
   DBUG_ASSERT(!error);
   if (error)
@@ -8143,6 +8151,7 @@ mysqld_get_one_option(int optid,
     if (error)
       return 1;
     break;
+#ifndef MCP_WL5151
   case OPT_SLAVE_TYPE_CONVERSIONS:
     slave_type_conversions_options= (uint)
       find_bit_type_or_exit(argument, &slave_type_conversions_typelib, "", &error);
@@ -8150,6 +8159,7 @@ mysqld_get_one_option(int optid,
       return 1;
     break;
 #endif
+#endif
   case OPT_SAFEMALLOC_MEM_LIMIT:
 #if !defined(DBUG_OFF) && defined(SAFEMALLOC)
     sf_malloc_mem_limit = atoi(argument);

=== modified file 'sql/rpl_utility.cc'
--- a/sql/rpl_utility.cc	2011-01-14 14:02:55 +0000
+++ b/sql/rpl_utility.cc	2011-02-21 11:38:36 +0000
@@ -341,6 +341,11 @@ uint32 table_def::calc_field_size(uint c
 }
 
 
+/*
+  MCP NOTE! untagged changes in rpl_utility.h and rpl_utility are
+  part of backport "WL#5151 Conversion between different types when
+  replicating"
+*/
 /**
  */
 void show_sql_type(enum_field_types type, uint16 metadata, String *str)
@@ -518,10 +523,12 @@ void show_sql_type(enum_field_types type
 bool is_conversion_ok(int order, Relay_log_info *rli)
 {
   DBUG_ENTER("is_conversion_ok");
-  bool allow_non_lossy=
-    bit_is_set(slave_type_conversions_options, SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY);
-  bool allow_lossy=
-    bit_is_set(slave_type_conversions_options, SLAVE_TYPE_CONVERSIONS_ALL_LOSSY);
+  bool allow_non_lossy, allow_lossy;
+
+  allow_non_lossy = slave_type_conversions_options &
+                    (ULL(1) << SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY);
+  allow_lossy= slave_type_conversions_options &
+               (ULL(1) << SLAVE_TYPE_CONVERSIONS_ALL_LOSSY);
 
   DBUG_PRINT("enter", ("order: %d, flags:%s%s", order,
                        allow_non_lossy ? " ALL_NON_LOSSY" : "",

=== modified file 'sql/rpl_utility.h'
--- a/sql/rpl_utility.h	2010-06-16 12:04:53 +0000
+++ b/sql/rpl_utility.h	2011-02-21 11:38:36 +0000
@@ -41,6 +41,11 @@ class Relay_log_info;
 class table_def
 {
 public:
+/*
+  MCP NOTE! untagged changes in rpl_utility.h and rpl_utility are
+  part of backport "WL#5151 Conversion between different types when
+  replicating"
+*/
   /**
     Constructor.
 

=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc	2010-10-29 20:45:08 +0000
+++ b/sql/set_var.cc	2011-02-23 13:09:10 +0000
@@ -87,6 +87,7 @@ TYPELIB delay_key_write_typelib=
   delay_key_write_type_names, NULL
 };
 
+#ifndef MPC_WL5151
 /**
   SLAVE_TYPE_CONVERSIONS variable.
 
@@ -113,6 +114,7 @@ TYPELIB slave_type_conversions_typelib=
   slave_type_conversions_type_name,
   slave_type_conversions_type_length
 };
+#endif
 
 static const char *slave_exec_mode_names[]= { "STRICT", "IDEMPOTENT", NullS };
 static unsigned int slave_exec_mode_names_len[]= { sizeof("STRICT") - 1,
@@ -614,11 +616,13 @@ static sys_var_bool_ptr         sys_slav
                                                          &slave_allow_batching);
 #endif
 #endif
+#ifndef MPC_WL5151
 static sys_var_set slave_type_conversions(&vars,
                                           "slave_type_conversions",
                                           &slave_type_conversions_options,
                                           &slave_type_conversions_typelib,
                                           0);
+#endif
 
 static sys_var_long_ptr	sys_slow_launch_time(&vars, "slow_launch_time",
 					     &slow_launch_time);

=== modified file 'sql/set_var.h'
--- a/sql/set_var.h	2010-10-12 11:54:35 +0000
+++ b/sql/set_var.h	2011-02-21 11:38:36 +0000
@@ -35,7 +35,9 @@ typedef struct my_locale_st MY_LOCALE;
 
 extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib,
   optimizer_switch_typelib, slave_exec_mode_typelib;
+#ifndef MCP_WL5151
 extern TYPELIB slave_type_conversions_typelib;
+#endif
 
 typedef int (*sys_check_func)(THD *,  set_var *);
 typedef bool (*sys_update_func)(THD *, set_var *);

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2011-02-02 15:16:35 +0000
+++ b/sql/sql_class.h	2011-02-23 13:09:10 +0000
@@ -86,13 +86,16 @@ enum enum_ha_read_modes { RFIRST, RNEXT,
 enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };
 enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
 			    DELAY_KEY_WRITE_ALL };
+
 #define SLAVE_EXEC_MODE_STRICT      (1U << 0)
 #define SLAVE_EXEC_MODE_IDEMPOTENT  (1U << 1)
+#ifndef MCP_WL5151
 enum enum_slave_type_conversions {
   SLAVE_TYPE_CONVERSIONS_ALL_LOSSY,
   SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY,
   SLAVE_TYPE_CONVERSIONS_COUNT
 };
+#endif
 
 enum enum_mark_columns
 { MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE};

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2011-02-08 14:29:52 +0000
+++ b/sql/sql_select.cc	2011-02-23 13:09:10 +0000
@@ -5108,18 +5108,35 @@ optimize_straight_join(JOIN *join, table
                      record_count, read_time);
     /* compute the cost of the new plan extended with 's' */
     record_count*= join->positions[idx].records_read;
+#ifdef MCP_BUG59326
     read_time+=    join->positions[idx].read_time;
+#else
+    read_time+=    join->positions[idx].read_time
+                   + record_count / (double) TIME_FOR_COMPARE;
+#endif
     join_tables&= ~(s->table->map);
     ++idx;
   }
 
+#ifdef MCP_BUG59326
   read_time+= record_count / (double) TIME_FOR_COMPARE;
+#endif
   if (join->sort_by_table &&
       join->sort_by_table != join->positions[join->const_tables].table->table)
     read_time+= record_count;  // We have to make a temp table
   memcpy((uchar*) join->best_positions, (uchar*) join->positions,
          sizeof(POSITION)*idx);
+#ifdef MCP_BUG59326
   join->best_read= read_time;
+#else
+  /**
+   * If many plans have identical cost, which one will be used
+   * depends on how compiler optimizes floating-point calculations.
+   * this fix adds repeatability to the optimizer.
+   * (Similar code in best_extension_by_li...)
+   */
+  join->best_read= read_time - 0.001;
+#endif
 }
 
 
@@ -5275,12 +5292,28 @@ greedy_search(JOIN      *join,
     while (pos && best_table != pos)
       pos= join->best_ref[++best_idx];
     DBUG_ASSERT((pos != NULL)); // should always find 'best_table'
+#ifdef MCP_BUG59326
     /* move 'best_table' at the first free position in the array of joins */
     swap_variables(JOIN_TAB*, join->best_ref[idx], join->best_ref[best_idx]);
+#else
+    /*
+      Maintain '#rows-sorted' order of 'best_ref[]':
+       - Shift 'best_ref[]' to make first position free. 
+       - Insert 'best_table' at the first free position in the array of joins.
+    */
+    memmove(join->best_ref + idx + 1, join->best_ref + idx,
+            sizeof(JOIN_TAB*) * (best_idx - idx));
+    join->best_ref[idx]= best_table;
+#endif
 
     /* compute the cost of the new plan extended with 'best_table' */
     record_count*= join->positions[idx].records_read;
+#ifdef MCP_BUG59326
     read_time+=    join->positions[idx].read_time;
+#else
+    read_time+=    join->positions[idx].read_time
+                   + record_count / (double) TIME_FOR_COMPARE;
+#endif
 
     remaining_tables&= ~(best_table->table->map);
     --size_remain;
@@ -5432,16 +5465,33 @@ best_extension_by_limited_search(JOIN   
      'join' is a partial plan with lower cost than the best plan so far,
      so continue expanding it further with the tables in 'remaining_tables'.
   */
-  JOIN_TAB *s;
   double best_record_count= DBL_MAX;
   double best_read_time=    DBL_MAX;
 
   DBUG_EXECUTE("opt", print_plan(join, idx, record_count, read_time, read_time,
                                 "part_plan"););
 
+  JOIN_TAB *s;
+#ifndef MCP_BUG59326
+  JOIN_TAB *saved_refs[MAX_TABLES];
+  // Save 'best_ref[]' as we has to restore before return.
+  memcpy(saved_refs, join->best_ref + idx, 
+         sizeof(JOIN_TAB*) * (join->tables - idx));
+#endif
+
   for (JOIN_TAB **pos= join->best_ref + idx ; (s= *pos) ; pos++)
   {
     table_map real_table_bit= s->table->map;
+
+#ifndef MCP_BUG59326
+    /*
+      Don't move swap inside conditional code: All items should
+      be uncond. swapped to maintain '#rows-ordered' best_ref[].
+      This is critical for early pruning of bad plans.
+    */
+    swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
+#endif
+
     if ((remaining_tables & real_table_bit) && 
         !(remaining_tables & s->dependent) && 
         (!idx || !check_interleaving_with_nj(s)))
@@ -5453,6 +5503,7 @@ best_extension_by_limited_search(JOIN   
                        record_count, read_time);
       /* Compute the cost of extending the plan with 's' */
       current_record_count= record_count * join->positions[idx].records_read;
+#ifdef MCP_BUG59326
       current_read_time=    read_time + join->positions[idx].read_time;
 
       /* Expand only partial plans with lower cost than the best QEP so far */
@@ -5466,6 +5517,20 @@ best_extension_by_limited_search(JOIN   
                                         current_record_count / 
                                         (double) TIME_FOR_COMPARE),
                                        "prune_by_cost"););
+#else
+      current_read_time=    read_time
+                            + join->positions[idx].read_time
+                            + current_record_count / (double) TIME_FOR_COMPARE;
+
+      /* Expand only partial plans with lower cost than the best QEP so far */
+      if (current_read_time >= join->best_read)
+      {
+        DBUG_EXECUTE("opt", print_plan(join, idx+1,
+                                       current_record_count,
+                                       read_time,
+                                       current_read_time,
+                                       "prune_by_cost"););
+#endif
         restore_prev_nj_state(s);
         continue;
       }
@@ -5504,8 +5569,11 @@ best_extension_by_limited_search(JOIN   
       }
 
       if ( (search_depth > 1) && (remaining_tables & ~real_table_bit) )
-      { /* Recursively expand the current partial plan */
+      {
+#ifdef MCP_BUG59326
         swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
+#endif
+        /* Explore more best extensions of plan */
         if (best_extension_by_limited_search(join,
                                              remaining_tables & ~real_table_bit,
                                              idx + 1,
@@ -5514,20 +5582,28 @@ best_extension_by_limited_search(JOIN   
                                              search_depth - 1,
                                              prune_level))
           DBUG_RETURN(TRUE);
+#ifdef MCP_BUG59326
         swap_variables(JOIN_TAB*, join->best_ref[idx], *pos);
+#endif
       }
       else
       { /*
           'join' is either the best partial QEP with 'search_depth' relations,
           or the best complete QEP so far, whichever is smaller.
         */
+#ifdef MCP_BUG59326
         current_read_time+= current_record_count / (double) TIME_FOR_COMPARE;
+#endif
         if (join->sort_by_table &&
             join->sort_by_table !=
             join->positions[join->const_tables].table->table)
           /* We have to make a temp table */
           current_read_time+= current_record_count;
+#ifdef MCP_BUG59326
         if ((search_depth == 1) || (current_read_time < join->best_read))
+#else
+        if (current_read_time < join->best_read)
+#endif
         {
           memcpy((uchar*) join->best_positions, (uchar*) join->positions,
                  sizeof(POSITION) * (idx + 1));
@@ -5542,6 +5618,11 @@ best_extension_by_limited_search(JOIN   
       restore_prev_nj_state(s);
     }
   }
+
+#ifndef MCP_BUG59326
+  // Restore previous #rows sorted best_ref[]
+  memcpy(join->best_ref + idx, saved_refs, sizeof(JOIN_TAB*) * (join->tables-idx));
+#endif
   DBUG_RETURN(FALSE);
 }
 

=== modified file 'storage/ndb/include/util/NdbSqlUtil.hpp'
--- a/storage/ndb/include/util/NdbSqlUtil.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/util/NdbSqlUtil.hpp	2011-02-19 03:13:04 +0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2003, 2011, 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
@@ -24,6 +24,16 @@
 struct charset_info_st;
 typedef struct charset_info_st CHARSET_INFO;
 
+/**
+ * Helper class with comparison functions on NDB (column) data types.
+ *
+ * Notes: this Helper class
+ * - is used by kernel code
+ * - provides non-elementary functions
+ * - is not generic, template-based code
+ * - has link/library dependencies upon MySQL code
+ * (in contrast to other type utility classes, like ./NdbTypesUtil).
+ */
 class NdbSqlUtil {
 public:
   /**

=== added file 'storage/ndb/include/util/NdbTypesUtil.hpp'
--- a/storage/ndb/include/util/NdbTypesUtil.hpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/include/util/NdbTypesUtil.hpp	2011-02-21 17:39:23 +0000
@@ -0,0 +1,450 @@
+/*
+  Copyright (c) 2011, 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 02110-1301  USA
+*/
+
+#ifndef NDB_TYPES_UTIL_HPP
+#define NDB_TYPES_UTIL_HPP
+
+#include <assert.h>
+#include <string.h>
+
+#include "my_global.h"
+
+#include "ndb_constants.h"
+#include "ndb_types.h"
+
+/*
+ * Traits and Helper classes for NDB data types.
+ */
+
+// ---------------------------------------------------------------------------
+// Traits classes providing information on NDB (column) data types
+// ---------------------------------------------------------------------------
+
+/*
+ * These Traits classes support code genericity by parametrizing over
+ * NDB (column) data types.  They provide compile-time information on
+ * - array types:               [long][var](binary|char)
+ * - numeric types:             [U]Int8..[U]Int64|float|double
+ *
+ * For instance, Traits functions
+ * - isFixedSized()             for array types
+ * - lowest(), highest()        for numeric types
+ * allow for the generic handling of arrays or numeric limits.
+ *
+ * Notes: the Traits classes
+ * - provide uniform access to type meta-data
+ * - are used as a type argument to a class or function template
+ * - have pure compile-time scope, lack instantiation at runtime
+ * - have _no_ link or library dependencies upon C++ stdlib code
+ *   (compare to the bounds definitions in std::numeric_limits)
+ * - are defined below as inline template specializations.
+ */
+
+/**
+ * Common Traits of NDB array types.
+ */
+template< int TID > // the NDB type id as defined in ndb_constants.h
+struct ArrayTypeTraits {
+  // whether this array type is a binary or character type
+  static bool isBinary();
+
+  // whether this array type is fixed-or variable-sized
+  static bool isFixedSized();
+
+  // the size of the length prefix in bytes, or zero if a fixed-sized array
+  static Uint32 lengthPrefixSize();
+};
+
+// aliases for array type traits
+typedef ArrayTypeTraits< NDB_TYPE_CHAR > Tchar;
+typedef ArrayTypeTraits< NDB_TYPE_BINARY > Tbinary;
+typedef ArrayTypeTraits< NDB_TYPE_VARCHAR > Tvarchar;
+typedef ArrayTypeTraits< NDB_TYPE_VARBINARY > Tvarbinary;
+typedef ArrayTypeTraits< NDB_TYPE_LONGVARCHAR > Tlongvarchar;
+typedef ArrayTypeTraits< NDB_TYPE_LONGVARBINARY > Tlongvarbinary;
+
+// internal helper class
+template< typename T >
+struct NumTypeMap {};
+
+/**
+ * Common Traits of NDB numeric types.
+ *
+ * Notes: the C++ stdlib offers limits as part of std::numeric_limits;
+ * its bounds definitions result in a non-uniform usage over different
+ * data types, with min() referring to the smallest positive value for
+ * float and double, but lowest negative value for integral types.
+ * In contrast, this Traits class's functions lowest() and smallest()
+ * support a uniform usage.
+ */
+template< typename T >
+struct NumTypeTraits {
+  // the domain type T
+  typedef typename NumTypeMap< T >::DomainT DomainT;
+
+  // if T is integral, the signed type of same width; otherwise T
+  typedef typename NumTypeMap< T >::SignedT SignedT;
+
+  // if T is integral, the unsigned type of same width; otherwise T
+  typedef typename NumTypeMap< T >::UnsignedT UnsignedT;
+
+  // whether the domain type is an integer type
+  static bool isIntegral() { return NumTypeMap< T >::isIntegral(); };
+
+  // whether the domain type is signed or unsigned
+  static bool isSigned() { return NumTypeMap< T >::isSigned(); };
+
+  // the width of the type in bytes
+  static Uint32 size();
+
+  // the minimum finite value
+  static T lowest();
+
+  // the maximum finite value
+  static T highest();
+
+  // the minimum positive normalized value, or 0 for integral types
+  static T smallest();
+};
+
+// aliases for standard numeric type traits
+typedef NumTypeTraits< Int8 > Tint8;
+typedef NumTypeTraits< Int16 > Tint16;
+typedef NumTypeTraits< Int32 > Tint32;
+typedef NumTypeTraits< Int64 > Tint64;
+typedef NumTypeTraits< Uint8 > Tuint8;
+typedef NumTypeTraits< Uint16 > Tuint16;
+typedef NumTypeTraits< Uint32 > Tuint32;
+typedef NumTypeTraits< Uint64 > Tuint64;
+// not implemented yet: float, double
+// ansi C type 'long double' is not a supported numeric NDB type
+
+/**
+ * Common Traits of non-standard NDB numeric types.
+ *
+ * Unless distinct [U]Int24 value types are defined to represent these
+ * proper subsets of [U]Int32 numbers, the correspoding Traits classes
+ * need to be defined as separate types (not just mere specializations).
+ * Using a derived class does that and allows to partially override.
+ */
+template< typename T >
+struct NonStdNumTypeTraits : NumTypeTraits< T > {
+  // the minimum finite value
+  static T lowest();
+
+  // the maximum finite value
+  static T highest();
+};
+
+// aliases for standard numeric type traits
+typedef NonStdNumTypeTraits< Int32 > Tint24;
+typedef NonStdNumTypeTraits< Uint32 > Tuint24;
+
+// ---------------------------------------------------------------------------
+// Helper classes providing common functions on NDB (column) data
+// ---------------------------------------------------------------------------
+
+/*
+ * These Helper classes provide basic utility functions on NDB types.
+ *
+ * For example, Helper functions
+ * - read/writeLengthPrefix()   for array types
+ * - load(), store()            for numeric types
+ * allow to abstract from the details of writing an array's length prefix
+ * or from reading/writing a numeric value from/to an unaligned buffer.
+ *
+ * Notes: the Helper classes
+ * - extend Traits classes for convenience
+ * - only add basic utility functions that
+ * - have _no_ link or library dependencies upon MySQL code
+ *   (in contrast to other SQL utility code like ./NdbSqlUtil)
+ * - are defined below as inline template specializations.
+ */
+
+/**
+ * Basic Helper functions for NDB array types.
+ */
+template< int ID >
+struct ArrayTypeHelper : ArrayTypeTraits< ID > {
+  // read the length prefix (not available if a fixed-sized array)
+  static Uint32 readLengthPrefix(const void * a);
+
+  // write the length prefix (not available if a fixed-sized array)
+  // the non-length-prefix bytes of 'l' must be zero
+  static void writeLengthPrefix(void * a, Uint32 l);
+};
+
+// aliases for array type helpers
+typedef ArrayTypeHelper< NDB_TYPE_CHAR > Hchar;
+typedef ArrayTypeHelper< NDB_TYPE_BINARY > Hbinary;
+typedef ArrayTypeHelper< NDB_TYPE_VARCHAR > Hvarchar;
+typedef ArrayTypeHelper< NDB_TYPE_VARBINARY > Hvarbinary;
+typedef ArrayTypeHelper< NDB_TYPE_LONGVARCHAR > Hlongvarchar;
+typedef ArrayTypeHelper< NDB_TYPE_LONGVARBINARY > Hlongvarbinary;
+
+/**
+ * Basic Helper functions for numeric NDB types.
+ *
+ * As another design option, these helper functions could be defined as
+ * individual function templates, which'd allow for implicit function
+ * resolution based on the parameter type but, on the other hand, required
+ * distinct value types for all data (i.e., an Int24 value type).
+ */
+template< typename T >
+struct NumTypeHelper : NumTypeTraits< T > {
+  // convenience aliases
+  typedef typename NumTypeTraits< T >::SignedT SignedT;
+  typedef typename NumTypeTraits< T >::UnsignedT UnsignedT;
+
+  // casts a value to the signed numerical type of same width
+  static SignedT asSigned(T t) { return static_cast< SignedT >(t); }
+
+  // casts a value to the unsigned numerical type of same width
+  static UnsignedT asUnsigned(T t) { return static_cast< UnsignedT >(t); }
+
+  // read a single value from an unaligned buffer; s, t must not overlap
+  static void load(T * t, const char * s);
+
+  // write a single value to an unaligned buffer; s, t must not overlap
+  static void store(char * t, const T * s);
+};
+
+// aliases for numeric type helpers
+typedef NumTypeHelper< Int8 > Hint8;
+typedef NumTypeHelper< Int16 > Hint16;
+typedef NumTypeHelper< Int32 > Hint32;
+typedef NumTypeHelper< Int64 > Hint64;
+typedef NumTypeHelper< Uint8 > Huint8;
+typedef NumTypeHelper< Uint16 > Huint16;
+typedef NumTypeHelper< Uint32 > Huint32;
+typedef NumTypeHelper< Uint64 > Huint64;
+// not implemented yet: float, double
+// ansi C type 'long double' is not a supported numeric NDB type
+
+/**
+ * Basic Helper functions of non-standard NDB numeric types.
+ *
+ * Unless distinct [U]Int24 value types are defined to represent these
+ * proper subsets of [U]Int32 numbers, the correspoding Helper classes
+ * need to be defined as separate types (not just mere specializations).
+ * This class only derives from the Traits class to avoid member access
+ * ambiguities resulting from multiple inheritance.
+ */
+template< typename T >
+struct NonStdNumTypeHelper : NonStdNumTypeTraits< T > {
+  // convenience alias
+  typedef typename NonStdNumTypeTraits< T >::SignedT SignedT;
+  typedef typename NonStdNumTypeTraits< T >::UnsignedT UnsignedT;
+
+  // casts a value to the signed numerical type of same width
+  static SignedT asSigned(T t) { return static_cast< SignedT >(t); }
+
+  // casts a value to the unsigned numerical type of same width
+  static UnsignedT asUnsigned(T t) { return static_cast< UnsignedT >(t); }
+
+  // read a single value from an unaligned buffer; s, t must not overlap
+  static void load(T * t, const char * s);
+
+  // write a single value to an unaligned buffer; s, t must not overlap
+  static void store(char * t, const T * s);
+};
+
+// aliases for non-standard numeric type helpers
+typedef NonStdNumTypeHelper< Int32 > Hint24;
+typedef NonStdNumTypeHelper< Uint32 > Huint24;
+
+// ---------------------------------------------------------------------------
+// Definitions/Specializations of Traits classes
+// ---------------------------------------------------------------------------
+
+// specialize the Traits template members for array types
+#define NDB_SPECIALIZE_ARRAY_TYPE_TRAITS( TR, B, FS, LPS )              \
+  template<> inline bool TR::isBinary() { return B; }                   \
+  template<> inline bool TR::isFixedSized() { return FS; }              \
+  template<> inline Uint32 TR::lengthPrefixSize() { return LPS; }
+
+// coincidentally, we could use ndb constants
+//   NDB_ARRAYTYPE_FIXED, NDB_ARRAYTYPE_SHORT_VAR, NDB_ARRAYTYPE_MEDIUM_VAR
+// instead of literals, but let's not confuse ordinal/cardinal numbers
+NDB_SPECIALIZE_ARRAY_TYPE_TRAITS(Tchar, false, true, 0)
+NDB_SPECIALIZE_ARRAY_TYPE_TRAITS(Tbinary, true, true, 0)
+NDB_SPECIALIZE_ARRAY_TYPE_TRAITS(Tvarchar, false, false, 1)
+NDB_SPECIALIZE_ARRAY_TYPE_TRAITS(Tvarbinary, true, false, 1)
+NDB_SPECIALIZE_ARRAY_TYPE_TRAITS(Tlongvarchar, false, false, 2)
+NDB_SPECIALIZE_ARRAY_TYPE_TRAITS(Tlongvarbinary, true, false, 2)
+#undef NDB_SPECIALIZE_ARRAY_TYPE_TRAITS
+
+// specialize the TypeMap template for numeric types
+#define NDB_SPECIALIZE_NUM_TYPE_MAP( DT, ST, UT, I, S )                 \
+  template<> struct NumTypeMap< DT > {                                  \
+    typedef DT DomainT;                                                 \
+    typedef ST SignedT;                                                 \
+    typedef UT UnsignedT;                                               \
+    static bool isIntegral() { return S; };                             \
+    static bool isSigned() { return S; };                               \
+  };
+
+NDB_SPECIALIZE_NUM_TYPE_MAP(Int8, Int8, Uint8, true, true)
+NDB_SPECIALIZE_NUM_TYPE_MAP(Uint8, Int8, Uint8, true, false)
+NDB_SPECIALIZE_NUM_TYPE_MAP(Int16, Int16, Uint16, true, true)
+NDB_SPECIALIZE_NUM_TYPE_MAP(Uint16, Int16, Uint16, true, false)
+NDB_SPECIALIZE_NUM_TYPE_MAP(Int32, Int32, Uint32, true, true)
+NDB_SPECIALIZE_NUM_TYPE_MAP(Uint32, Int32, Uint32, true, false)
+NDB_SPECIALIZE_NUM_TYPE_MAP(Int64, Int64, Uint64, true, true)
+NDB_SPECIALIZE_NUM_TYPE_MAP(Uint64, Int64, Uint64, true, false)
+
+NDB_SPECIALIZE_NUM_TYPE_MAP(float, float, float, false, true)
+NDB_SPECIALIZE_NUM_TYPE_MAP(double, double, double, false, true)
+#undef NDB_SPECIALIZE_NUM_TYPE_MAP
+
+// specialize the Traits template members for numeric types
+#define NDB_SPECIALIZE_NUM_TYPE_TRAITS( TR, T, SZ, LO, HI, SM )         \
+  template<> inline Uint32 TR::size() { return SZ; }                    \
+  template<> inline T TR::lowest() { return LO; }                       \
+  template<> inline T TR::highest() { return HI; }                      \
+  template<> inline T TR::smallest() { return SM; }
+
+NDB_SPECIALIZE_NUM_TYPE_TRAITS(Tint8, Int8, 1, INT_MIN8, INT_MAX8, 0)
+NDB_SPECIALIZE_NUM_TYPE_TRAITS(Tint16, Int16, 2, INT_MIN16, INT_MAX16, 0)
+NDB_SPECIALIZE_NUM_TYPE_TRAITS(Tint32, Int32, 4, INT_MIN32, INT_MAX32, 0)
+NDB_SPECIALIZE_NUM_TYPE_TRAITS(Tint64, Int64, 8, INT_MIN64, INT_MAX64, 0)
+
+NDB_SPECIALIZE_NUM_TYPE_TRAITS(Tuint8, Uint8, 1, 0, UINT_MAX8, 0)
+NDB_SPECIALIZE_NUM_TYPE_TRAITS(Tuint16, Uint16, 2, 0, UINT_MAX16, 0)
+NDB_SPECIALIZE_NUM_TYPE_TRAITS(Tuint32, Uint32, 4, 0, UINT_MAX32, 0)
+NDB_SPECIALIZE_NUM_TYPE_TRAITS(Tuint64, Uint64, 8, 0, UINT_MAX64, 0)
+// not implemented yet: float, double
+#undef NDB_SPECIALIZE_NUM_TYPE_TRAITS
+
+// specialize the Traits template members for non-standard numeric types
+#define NDB_SPECIALIZE_NON_STD_NUM_TYPE_TRAITS( TR, T, LO, HI )         \
+  template<> inline T TR::lowest() { return LO; }                       \
+  template<> inline T TR::highest() { return HI; }
+
+NDB_SPECIALIZE_NON_STD_NUM_TYPE_TRAITS(Tint24, Int32, INT_MIN24, INT_MAX24)
+NDB_SPECIALIZE_NON_STD_NUM_TYPE_TRAITS(Tuint24, Uint32, 0, UINT_MAX24)
+#undef NDB_SPECIALIZE_NON_STD_NUM_TYPE_TRAITS
+
+// ---------------------------------------------------------------------------
+// Definitions/Specializations of Helper classes
+// ---------------------------------------------------------------------------
+
+// specialize the Helper template members for fixed-sized arrays
+#define NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS0( H )                      \
+  template<> inline Uint32 H::readLengthPrefix(const void * a) {        \
+    assert(false);                                                      \
+    (void)a;                                                            \
+    return 0;                                                           \
+  };                                                                    \
+  template<> inline void H::writeLengthPrefix(void * a, Uint32 l) {     \
+    assert(false);                                                      \
+    (void)a; (void)l;                                                   \
+  }
+
+NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS0(Hchar)
+NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS0(Hbinary)
+#undef NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS0
+
+// specialize the Helper template members for short-var arrays
+#define NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS1( H )                      \
+  template<> inline Uint32 H::readLengthPrefix(const void * a) {        \
+    assert(a);                                                          \
+    const Uint8 * s = static_cast<const Uint8 *>(a);                    \
+    return s[0];                                                        \
+  };                                                                    \
+  template<> inline void H::writeLengthPrefix(void * a, Uint32 l) {     \
+    assert(a);                                                          \
+    assert(l >> (lengthPrefixSize() * 8) == 0);                         \
+    Uint8 * t = static_cast<Uint8 *>(a);                                \
+    t[0] = l & 0x000000FF;                                              \
+  }
+
+NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS1(Hvarchar)
+NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS1(Hvarbinary)
+#undef NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS1
+
+// specialize the Helper template members for medium-var arrays
+#define NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS2( H )                      \
+  template<> inline Uint32 H::readLengthPrefix(const void * a) {        \
+    assert(a);                                                          \
+    const Uint8 * s = static_cast<const Uint8 *>(a);                    \
+    return static_cast<Uint32>(s[0] + (s[1] << 8));                     \
+  };                                                                    \
+  template<> inline void H::writeLengthPrefix(void * a, Uint32 l) {     \
+    assert(a);                                                          \
+    assert(l >> (lengthPrefixSize() * 8) == 0);                         \
+    Uint8 * t = static_cast<Uint8 *>(a);                                \
+    t[0] = static_cast<Uint8>(l & 0x000000FF);                          \
+    t[1] = static_cast<Uint8>((l & 0x0000FF00) >> 8);                   \
+  }
+
+NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS2(Hlongvarchar)
+NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS2(Hlongvarbinary)
+#undef NDB_SPECIALIZE_ARRAY_TYPE_HELPER_LPS2
+
+// specialize the Helper template members for single-byte types
+#define NDB_SPECIALIZE_NUM_TYPE_HELPER_BYTE( H, T )                     \
+  template<> inline void H::load(T * t, const char * s) {               \
+    assert(t); assert(s); assert(t != (const T *)s);                    \
+    *t = static_cast<T>(*s);                                            \
+  }                                                                     \
+  template<> inline void H::store(char * t, const T * s) {              \
+    H::load(reinterpret_cast<T *>(t),                                   \
+            reinterpret_cast<const char *>(s));                         \
+  }
+
+NDB_SPECIALIZE_NUM_TYPE_HELPER_BYTE(Hint8, Int8);
+NDB_SPECIALIZE_NUM_TYPE_HELPER_BYTE(Huint8, Uint8);
+#undef NDB_SPECIALIZE_NUM_TYPE_HELPER_BYTE
+
+// specialize the Helper template members for numeric types
+#define NDB_SPECIALIZE_NUM_TYPE_HELPER( H, T )                          \
+  template<> inline void H::load(T * t, const char * s) {               \
+    assert(t); assert(s); assert(t != (const T *)s);                    \
+    memcpy(t, s, H::size());                                            \
+  }                                                                     \
+  template<> inline void H::store(char * t, const T * s) {              \
+    H::load(reinterpret_cast<T *>(t),                                   \
+            reinterpret_cast<const char *>(s));                         \
+  }
+
+NDB_SPECIALIZE_NUM_TYPE_HELPER(Hint16, Int16);
+NDB_SPECIALIZE_NUM_TYPE_HELPER(Hint32, Int32);
+NDB_SPECIALIZE_NUM_TYPE_HELPER(Hint64, Int64);
+
+NDB_SPECIALIZE_NUM_TYPE_HELPER(Huint16, Uint16);
+NDB_SPECIALIZE_NUM_TYPE_HELPER(Huint32, Uint32);
+NDB_SPECIALIZE_NUM_TYPE_HELPER(Huint64, Uint64);
+// not implemented yet: float, double
+#undef NDB_SPECIALIZE_NUM_TYPE_HELPER
+
+// specialize the Helper template members for non-standard numeric types
+#define NDB_SPECIALIZE_NON_STD_NUM_TYPE_HELPER( H, T, INT3KORR )        \
+  template<> inline void H::load(T * t, const char * s) {               \
+    assert(t); assert(s); assert(t != (const T *)s);                    \
+    *t = (INT3KORR(s));                                                 \
+  }                                                                     \
+  template<> inline void H::store(char * t, const T * s) {              \
+    assert(t); assert(s); assert((const T *)t != s);                    \
+    int3store(t, (*s));                                                 \
+  }
+
+NDB_SPECIALIZE_NON_STD_NUM_TYPE_HELPER(Hint24, Int32, sint3korr)
+NDB_SPECIALIZE_NON_STD_NUM_TYPE_HELPER(Huint24, Uint32, uint3korr)
+#undef NDB_SPECIALIZE_NON_STD_NUM_TYPE_HELPER
+
+#endif /* !NDB_TYPES_UTIL_HPP */

=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2011-02-18 08:50:50 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2011-02-23 13:09:10 +0000
@@ -1993,6 +1993,9 @@ void Dbdih::execREAD_NODESCONF(Signal* s
     printf("Checking 2-pass initial node restart: ");
     for (i = 0; i<index; i++)
     {
+      if (NdbNodeBitmask::get(readNodes->inactiveNodes, nodeArray[i]))
+        continue;
+
       if (!ndbd_non_trans_copy_frag_req(getNodeInfo(nodeArray[i]).m_version))
       {
         jam();

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2011-02-18 08:50:50 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2011-02-23 13:09:10 +0000
@@ -16772,7 +16772,18 @@ void Dblqh::execSTART_RECREQ(Signal* sig
     lcpPtr.i = 0;
     ptrAss(lcpPtr, lcpRecord);
     lcpPtr.p->m_outstanding = 1;
-    
+
+    if (cstartType == NodeState::ST_INITIAL_NODE_RESTART)
+    {
+      jam();
+      /**
+       * Skip lgman undo...
+       */
+      signal->theData[0] = LGMAN_REF;
+      sendSignal(reference(), GSN_START_RECCONF, signal, 1, JBB);
+      return;
+    }
+
     if (!isNdbMtLqh())
     {
       jam();

=== modified file 'storage/ndb/src/kernel/vm/LongSignal.cpp'
--- a/storage/ndb/src/kernel/vm/LongSignal.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/src/kernel/vm/LongSignal.cpp	2011-02-22 06:57:40 +0000
@@ -180,6 +180,7 @@ dupSection(SPC_ARG Uint32& copyFirstIVal
   return true;
 }
 
+bool ErrorImportActive = false;
 extern int ErrorSignalReceive;
 extern int ErrorMaxSegmentsToSeize;
 
@@ -217,11 +218,14 @@ appendToSection(SPC_ARG Uint32& firstSeg
   {
 #ifdef ERROR_INSERT
     /* Simulate running out of segments */
-    if ((ErrorSignalReceive == 1) && 
-        (ErrorMaxSegmentsToSeize == 0))
+    if (ErrorImportActive)
     {
-      ndbout_c("append exhausted on first segment");
-      return false;
+      if ((ErrorSignalReceive == 1) && 
+          (ErrorMaxSegmentsToSeize == 0))
+      {
+        ndbout_c("append exhausted on first segment");
+        return false;
+      }
     }
 #endif
     /* First data to be added to this section */
@@ -273,13 +277,16 @@ appendToSection(SPC_ARG Uint32& firstSeg
 
 #ifdef ERROR_INSERT
     /* Simulate running out of segments */
-    if ((ErrorSignalReceive == 1) && 
-        (0 == remainSegs--))
+    if (ErrorImportActive)
     {
-      ndbout_c("Append exhausted on segment %d", ErrorMaxSegmentsToSeize);
-      firstPtr.p->m_lastSegment= prevPtr.i;
-      firstPtr.p->m_sz-= len;
-      return false;
+      if ((ErrorSignalReceive == 1) && 
+          (0 == remainSegs--))
+      {
+        ndbout_c("Append exhausted on segment %d", ErrorMaxSegmentsToSeize);
+        firstPtr.p->m_lastSegment= prevPtr.i;
+        firstPtr.p->m_sz-= len;
+        return false;
+      }
     }
 #endif
     bool result = g_sectionSegmentPool.seize(SPC_SEIZE_ARG currPtr);
@@ -313,11 +320,14 @@ import(SPC_ARG Ptr<SectionSegment> & fir
 
 #ifdef ERROR_INSERT
   /* Simulate running out of segments */
-  if ((ErrorSignalReceive == 1) &&
-      (ErrorMaxSegmentsToSeize == 0))
+  if (ErrorImportActive)
   {
-    ndbout_c("Import exhausted on first segment");
-    return false;
+    if ((ErrorSignalReceive == 1) &&
+        (ErrorMaxSegmentsToSeize == 0))
+    {
+      ndbout_c("Import exhausted on first segment");
+      return false;
+    }
   }
 #endif
 
@@ -346,15 +356,18 @@ import(SPC_ARG Ptr<SectionSegment> & fir
 
 #ifdef ERROR_INSERT
     /* Simulate running out of segments */
-    if ((ErrorSignalReceive == 1) &&
-        (0 == remainSegs--))
+    if (ErrorImportActive)
     {
-      ndbout_c("Import exhausted on segment %d", 
-               ErrorMaxSegmentsToSeize);
-      first.p->m_lastSegment= prevPtr.i;
-      first.p->m_sz-= len;
-      prevPtr.p->m_nextSegment = RNIL;
-      return false;
+      if ((ErrorSignalReceive == 1) &&
+          (0 == remainSegs--))
+      {
+        ndbout_c("Import exhausted on segment %d", 
+                 ErrorMaxSegmentsToSeize);
+        first.p->m_lastSegment= prevPtr.i;
+        first.p->m_sz-= len;
+        prevPtr.p->m_nextSegment = RNIL;
+        return false;
+      }
     }
 #endif
 

=== modified file 'storage/ndb/src/kernel/vm/TransporterCallback.cpp'
--- a/storage/ndb/src/kernel/vm/TransporterCallback.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/vm/TransporterCallback.cpp	2011-02-22 06:57:40 +0000
@@ -46,6 +46,13 @@ SectionSegmentPool g_sectionSegmentPool;
 int ErrorSignalReceive= 0;
 int ErrorMaxSegmentsToSeize= 0;
 
+/**
+ * This variable controls if ErrorSignalReceive/ErrorMaxSegmentsToSeize
+ *   is active...This to make sure only received signals are affected
+ *   and not long signals sent inside node
+ */
+extern bool ErrorImportActive;
+
 struct ConnectionError
 {
   enum TransporterError err;
@@ -140,6 +147,7 @@ TransporterCallbackKernel::deliver_signa
   bzero(secPtr, sizeof(secPtr));
   secPtr[0].p = secPtr[1].p = secPtr[2].p = 0;
 
+  ErrorImportActive = true;
   switch(secCount){
   case 3:
     ok &= import(SPC_CACHE_ARG secPtr[2], ptr[2].p, ptr[2].sz);
@@ -148,6 +156,7 @@ TransporterCallbackKernel::deliver_signa
   case 1:
     ok &= import(SPC_CACHE_ARG secPtr[0], ptr[0].p, ptr[0].sz);
   }
+  ErrorImportActive = false;
 
   /**
    * Check that we haven't received a too long signal

=== modified file 'storage/ndb/src/mgmsrv/ConfigManager.cpp'
--- a/storage/ndb/src/mgmsrv/ConfigManager.cpp	2011-01-31 17:37:07 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigManager.cpp	2011-02-22 13:17:24 +0000
@@ -903,6 +903,7 @@ void ConfigManager::set_config_change_st
   {
     // Rebuild m_all_mgm so that each node in config is included
     // new mgm nodes might have been added
+    assert(m_config_change.m_error == ConfigChangeRef::OK);
     m_config->get_nodemask(m_all_mgm, NDB_MGM_NODE_TYPE_MGM);
   }
 
@@ -1113,7 +1114,7 @@ ConfigManager::sendConfigChangeConf(Sign
 
 
 void
-ConfigManager::startConfigChange(SignalSender& ss)
+ConfigManager::startConfigChange(SignalSender& ss, Uint32 ref)
 {
   if (m_config_state == CS_INITIAL)
   {
@@ -1126,7 +1127,7 @@ ConfigManager::startConfigChange(SignalS
                         m_config_change.m_new_config->getGeneration());
   }
   m_config_change.m_contacted_nodes.clear();
-  m_config_change.m_client_ref = ss.getOwnRef();
+  m_config_change.m_client_ref = ref;
   if (sendConfigChangeImplReq(ss, m_config_change.m_new_config) <= 0)
   {
     g_eventLogger->error("Failed to start configuration change!");
@@ -1152,16 +1153,30 @@ ConfigManager::startAbortConfigChange(Si
                                      MGM_CONFIG_MAN,
                                      GSN_CONFIG_CHANGE_IMPL_REQ,
                                      ConfigChangeImplReq::SignalLength);
-  if (m_waiting_for.isclear())
-    set_config_change_state(ConfigChangeState::IDLE);
-  else
-    set_config_change_state(ConfigChangeState::ABORTING);
 
   if (m_config_change.m_new_config)
   {
     delete m_config_change.m_new_config;
     m_config_change.m_new_config = 0;
   }
+
+  if (m_waiting_for.isclear())
+  {
+    /**
+     * Send CONFIG_CHANGE_IMPL_CONF (aborting) to self
+     */
+    m_waiting_for.set(ss.getOwnNodeId());
+    ConfigChangeImplConf* const conf =
+      CAST_PTR(ConfigChangeImplConf, ssig.getDataPtrSend());
+    conf->requestType = ConfigChangeImplReq::Abort;
+
+    ss.sendSignal(ss.getOwnNodeId(), ssig,
+                  MGM_CONFIG_MAN,
+                  GSN_CONFIG_CHANGE_IMPL_CONF,
+                  ConfigChangeImplConf::SignalLength);
+  }
+
+  set_config_change_state(ConfigChangeState::ABORTING);
 }
 
 int
@@ -1277,9 +1292,8 @@ ConfigManager::execCONFIG_CHANGE_REQ(Sig
     return;
   }
 
-  m_config_change.m_client_ref = from;
   m_config_change.m_new_config = new_config;
-  startConfigChange(ss);
+  startConfigChange(ss, from);
 
   return;
 }
@@ -1326,6 +1340,31 @@ ConfigManager::execCONFIG_CHECK_REQ(Sign
     other_checksum = checksum;
   }
 
+  if (m_prepared_config || m_config_change.m_new_config)
+  {
+    g_eventLogger->debug("Got CONFIG_CHECK_REQ from node: %d while "
+                         "config change in progress (m_prepared_config). "
+                         "Returning incorrect state, causing it to be retried",
+                         nodeId);
+    sendConfigCheckRef(ss, from, ConfigCheckRef::WrongState,
+                       generation, other_generation,
+                       m_config_state, CS_UNINITIALIZED);
+    return;
+  }
+
+  if (m_config_change.m_loaded_config && ss.getOwnNodeId() < nodeId)
+  {
+    g_eventLogger->debug("Got CONFIG_CHECK_REQ from node: %d while "
+                         "having a loaded config (and my node is lower: %d). "
+                         "Returning incorrect state, causing it to be retried",
+                         nodeId,
+                         ss.getOwnNodeId());
+    sendConfigCheckRef(ss, from, ConfigCheckRef::WrongState,
+                       generation, other_generation,
+                       m_config_state, CS_UNINITIALIZED);
+    return;
+  }
+
   g_eventLogger->debug("Got CONFIG_CHECK_REQ from node: %d. "
                        "Our generation: %d, other generation: %d, "
                        "our state: %d, other state: %d, "
@@ -1800,7 +1839,7 @@ ConfigManager::run()
           Config* new_conf = m_config_change.m_initial_config;
           m_config_change.m_initial_config = 0;
           m_config_change.m_new_config = new_conf;
-          startConfigChange(ss);
+          startConfigChange(ss, ss.getOwnRef());
         }
         break;
 
@@ -1822,7 +1861,7 @@ ConfigManager::run()
             m_started.equal(m_all_mgm) &&   // All mgmd started
             m_checked.equal(m_started))     // All nodes checked
         {
-          startConfigChange(ss);
+          startConfigChange(ss, ss.getOwnRef());
         }
 
         break;

=== modified file 'storage/ndb/src/mgmsrv/ConfigManager.hpp'
--- a/storage/ndb/src/mgmsrv/ConfigManager.hpp	2011-01-31 17:37:07 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigManager.hpp	2011-02-22 08:40:01 +0000
@@ -153,7 +153,7 @@ class ConfigManager : public MgmtThread 
   void abortConfigChange();
 
   /* Functions for starting config change from ConfigManager */
-  void startConfigChange(SignalSender& ss);
+  void startConfigChange(SignalSender& ss, Uint32 ref);
   void startAbortConfigChange(SignalSender&);
 
   /* CONFIG_CHANGE - controlling config change from other node */

=== modified file 'storage/ndb/test/ndbapi/testDict.cpp'
--- a/storage/ndb/test/ndbapi/testDict.cpp	2011-01-30 20:56:00 +0000
+++ b/storage/ndb/test/ndbapi/testDict.cpp	2011-02-21 15:08:51 +0000
@@ -7186,7 +7186,8 @@ runFailAddPartition(NDBT_Context* ctx, N
 
   const NdbDictionary::Table * org = pDic->getTable(tab.getName());
   NdbDictionary::Table altered = * org;
-  altered.setFragmentCount(org->getFragmentCount() + 2);
+  altered.setFragmentCount(org->getFragmentCount() +
+                           restarter.getNumDbNodes());
 
   if (pDic->beginSchemaTrans())
   {

=== modified file 'storage/ndb/test/ndbapi/testMgm.cpp'
--- a/storage/ndb/test/ndbapi/testMgm.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/testMgm.cpp	2011-02-22 08:40:01 +0000
@@ -22,6 +22,7 @@
 #include <mgmapi_debug.h>
 #include <InputStream.hpp>
 #include <signaldata/EventReport.hpp>
+#include <NdbRestarter.hpp>
 
 /*
   Tests that only need the mgmd(s) started
@@ -1127,7 +1128,7 @@ int runTestGetNodeIdUntilStopped(NDBT_Co
 
 int runSleepAndStop(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int counter= 10*ctx->getNumLoops();
+  int counter= 3*ctx->getNumLoops();
 
   while(!ctx->isTestStopped() && counter--)
     NdbSleep_SecSleep(1);;
@@ -1162,7 +1163,7 @@ check_transporter_connect(NdbMgmd& mgmd,
 
   // Send the 'hello'
   g_info << "Client hello: '" << hello << "'" << endl;
-  if (out.println(hello))
+  if (out.println("%s", hello))
   {
     g_err << "Send hello '" << hello << "' failed" << endl;
     return false;
@@ -2504,18 +2505,22 @@ int runTestStatusAfterStop(NDBT_Context*
     return NDBT_FAILED;
   }
 
+  int nodeId = 0;
   for(int i=0; i < cs->no_of_nodes; i++ )
   {
     ndb_mgm_node_state *ns = cs->node_states + i;
     printf("Node ID: %d  status:%d\n", ns->node_id, ns->node_status);
+    if (nodeId == 0 && ns->node_type == NDB_MGM_NODE_TYPE_NDB)
+      nodeId = ns->node_id;
   }
   free(cs);
   cs = NULL;
 
   printf("Stopping data node\n");
   // We only stop 1 data node, in this case NodeId=2
-  int nodes[1] =  { 2 };
-  int stopped = ndb_mgm_stop2(mgmd.handle(), NDB_ARRAY_SIZE(nodes), nodes, 0);
+  int nodes[1] =  { nodeId };
+  int stopped = ndb_mgm_restart2(mgmd.handle(), NDB_ARRAY_SIZE(nodes), nodes, 
+                                 0, 0, 1);
   if (stopped < 0)
   {
     printf("ndb_mgm_stop failed, '%s' (%d)\n",
@@ -2541,6 +2546,10 @@ int runTestStatusAfterStop(NDBT_Context*
   }
   free(cs);
 
+  NdbRestarter res;
+  res.startAll();
+  res.waitClusterStarted();
+
   return NDBT_OK;
 }
 

=== modified file 'storage/ndb/test/ndbapi/testNdbApi.cpp'
--- a/storage/ndb/test/ndbapi/testNdbApi.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/testNdbApi.cpp	2011-02-21 14:27:16 +0000
@@ -3605,14 +3605,16 @@ int runFragmentedScanOtherApi(NDBT_Conte
        * on timing
        */
       if ((execError != 0) &&
-          (execError != 874))
+          (execError != 874) && 
+          (execError != 4002))
       {
+        ndbout_c("%u incorrect error code: %u", __LINE__, execError);
         ERR(trans->getNdbError());
         trans->close();
         delete[] buff;
         return NDBT_FAILED;
       }
-      
+
       /* nextResult will always fail */  
       CHECK(-1 == scan->nextResult());
       
@@ -3632,6 +3634,7 @@ int runFragmentedScanOtherApi(NDBT_Conte
         }
         else
         {
+          ndbout_c("%u incorrect error code: %u", __LINE__, execError);
           ERR(scan->getNdbError());
           trans->close();
           delete[] buff;

=== modified file 'storage/ndb/test/ndbapi/testNodeRestart.cpp'
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp	2011-02-21 13:17:16 +0000
@@ -4062,11 +4062,22 @@ runForceStopAndRestart(NDBT_Context* ctx
     }
   }
 
+  printf("group1: ");
+  for (size_t i = 0; i<group1.size(); i++)
+    printf("%d ", group1[i]);
+  printf("\n");
+
+  printf("group2: ");
+  for (size_t i = 0; i<group2.size(); i++)
+    printf("%d ", group2[i]);
+  printf("\n");
+
   // Stop half of the cluster
   res.restartNodes(group1.getBase(), (int)group1.size(),
-                   NdbRestarter::NRRF_NOSTART);
+                   NdbRestarter::NRRF_NOSTART | NdbRestarter::NRRF_ABORT);
   res.waitNodesNoStart(group1.getBase(), (int)group1.size());
 
+  ndbout_c("%u", __LINE__);
   // Try to stop first node in second half without force, should return error
   if (res.restartOneDbNode(group2[0],
                            false, /* initial */
@@ -4074,10 +4085,13 @@ runForceStopAndRestart(NDBT_Context* ctx
                            false, /* abort */
                            false  /* force */) != -1)
   {
+    ndbout_c("%u", __LINE__);
     g_err << "Restart suceeded without force" << endl;
     return NDBT_FAILED;
   }
 
+  ndbout_c("%u", __LINE__);
+
   // Now stop with force
   if (res.restartOneDbNode(group2[0],
                            false, /* initial */
@@ -4085,18 +4099,25 @@ runForceStopAndRestart(NDBT_Context* ctx
                            false, /* abort */
                            true   /* force */) != 0)
   {
+    ndbout_c("%u", __LINE__);
     g_err << "Could not restart with force" << endl;
     return NDBT_FAILED;
   }
 
+  ndbout_c("%u", __LINE__);
+
   // All nodes should now be in nostart, the above stop force
   // cvaused the remainig nodes to be stopped(and restarted nostart)
   res.waitClusterNoStart();
 
+  ndbout_c("%u", __LINE__);
+
   // Start second half back up again
   res.startNodes(group2.getBase(), (int)group2.size());
   res.waitNodesStarted(group2.getBase(), (int)group2.size());
 
+  ndbout_c("%u", __LINE__);
+
   // Try to stop remaining half without force, should return error
   if (res.restartNodes(group2.getBase(), (int)group2.size(),
                        NdbRestarter::NRRF_NOSTART) != -1)
@@ -4105,6 +4126,8 @@ runForceStopAndRestart(NDBT_Context* ctx
     return NDBT_FAILED;
   }
 
+  ndbout_c("%u", __LINE__);
+
   // Now stop with force
   if (res.restartNodes(group2.getBase(), (int)group2.size(),
                        NdbRestarter::NRRF_NOSTART |
@@ -4113,6 +4136,9 @@ runForceStopAndRestart(NDBT_Context* ctx
     g_err << "Could not restart with force" << endl;
     return NDBT_FAILED;
   }
+
+  ndbout_c("%u", __LINE__);
+
   if (res.waitNodesNoStart(group2.getBase(), (int)group2.size()))
   {
     g_err << "Failed to waitNodesNoStart" << endl;

=== modified file 'storage/ndb/test/ndbapi/testSystemRestart.cpp'
--- a/storage/ndb/test/ndbapi/testSystemRestart.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp	2011-02-18 18:40:25 +0000
@@ -996,6 +996,7 @@ int runSystemRestart8(NDBT_Context* ctx,
     CHECK(restarter.waitNodesStartPhase(a_nodeIds, nodeCount-1, 3, 120) == 0);
     CHECK(restarter.startNodes(&nodeId, 1) == 0);
     CHECK(restarter.waitClusterStarted(timeout) == 0);
+    CHECK(pNdb->waitUntilReady() == 0);
     
     int count = records - 1;
     CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
@@ -1342,6 +1343,7 @@ runBug28770(NDBT_Context* ctx, NDBT_Step
     restarter.insertErrorInAllNodes(6024);
     CHECK(restarter.startAll()== 0);
     CHECK(restarter.waitClusterStarted() == 0);
+    CHECK(pNdb->waitUntilReady() == 0);
     CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0);
     CHECK(count == records);
     i++;
@@ -1443,7 +1445,8 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_S
     CHECK(restarter.waitClusterNoStart() == 0);
     CHECK(restarter.startAll() == 0);
     CHECK(restarter.waitClusterStarted() == 0);
-    
+    CHECK(pNdb->waitUntilReady() == 0);
+
     ndbout << "Starting backup..." << flush;
     CHECK(backup.start() == 0);
     ndbout << "done" << endl;
@@ -1542,6 +1545,8 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_S
     CHECK(restarter.waitClusterNoStart() == 0);
     CHECK(restarter.startAll() == 0);
     CHECK(restarter.waitClusterStarted() == 0);
+    CHECK(pNdb->waitUntilReady() == 0);
+
     if (error)
     {
       restarter.insertErrorInAllNodes(error);
@@ -1730,6 +1735,7 @@ int runBug22696(NDBT_Context* ctx, NDBT_
     CHECK(restarter.insertErrorInAllNodes(7072) == 0);
     CHECK(restarter.startAll() == 0);
     CHECK(restarter.waitClusterStarted() == 0);
+    CHECK(pNdb->waitUntilReady() == 0);
 
     i++;
     if (i < loops)
@@ -1791,7 +1797,7 @@ runBasic(NDBT_Context* ctx, NDBT_Step* s
     CHECK(restarter.startAll() == 0);
     CHECK(restarter.waitClusterStarted() == 0);
     CHECK(pNdb->waitUntilReady() == 0);
-    
+
     for (int i = 0; i<NDBT_Tables::getNumTables(); i++)
     {
       const NdbDictionary::Table* tab = 
@@ -1911,7 +1917,8 @@ runTO(NDBT_Context* ctx, NDBT_Step* step
     } while (NdbTick_CurrentMillisecond() < (now + 30000));
     g_err.m_out = save[0];
     CHECK(res.waitClusterStarted() == 0);
-    
+    CHECK(pNdb->waitUntilReady() == 0);
+
     hugoTrans.clearTable(pNdb);
     hugoTrans.loadTable(pNdb, rows);
     
@@ -2079,6 +2086,8 @@ int runBug46651(NDBT_Context* ctx, NDBT_
   if (res.waitClusterStarted())
     return NDBT_FAILED;
 
+  pNdb->waitUntilReady();
+
   NdbDictionary::Table newTab = *pTab;
   col.setName("ATTR4");
   col.setType(NdbDictionary::Column::Varbinary);
@@ -2101,6 +2110,7 @@ int runBug46651(NDBT_Context* ctx, NDBT_
   if (res.waitClusterStarted())
     return NDBT_FAILED;
 
+  pNdb->waitUntilReady();
   pDict->dropTable(tab.getName());
 
   return NDBT_OK;
@@ -2341,6 +2351,7 @@ runBug54611(NDBT_Context* ctx, NDBT_Step
     res.insertErrorInAllNodes(5055);
     res.startAll();
     res.waitClusterStarted();
+    pNdb->waitUntilReady();
   }
 
   return NDBT_OK;
@@ -2387,6 +2398,7 @@ runBug56961(NDBT_Context* ctx, NDBT_Step
     res.startNodes(&node, 1);
     ndbout_c("Waiting for %d to start", node);
     res.waitClusterStarted();
+    pNdb->waitUntilReady();
   }
 
   return NDBT_OK;

=== modified file 'storage/ndb/test/ndbapi/test_event.cpp'
--- a/storage/ndb/test/ndbapi/test_event.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/test_event.cpp	2011-02-21 14:10:20 +0000
@@ -3351,14 +3351,15 @@ runBug57886_subscribe_unsunscribe(NDBT_C
 {
   Ndb* pNdb;
   Ndb_cluster_connection *pCC;
+
+  NdbDictionary::Table tab = * ctx->getTab();
+
   if (cc(&pCC, &pNdb))
   {
     // too few api slots...
     return NDBT_OK;
   }
 
-  NdbDictionary::Table tab = * ctx->getTab();
-
   while (!ctx->isTestStopped())
   {
     createEvent(pNdb, tab, false, false);

=== modified file 'storage/ndb/test/run-test/conf-dl145a.cnf'
--- a/storage/ndb/test/run-test/conf-dl145a.cnf	2011-02-15 11:41:27 +0000
+++ b/storage/ndb/test/run-test/conf-dl145a.cnf	2011-02-19 10:31:42 +0000
@@ -32,3 +32,6 @@ SharedGlobalMemory=256M
 InitialLogfileGroup=undo_buffer_size=64M;undofile01.dat:256M;undofile02.dat:128M
 InitialTablespace=datafile01.dat:128M;datafile02.dat:64M
 TwoPassInitialNodeRestartCopy=1
+
+[cluster_config.ndbd.1.2node]
+TwoPassInitialNodeRestartCopy=1

=== modified file 'storage/ndb/test/run-test/conf-ndb07.cnf'
--- a/storage/ndb/test/run-test/conf-ndb07.cnf	2011-02-15 11:41:27 +0000
+++ b/storage/ndb/test/run-test/conf-ndb07.cnf	2011-02-19 10:31:42 +0000
@@ -39,4 +39,9 @@ FileSystemPathDataFiles=/data1/autotest
 FileSystemPathUndoFiles=/data2/autotest
 InitialLogfileGroup=undo_buffer_size=64M;undofile01.dat:256M;undofile02.dat:256M
 InitialTablespace=datafile01.dat:256M;datafile02.dat:256M
+
+[cluster_config.ndbd.1.2node]
+TwoPassInitialNodeRestartCopy=1
+
+[cluster_config.ndbd.3.2node]
 TwoPassInitialNodeRestartCopy=1

=== modified file 'storage/ndb/tools/restore/consumer_restore.cpp'
--- a/storage/ndb/tools/restore/consumer_restore.cpp	2011-02-03 14:42:14 +0000
+++ b/storage/ndb/tools/restore/consumer_restore.cpp	2011-02-19 03:13:04 +0000
@@ -22,6 +22,7 @@
 #include <NdbSleep.h>
 #include <NdbTick.h>
 #include <Properties.hpp>
+#include <NdbTypesUtil.hpp>
 
 #include <ndb_internal.hpp>
 #include <ndb_logevent.h>
@@ -45,132 +46,415 @@ extern Properties g_rewrite_databases;
 
 bool BackupRestore::m_preserve_trailing_spaces = false;
 
+// ----------------------------------------------------------------------
+// conversion handlers
+// ----------------------------------------------------------------------
+
+void *
+BackupRestore::convert_bitset(const void *source,
+                              void *target,
+                              bool &truncated)
+{
+  if (!source || !target)
+    return NULL;
+
+  // shortcuts
+  const unsigned char * const s = (const unsigned char *)source;
+  char_n_padding_struct * const t = (char_n_padding_struct *)target;
+
+  // write data
+  if (t->n_new >= t->n_old)
+  {
+    // clear all bits
+    memset(t->new_row, 0, t->n_new);
+
+    memcpy(t->new_row, s, t->n_old);
+    truncated = false;
+  } else {
+    // set all bits, for parity with replication's demotion semantics
+    memset(t->new_row, 0xFF, t->n_new);
+    truncated = true;
+  }
+
+  return t->new_row;
+}
+
+template< typename S, typename T >
+void *
+BackupRestore::convert_array(const void * source,
+                             void * target,
+                             bool & truncated)
+{
+  if (!source || !target)
+    return NULL;
+
+  // shortcuts (note that all S::... and T::... are compile-time expr)
+  const unsigned char * const s = (const unsigned char *)source;
+  char_n_padding_struct * const t = (char_n_padding_struct *)target;
+  const Uint32 s_prefix_length = S::lengthPrefixSize();
+  const Uint32 t_prefix_length = T::lengthPrefixSize();
+
+  // read and adjust length
+  Uint32 length = (S::isFixedSized() ? t->n_old : S::readLengthPrefix(s));
+  const Uint32 max_length = t->n_new - t_prefix_length;
+  if (S::isFixedSized() && !m_preserve_trailing_spaces) {
+    const char s_padding_char = (S::isBinary() ? 0x00 : ' ');
+    // ignore padding chars for data copying or truncation reporting
+    while (length > 0 && s[length - 1] == s_padding_char) {
+      length--;
+    }
+  }
+  if (length <= max_length) {
+    truncated = false;
+  } else {
+    length = max_length;
+    truncated = true;
+  }
+
+  // write length prefix
+  if (!T::isFixedSized()) {
+    T::writeLengthPrefix(t->new_row, length);
+  }
+
+  // write data
+  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
+
+  // write padding
+  if (T::isFixedSized()) {
+    const char t_padding_char = (T::isBinary() ? 0x00 : ' ');
+    const Uint32 l = max_length - length;
+    memset(t->new_row + t_prefix_length + length, t_padding_char, l);
+  }
+
+  return t->new_row;
+}
+
+template< typename S, typename T >
+void *
+BackupRestore::convert_integral(const void * source,
+                                void * target,
+                                bool & truncated)
+{
+  if (!source || !target)
+    return NULL;
+
+  // read the source value
+  typename S::DomainT s;
+  S::load(&s, (char *)source);
+
+  // Note: important to correctly handle mixed signedness comparisons.
+  //
+  // The problem: A straight-forward approach to convert value 's' into
+  // type 'T' might be to check into which of these subranges 's' falls
+  //    ... < T's lower bound <= ... <= T's upper bound < ...
+  // However, this approach is _incorrect_ when applied to generic code
+  //    if (s < T::lowest()) ... else if (s > T::highest()) ... else ...
+  // since 'S' and 'T' may be types of different signedness.
+  //
+  // Under ansi (and even more K&R) C promotion rules, if 'T' is unsigned
+  // and if there's no larger signed type available, the value 's' gets
+  // promoted to unsigned; then, a negative value of 's' becomes (large)
+  // positive -- with a wrong comparison outcome.
+  //
+  // Furthermore, the code should not trigger compiler warnings for any
+  // selection of integral types 'S', 'T' ("mixed signedness comparison",
+  // "comparison of unsigned expression <0 / >=0 is always false/true").
+  //
+  // The correct approach: do lower bound comparisons on signed types and
+  // upper bound comparisons on unsigned types only; this requires casts.
+  // For the casts to be safe, compare the value against the zero literal
+  //    if (s <= 0) { check as signed } else { check as unsigned }
+  // which is a valid + nontrivial test for signed and unsigned types.
+  //
+  // This implies that correct, generic conversion code must test into
+  // which of these _four_ subranges value 's' falls
+  //    ... < T's lower bound <= ... <= 0 < ... <= T's upper bound < ...
+  // while handling 's' as signed/unsigned where less-equal/greater zero.
+  //
+  // Obviously, simplifications are possible if 'S' is unsigned or known
+  // to be a subset of 'T'.  This can be accomplished by a few additional
+  // compile-time expression tests, which allow code optimization to
+  // issue fewer checks for certain specializations of types 'S' and 'T'.
+
+  // write the target value
+  typename T::DomainT t;
+  if (s <= 0) {
+
+    // check value against lower bound as _signed_, safe since all <= 0
+    assert(S::lowest() <= 0 && T::lowest() <= 0 && s <= 0);
+    const typename S::SignedT s_l_s = S::asSigned(S::lowest());
+    const typename T::SignedT t_l_s = T::asSigned(T::lowest());
+    const typename S::SignedT s_s = S::asSigned(s);
+    if ((s_l_s < t_l_s)      // compile-time expr
+        && (s_s < t_l_s)) {  // lower bound check
+      t = T::lowest();
+      truncated = true;
+    } else {                 // within both bounds
+      t = static_cast< typename T::DomainT >(s);
+      truncated = false;
+    }
+
+  } else { // (s > 0)
+
+    // check value against upper bound as _unsigned_, safe since all > 0
+    assert(S::highest() > 0 && T::highest() > 0 && s > 0);
+    const typename S::UnsignedT s_h_u = S::asUnsigned(S::highest());
+    const typename T::UnsignedT t_h_u = T::asUnsigned(T::highest());
+    const typename S::UnsignedT s_u = S::asUnsigned(s);
+    if ((s_h_u > t_h_u)      // compile-time expr
+        && (s_u > t_h_u)) {  // upper bound check
+      t = T::highest();
+      truncated = true;
+    } else {                 // within both bounds
+      t = static_cast< typename T::DomainT >(s);
+      truncated = false;
+    }
+
+  }
+  T::store((char *)target, &t);
+
+  return target;
+}
+
+// ----------------------------------------------------------------------
+// conversion rules
+// ----------------------------------------------------------------------
+
 const PromotionRules 
 BackupRestore::m_allowed_promotion_attrs[] = {
-  // char promotions/demotions
-  {NDBCOL::Char,           NDBCOL::Char,           check_compat_sizes,     convert_char_char},
-  {NDBCOL::Char,           NDBCOL::Varchar,        check_compat_sizes,     convert_char_varchar},
-  {NDBCOL::Char,           NDBCOL::Longvarchar,    check_compat_sizes,     convert_char_longvarchar},
-  {NDBCOL::Varchar,        NDBCOL::Char,           check_compat_sizes,     convert_varchar_char},
-  {NDBCOL::Varchar,        NDBCOL::Varchar,        check_compat_sizes,     convert_var_var},
-  {NDBCOL::Varchar,        NDBCOL::Longvarchar,    check_compat_sizes,     convert_var_longvar},
-  {NDBCOL::Longvarchar,    NDBCOL::Char,           check_compat_sizes,     convert_longvarchar_char},
-  {NDBCOL::Longvarchar,    NDBCOL::Varchar,        check_compat_sizes,     convert_longvar_var},
-  {NDBCOL::Longvarchar,    NDBCOL::Longvarchar,    check_compat_sizes,     convert_longvar_longvar},
-
-  // binary promotions/demotions
-  {NDBCOL::Binary,         NDBCOL::Binary,         check_compat_sizes,     convert_binary_binary},
-  {NDBCOL::Binary,         NDBCOL::Varbinary,      check_compat_sizes,     convert_binary_varbinary},
-  {NDBCOL::Binary,         NDBCOL::Longvarbinary,  check_compat_sizes,     convert_binary_longvarbinary},
-  {NDBCOL::Varbinary,      NDBCOL::Binary,         check_compat_sizes,     convert_varbinary_binary},
-  {NDBCOL::Varbinary,      NDBCOL::Varbinary,      check_compat_sizes,     convert_var_var},
-  {NDBCOL::Varbinary,      NDBCOL::Longvarbinary,  check_compat_sizes,     convert_var_longvar},
-  {NDBCOL::Longvarbinary,  NDBCOL::Binary,         check_compat_sizes,     convert_longvarbinary_binary},
-  {NDBCOL::Longvarbinary,  NDBCOL::Varbinary,      check_compat_sizes,     convert_longvar_var},
-  {NDBCOL::Longvarbinary,  NDBCOL::Longvarbinary,  check_compat_sizes,     convert_longvar_longvar},
-
   // bitset promotions/demotions
-  {NDBCOL::Bit,            NDBCOL::Bit,            check_compat_sizes,     convert_bit_bit},
+  {NDBCOL::Bit,            NDBCOL::Bit,            check_compat_sizes,
+   convert_bitset},
+
+  // char array promotions/demotions
+  {NDBCOL::Char,           NDBCOL::Char,           check_compat_sizes,
+   convert_array< Hchar, Hchar >},
+  {NDBCOL::Char,           NDBCOL::Varchar,        check_compat_sizes,
+   convert_array< Hchar, Hvarchar >},
+  {NDBCOL::Char,           NDBCOL::Longvarchar,    check_compat_sizes,
+   convert_array< Hchar, Hlongvarchar >},
+  {NDBCOL::Varchar,        NDBCOL::Char,           check_compat_sizes,
+   convert_array< Hvarchar, Hchar >},
+  {NDBCOL::Varchar,        NDBCOL::Varchar,        check_compat_sizes,
+   convert_array< Hvarchar, Hvarchar >},
+  {NDBCOL::Varchar,        NDBCOL::Longvarchar,    check_compat_sizes,
+   convert_array< Hvarchar, Hlongvarchar >},
+  {NDBCOL::Longvarchar,    NDBCOL::Char,           check_compat_sizes,
+   convert_array< Hlongvarchar, Hchar >},
+  {NDBCOL::Longvarchar,    NDBCOL::Varchar,        check_compat_sizes,
+   convert_array< Hlongvarchar, Hvarchar >},
+  {NDBCOL::Longvarchar,    NDBCOL::Longvarchar,    check_compat_sizes,
+   convert_array< Hlongvarchar, Hlongvarchar >},
+
+  // binary array promotions/demotions
+  {NDBCOL::Binary,         NDBCOL::Binary,         check_compat_sizes,
+   convert_array< Hbinary, Hbinary >},
+  {NDBCOL::Binary,         NDBCOL::Varbinary,      check_compat_sizes,
+   convert_array< Hbinary, Hvarbinary >},
+  {NDBCOL::Binary,         NDBCOL::Longvarbinary,  check_compat_sizes,
+   convert_array< Hbinary, Hlongvarbinary >},
+  {NDBCOL::Varbinary,      NDBCOL::Binary,         check_compat_sizes,
+   convert_array< Hvarbinary, Hbinary >},
+  {NDBCOL::Varbinary,      NDBCOL::Varbinary,      check_compat_sizes,
+   convert_array< Hvarbinary, Hvarbinary >},
+  {NDBCOL::Varbinary,      NDBCOL::Longvarbinary,  check_compat_sizes,
+   convert_array< Hvarbinary, Hlongvarbinary >},
+  {NDBCOL::Longvarbinary,  NDBCOL::Binary,         check_compat_sizes,
+   convert_array< Hlongvarbinary, Hbinary >},
+  {NDBCOL::Longvarbinary,  NDBCOL::Varbinary,      check_compat_sizes,
+   convert_array< Hlongvarbinary, Hvarbinary >},
+  {NDBCOL::Longvarbinary,  NDBCOL::Longvarbinary,  check_compat_sizes,
+   convert_array< Hlongvarbinary, Hlongvarbinary >},
 
   // integral promotions
-  {NDBCOL::Tinyint,        NDBCOL::Smallint,       check_compat_promotion, convert_int8_int16},
-  {NDBCOL::Tinyint,        NDBCOL::Mediumint,      check_compat_promotion, convert_int8_int24},
-  {NDBCOL::Tinyint,        NDBCOL::Int,            check_compat_promotion, convert_int8_int32},
-  {NDBCOL::Tinyint,        NDBCOL::Bigint,         check_compat_promotion, convert_int8_int64},
-  {NDBCOL::Smallint,       NDBCOL::Mediumint,      check_compat_promotion, convert_int16_int24},
-  {NDBCOL::Smallint,       NDBCOL::Int,            check_compat_promotion, convert_int16_int32},
-  {NDBCOL::Smallint,       NDBCOL::Bigint,         check_compat_promotion, convert_int16_int64},
-  {NDBCOL::Mediumint,      NDBCOL::Int,            check_compat_promotion, convert_int24_int32},
-  {NDBCOL::Mediumint,      NDBCOL::Bigint,         check_compat_promotion, convert_int24_int64},
-  {NDBCOL::Int,            NDBCOL::Bigint,         check_compat_promotion, convert_int32_int64},
-  {NDBCOL::Tinyunsigned,   NDBCOL::Smallunsigned,  check_compat_promotion, convert_uint8_uint16},
-  {NDBCOL::Tinyunsigned,   NDBCOL::Mediumunsigned, check_compat_promotion, convert_uint8_uint24},
-  {NDBCOL::Tinyunsigned,   NDBCOL::Unsigned,       check_compat_promotion, convert_uint8_uint32},
-  {NDBCOL::Tinyunsigned,   NDBCOL::Bigunsigned,    check_compat_promotion, convert_uint8_uint64},
-  {NDBCOL::Smallunsigned,  NDBCOL::Mediumunsigned, check_compat_promotion, convert_uint16_uint24},
-  {NDBCOL::Smallunsigned,  NDBCOL::Unsigned,       check_compat_promotion, convert_uint16_uint32},
-  {NDBCOL::Smallunsigned,  NDBCOL::Bigunsigned,    check_compat_promotion, convert_uint16_uint64},
-  {NDBCOL::Mediumunsigned, NDBCOL::Unsigned,       check_compat_promotion, convert_uint24_uint32},
-  {NDBCOL::Mediumunsigned, NDBCOL::Bigunsigned,    check_compat_promotion, convert_uint24_uint64},
-  {NDBCOL::Unsigned,       NDBCOL::Bigunsigned,    check_compat_promotion, convert_uint32_uint64},
+  {NDBCOL::Tinyint,        NDBCOL::Smallint,       check_compat_promotion,
+   convert_integral< Hint8, Hint16>},
+  {NDBCOL::Tinyint,        NDBCOL::Mediumint,      check_compat_promotion,
+   convert_integral< Hint8, Hint24>},
+  {NDBCOL::Tinyint,        NDBCOL::Int,            check_compat_promotion,
+   convert_integral< Hint8, Hint32>},
+  {NDBCOL::Tinyint,        NDBCOL::Bigint,         check_compat_promotion,
+   convert_integral< Hint8, Hint64>},
+  {NDBCOL::Smallint,       NDBCOL::Mediumint,      check_compat_promotion,
+   convert_integral< Hint16, Hint24>},
+  {NDBCOL::Smallint,       NDBCOL::Int,            check_compat_promotion,
+   convert_integral< Hint16, Hint32>},
+  {NDBCOL::Smallint,       NDBCOL::Bigint,         check_compat_promotion,
+   convert_integral< Hint16, Hint64>},
+  {NDBCOL::Mediumint,      NDBCOL::Int,            check_compat_promotion,
+   convert_integral< Hint24, Hint32>},
+  {NDBCOL::Mediumint,      NDBCOL::Bigint,         check_compat_promotion,
+   convert_integral< Hint24, Hint64>},
+  {NDBCOL::Int,            NDBCOL::Bigint,         check_compat_promotion,
+   convert_integral< Hint32, Hint64>},
+  {NDBCOL::Tinyunsigned,   NDBCOL::Smallunsigned,  check_compat_promotion,
+   convert_integral< Huint8, Huint16>},
+  {NDBCOL::Tinyunsigned,   NDBCOL::Mediumunsigned, check_compat_promotion,
+   convert_integral< Huint8, Huint24>},
+  {NDBCOL::Tinyunsigned,   NDBCOL::Unsigned,       check_compat_promotion,
+   convert_integral< Huint8, Huint32>},
+  {NDBCOL::Tinyunsigned,   NDBCOL::Bigunsigned,    check_compat_promotion,
+   convert_integral< Huint8, Huint64>},
+  {NDBCOL::Smallunsigned,  NDBCOL::Mediumunsigned, check_compat_promotion,
+   convert_integral< Huint16, Huint24>},
+  {NDBCOL::Smallunsigned,  NDBCOL::Unsigned,       check_compat_promotion,
+   convert_integral< Huint16, Huint32>},
+  {NDBCOL::Smallunsigned,  NDBCOL::Bigunsigned,    check_compat_promotion,
+   convert_integral< Huint16, Huint64>},
+  {NDBCOL::Mediumunsigned, NDBCOL::Unsigned,       check_compat_promotion,
+   convert_integral< Huint24, Huint32>},
+  {NDBCOL::Mediumunsigned, NDBCOL::Bigunsigned,    check_compat_promotion,
+   convert_integral< Huint24, Huint64>},
+  {NDBCOL::Unsigned,       NDBCOL::Bigunsigned,    check_compat_promotion,
+   convert_integral< Huint32, Huint64>},
 
   // integral demotions
-  {NDBCOL::Smallint,       NDBCOL::Tinyint,        check_compat_lossy, convert_int16_int8},
-  {NDBCOL::Mediumint,      NDBCOL::Tinyint,        check_compat_lossy, convert_int24_int8},
-  {NDBCOL::Mediumint,      NDBCOL::Smallint,       check_compat_lossy, convert_int24_int16},
-  {NDBCOL::Int,            NDBCOL::Tinyint,        check_compat_lossy, convert_int32_int8},
-  {NDBCOL::Int,            NDBCOL::Smallint,       check_compat_lossy, convert_int32_int16},
-  {NDBCOL::Int,            NDBCOL::Mediumint,      check_compat_lossy, convert_int32_int24},
-  {NDBCOL::Bigint,         NDBCOL::Tinyint,        check_compat_lossy, convert_int64_int8},
-  {NDBCOL::Bigint,         NDBCOL::Smallint,       check_compat_lossy, convert_int64_int16},
-  {NDBCOL::Bigint,         NDBCOL::Mediumint,      check_compat_lossy, convert_int64_int24},
-  {NDBCOL::Bigint,         NDBCOL::Int,            check_compat_lossy, convert_int64_int32},
-  {NDBCOL::Smallunsigned,  NDBCOL::Tinyunsigned,   check_compat_lossy, convert_uint16_uint8},
-  {NDBCOL::Mediumunsigned, NDBCOL::Tinyunsigned,   check_compat_lossy, convert_uint24_uint8},
-  {NDBCOL::Mediumunsigned, NDBCOL::Smallunsigned,  check_compat_lossy, convert_uint24_uint16},
-  {NDBCOL::Unsigned,       NDBCOL::Tinyunsigned,   check_compat_lossy, convert_uint32_uint8},
-  {NDBCOL::Unsigned,       NDBCOL::Smallunsigned,  check_compat_lossy, convert_uint32_uint16},
-  {NDBCOL::Unsigned,       NDBCOL::Mediumunsigned, check_compat_lossy, convert_uint32_uint24},
-  {NDBCOL::Bigunsigned,    NDBCOL::Tinyunsigned,   check_compat_lossy, convert_uint64_uint8},
-  {NDBCOL::Bigunsigned,    NDBCOL::Smallunsigned,  check_compat_lossy, convert_uint64_uint16},
-  {NDBCOL::Bigunsigned,    NDBCOL::Mediumunsigned, check_compat_lossy, convert_uint64_uint24},
-  {NDBCOL::Bigunsigned,    NDBCOL::Unsigned,       check_compat_lossy, convert_uint64_uint32},
+  {NDBCOL::Smallint,       NDBCOL::Tinyint,        check_compat_lossy,
+   convert_integral< Hint16, Hint8>},
+  {NDBCOL::Mediumint,      NDBCOL::Tinyint,        check_compat_lossy,
+   convert_integral< Hint24, Hint8>},
+  {NDBCOL::Mediumint,      NDBCOL::Smallint,       check_compat_lossy,
+   convert_integral< Hint24, Hint16>},
+  {NDBCOL::Int,            NDBCOL::Tinyint,        check_compat_lossy,
+   convert_integral< Hint32, Hint8>},
+  {NDBCOL::Int,            NDBCOL::Smallint,       check_compat_lossy,
+   convert_integral< Hint32, Hint16>},
+  {NDBCOL::Int,            NDBCOL::Mediumint,      check_compat_lossy,
+   convert_integral< Hint32, Hint24>},
+  {NDBCOL::Bigint,         NDBCOL::Tinyint,        check_compat_lossy,
+   convert_integral< Hint64, Hint8>},
+  {NDBCOL::Bigint,         NDBCOL::Smallint,       check_compat_lossy,
+   convert_integral< Hint64, Hint16>},
+  {NDBCOL::Bigint,         NDBCOL::Mediumint,      check_compat_lossy,
+   convert_integral< Hint64, Hint24>},
+  {NDBCOL::Bigint,         NDBCOL::Int,            check_compat_lossy,
+   convert_integral< Hint64, Hint32>},
+  {NDBCOL::Smallunsigned,  NDBCOL::Tinyunsigned,   check_compat_lossy,
+   convert_integral< Huint16, Huint8>},
+  {NDBCOL::Mediumunsigned, NDBCOL::Tinyunsigned,   check_compat_lossy,
+   convert_integral< Huint24, Huint8>},
+  {NDBCOL::Mediumunsigned, NDBCOL::Smallunsigned,  check_compat_lossy,
+   convert_integral< Huint24, Huint16>},
+  {NDBCOL::Unsigned,       NDBCOL::Tinyunsigned,   check_compat_lossy,
+   convert_integral< Huint32, Huint8>},
+  {NDBCOL::Unsigned,       NDBCOL::Smallunsigned,  check_compat_lossy,
+   convert_integral< Huint32, Huint16>},
+  {NDBCOL::Unsigned,       NDBCOL::Mediumunsigned, check_compat_lossy,
+   convert_integral< Huint32, Huint24>},
+  {NDBCOL::Bigunsigned,    NDBCOL::Tinyunsigned,   check_compat_lossy,
+   convert_integral< Huint64, Huint8>},
+  {NDBCOL::Bigunsigned,    NDBCOL::Smallunsigned,  check_compat_lossy,
+   convert_integral< Huint64, Huint16>},
+  {NDBCOL::Bigunsigned,    NDBCOL::Mediumunsigned, check_compat_lossy,
+   convert_integral< Huint64, Huint24>},
+  {NDBCOL::Bigunsigned,    NDBCOL::Unsigned,       check_compat_lossy,
+   convert_integral< Huint64, Huint32>},
 
   // integral signedness conversions
-  {NDBCOL::Tinyint,        NDBCOL::Tinyunsigned,   check_compat_lossy, convert_int8_uint8},
-  {NDBCOL::Smallint,       NDBCOL::Smallunsigned,  check_compat_lossy, convert_int16_uint16},
-  {NDBCOL::Mediumint,      NDBCOL::Mediumunsigned, check_compat_lossy, convert_int24_uint24},
-  {NDBCOL::Int,            NDBCOL::Unsigned,       check_compat_lossy, convert_int32_uint32},
-  {NDBCOL::Bigint,         NDBCOL::Bigunsigned,    check_compat_lossy, convert_int64_uint64},
-  {NDBCOL::Tinyunsigned,   NDBCOL::Tinyint,        check_compat_lossy, convert_uint8_int8},
-  {NDBCOL::Smallunsigned,  NDBCOL::Smallint,       check_compat_lossy, convert_uint16_int16},
-  {NDBCOL::Mediumunsigned, NDBCOL::Mediumint,      check_compat_lossy, convert_uint24_int24},
-  {NDBCOL::Unsigned,       NDBCOL::Int,            check_compat_lossy, convert_uint32_int32},
-  {NDBCOL::Bigunsigned,    NDBCOL::Bigint,         check_compat_lossy, convert_uint64_int64},
+  {NDBCOL::Tinyint,        NDBCOL::Tinyunsigned,   check_compat_lossy,
+   convert_integral< Hint8, Huint8>},
+  {NDBCOL::Smallint,       NDBCOL::Smallunsigned,  check_compat_lossy,
+   convert_integral< Hint16, Huint16>},
+  {NDBCOL::Mediumint,      NDBCOL::Mediumunsigned, check_compat_lossy,
+   convert_integral< Hint24, Huint24>},
+  {NDBCOL::Int,            NDBCOL::Unsigned,       check_compat_lossy,
+   convert_integral< Hint32, Huint32>},
+  {NDBCOL::Bigint,         NDBCOL::Bigunsigned,    check_compat_lossy,
+   convert_integral< Hint64, Huint64>},
+  {NDBCOL::Tinyunsigned,   NDBCOL::Tinyint,        check_compat_lossy,
+   convert_integral< Huint8, Hint8>},
+  {NDBCOL::Smallunsigned,  NDBCOL::Smallint,       check_compat_lossy,
+   convert_integral< Huint16, Hint16>},
+  {NDBCOL::Mediumunsigned, NDBCOL::Mediumint,      check_compat_lossy,
+   convert_integral< Huint24, Hint24>},
+  {NDBCOL::Unsigned,       NDBCOL::Int,            check_compat_lossy,
+   convert_integral< Huint32, Hint32>},
+  {NDBCOL::Bigunsigned,    NDBCOL::Bigint,         check_compat_lossy,
+   convert_integral< Huint64, Hint64>},
 
   // integral signedness+promotion conversions
-  {NDBCOL::Tinyint,        NDBCOL::Smallunsigned,  check_compat_lossy, convert_int8_uint16},
-  {NDBCOL::Tinyint,        NDBCOL::Mediumunsigned, check_compat_lossy, convert_int8_uint24},
-  {NDBCOL::Tinyint,        NDBCOL::Unsigned,       check_compat_lossy, convert_int8_uint32},
-  {NDBCOL::Tinyint,        NDBCOL::Bigunsigned,    check_compat_lossy, convert_int8_uint64},
-  {NDBCOL::Smallint,       NDBCOL::Mediumunsigned, check_compat_lossy, convert_int16_uint24},
-  {NDBCOL::Smallint,       NDBCOL::Unsigned,       check_compat_lossy, convert_int16_uint32},
-  {NDBCOL::Smallint,       NDBCOL::Bigunsigned,    check_compat_lossy, convert_int16_uint64},
-  {NDBCOL::Mediumint,      NDBCOL::Unsigned,       check_compat_lossy, convert_int24_uint32},
-  {NDBCOL::Mediumint,      NDBCOL::Bigunsigned,    check_compat_lossy, convert_int24_uint64},
-  {NDBCOL::Int,            NDBCOL::Bigunsigned,    check_compat_lossy, convert_int32_uint64},
-  {NDBCOL::Tinyunsigned,   NDBCOL::Smallint,       check_compat_lossy, convert_uint8_int16},
-  {NDBCOL::Tinyunsigned,   NDBCOL::Mediumint,      check_compat_lossy, convert_uint8_int24},
-  {NDBCOL::Tinyunsigned,   NDBCOL::Int,            check_compat_lossy, convert_uint8_int32},
-  {NDBCOL::Tinyunsigned,   NDBCOL::Bigint,         check_compat_lossy, convert_uint8_int64},
-  {NDBCOL::Smallunsigned,  NDBCOL::Mediumint,      check_compat_lossy, convert_uint16_int24},
-  {NDBCOL::Smallunsigned,  NDBCOL::Int,            check_compat_lossy, convert_uint16_int32},
-  {NDBCOL::Smallunsigned,  NDBCOL::Bigint,         check_compat_lossy, convert_uint16_int64},
-  {NDBCOL::Mediumunsigned, NDBCOL::Int,            check_compat_lossy, convert_uint24_int32},
-  {NDBCOL::Mediumunsigned, NDBCOL::Bigint,         check_compat_lossy, convert_uint24_int64},
-  {NDBCOL::Unsigned,       NDBCOL::Bigint,         check_compat_lossy, convert_uint32_int64},
+  {NDBCOL::Tinyint,        NDBCOL::Smallunsigned,  check_compat_lossy,
+   convert_integral< Hint8, Huint16>},
+  {NDBCOL::Tinyint,        NDBCOL::Mediumunsigned, check_compat_lossy,
+   convert_integral< Hint8, Huint24>},
+  {NDBCOL::Tinyint,        NDBCOL::Unsigned,       check_compat_lossy,
+   convert_integral< Hint8, Huint32>},
+  {NDBCOL::Tinyint,        NDBCOL::Bigunsigned,    check_compat_lossy,
+   convert_integral< Hint8, Huint64>},
+  {NDBCOL::Smallint,       NDBCOL::Mediumunsigned, check_compat_lossy,
+   convert_integral< Hint16, Huint24>},
+  {NDBCOL::Smallint,       NDBCOL::Unsigned,       check_compat_lossy,
+   convert_integral< Hint16, Huint32>},
+  {NDBCOL::Smallint,       NDBCOL::Bigunsigned,    check_compat_lossy,
+   convert_integral< Hint16, Huint64>},
+  {NDBCOL::Mediumint,      NDBCOL::Unsigned,       check_compat_lossy,
+   convert_integral< Hint24, Huint32>},
+  {NDBCOL::Mediumint,      NDBCOL::Bigunsigned,    check_compat_lossy,
+   convert_integral< Hint24, Huint64>},
+  {NDBCOL::Int,            NDBCOL::Bigunsigned,    check_compat_lossy,
+   convert_integral< Hint32, Huint64>},
+  {NDBCOL::Tinyunsigned,   NDBCOL::Smallint,       check_compat_lossy,
+   convert_integral< Huint8, Hint16>},
+  {NDBCOL::Tinyunsigned,   NDBCOL::Mediumint,      check_compat_lossy,
+   convert_integral< Huint8, Hint24>},
+  {NDBCOL::Tinyunsigned,   NDBCOL::Int,            check_compat_lossy,
+   convert_integral< Huint8, Hint32>},
+  {NDBCOL::Tinyunsigned,   NDBCOL::Bigint,         check_compat_lossy,
+   convert_integral< Huint8, Hint64>},
+  {NDBCOL::Smallunsigned,  NDBCOL::Mediumint,      check_compat_lossy,
+   convert_integral< Huint16, Hint24>},
+  {NDBCOL::Smallunsigned,  NDBCOL::Int,            check_compat_lossy,
+   convert_integral< Huint16, Hint32>},
+  {NDBCOL::Smallunsigned,  NDBCOL::Bigint,         check_compat_lossy,
+   convert_integral< Huint16, Hint64>},
+  {NDBCOL::Mediumunsigned, NDBCOL::Int,            check_compat_lossy,
+   convert_integral< Huint24, Hint32>},
+  {NDBCOL::Mediumunsigned, NDBCOL::Bigint,         check_compat_lossy,
+   convert_integral< Huint24, Hint64>},
+  {NDBCOL::Unsigned,       NDBCOL::Bigint,         check_compat_lossy,
+   convert_integral< Huint32, Hint64>},
 
   // integral signedness+demotion conversions
-  {NDBCOL::Smallint,       NDBCOL::Tinyunsigned,   check_compat_lossy, convert_int16_uint8},
-  {NDBCOL::Mediumint,      NDBCOL::Tinyunsigned,   check_compat_lossy, convert_int24_uint8},
-  {NDBCOL::Mediumint,      NDBCOL::Smallunsigned,  check_compat_lossy, convert_int24_uint16},
-  {NDBCOL::Int,            NDBCOL::Tinyunsigned,   check_compat_lossy, convert_int32_uint8},
-  {NDBCOL::Int,            NDBCOL::Smallunsigned,  check_compat_lossy, convert_int32_uint16},
-  {NDBCOL::Int,            NDBCOL::Mediumunsigned, check_compat_lossy, convert_int32_uint24},
-  {NDBCOL::Bigint,         NDBCOL::Tinyunsigned,   check_compat_lossy, convert_int64_uint8},
-  {NDBCOL::Bigint,         NDBCOL::Smallunsigned,  check_compat_lossy, convert_int64_uint16},
-  {NDBCOL::Bigint,         NDBCOL::Mediumunsigned, check_compat_lossy, convert_int64_uint24},
-  {NDBCOL::Bigint,         NDBCOL::Unsigned,       check_compat_lossy, convert_int64_uint32},
-  {NDBCOL::Smallunsigned,  NDBCOL::Tinyint,        check_compat_lossy, convert_uint16_int8},
-  {NDBCOL::Mediumunsigned, NDBCOL::Tinyint,        check_compat_lossy, convert_uint24_int8},
-  {NDBCOL::Mediumunsigned, NDBCOL::Smallint,       check_compat_lossy, convert_uint24_int16},
-  {NDBCOL::Unsigned,       NDBCOL::Tinyint,        check_compat_lossy, convert_uint32_int8},
-  {NDBCOL::Unsigned,       NDBCOL::Smallint,       check_compat_lossy, convert_uint32_int16},
-  {NDBCOL::Unsigned,       NDBCOL::Mediumint,      check_compat_lossy, convert_uint32_int24},
-  {NDBCOL::Bigunsigned,    NDBCOL::Tinyint,        check_compat_lossy, convert_uint64_int8},
-  {NDBCOL::Bigunsigned,    NDBCOL::Smallint,       check_compat_lossy, convert_uint64_int16},
-  {NDBCOL::Bigunsigned,    NDBCOL::Mediumint,      check_compat_lossy, convert_uint64_int24},
-  {NDBCOL::Bigunsigned,    NDBCOL::Int,            check_compat_lossy, convert_uint64_int32},
+  {NDBCOL::Smallint,       NDBCOL::Tinyunsigned,   check_compat_lossy,
+   convert_integral< Hint16, Huint8>},
+  {NDBCOL::Mediumint,      NDBCOL::Tinyunsigned,   check_compat_lossy,
+   convert_integral< Hint24, Huint8>},
+  {NDBCOL::Mediumint,      NDBCOL::Smallunsigned,  check_compat_lossy,
+   convert_integral< Hint24, Huint16>},
+  {NDBCOL::Int,            NDBCOL::Tinyunsigned,   check_compat_lossy,
+   convert_integral< Hint32, Huint8>},
+  {NDBCOL::Int,            NDBCOL::Smallunsigned,  check_compat_lossy,
+   convert_integral< Hint32, Huint16>},
+  {NDBCOL::Int,            NDBCOL::Mediumunsigned, check_compat_lossy,
+   convert_integral< Hint32, Huint24>},
+  {NDBCOL::Bigint,         NDBCOL::Tinyunsigned,   check_compat_lossy,
+   convert_integral< Hint64, Huint8>},
+  {NDBCOL::Bigint,         NDBCOL::Smallunsigned,  check_compat_lossy,
+   convert_integral< Hint64, Huint16>},
+  {NDBCOL::Bigint,         NDBCOL::Mediumunsigned, check_compat_lossy,
+   convert_integral< Hint64, Huint24>},
+  {NDBCOL::Bigint,         NDBCOL::Unsigned,       check_compat_lossy,
+   convert_integral< Hint64, Huint32>},
+  {NDBCOL::Smallunsigned,  NDBCOL::Tinyint,        check_compat_lossy,
+   convert_integral< Huint16, Hint8>},
+  {NDBCOL::Mediumunsigned, NDBCOL::Tinyint,        check_compat_lossy,
+   convert_integral< Huint24, Hint8>},
+  {NDBCOL::Mediumunsigned, NDBCOL::Smallint,       check_compat_lossy,
+   convert_integral< Huint24, Hint16>},
+  {NDBCOL::Unsigned,       NDBCOL::Tinyint,        check_compat_lossy,
+   convert_integral< Huint32, Hint8>},
+  {NDBCOL::Unsigned,       NDBCOL::Smallint,       check_compat_lossy,
+   convert_integral< Huint32, Hint16>},
+  {NDBCOL::Unsigned,       NDBCOL::Mediumint,      check_compat_lossy,
+   convert_integral< Huint32, Hint24>},
+  {NDBCOL::Bigunsigned,    NDBCOL::Tinyint,        check_compat_lossy,
+   convert_integral< Huint64, Hint8>},
+  {NDBCOL::Bigunsigned,    NDBCOL::Smallint,       check_compat_lossy,
+   convert_integral< Huint64, Hint16>},
+  {NDBCOL::Bigunsigned,    NDBCOL::Mediumint,      check_compat_lossy,
+   convert_integral< Huint64, Hint24>},
+  {NDBCOL::Bigunsigned,    NDBCOL::Int,            check_compat_lossy,
+   convert_integral< Huint64, Hint32>},
 
   {NDBCOL::Undefined,      NDBCOL::Undefined,      NULL,                  NULL}
 };
@@ -2487,2204 +2771,135 @@ BackupRestore::check_compat_sizes(const 
 }
 
 // ----------------------------------------------------------------------
-// integral attribute promotion conversions
-// ----------------------------------------------------------------------
-
-void *
-BackupRestore::convert_int8_int16(const void *old_data,
-                                  void *parameter,
-                                  bool &truncated)
-{
-  Int8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Int16 new_data16 = old_data8;
-  truncated = false;
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int8_int24(const void *old_data,
-                                  void *parameter,
-                                  bool &truncated)
-{
-  Int8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Int32 new_data24 = old_data8;
-  truncated = false;
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int8_int32(const void *old_data,
-                                  void *parameter,
-                                  bool &truncated)
-{
-  Int8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Int32 new_data32 = old_data8;
-  truncated = false;
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int8_int64(const void *old_data,
-                                  void *parameter,
-                                  bool &truncated)
-{
-  Int8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Int64 new_data64 = old_data8;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int16_int24(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Int32 new_data24 = old_data16;
-  truncated = false;
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int16_int32(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Int32 new_data32 = old_data16;
-  truncated = false;
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int16_int64(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Int64 new_data64 = old_data16;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int24_int32(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int32 old_data24 = sint3korr((char*)old_data);
-  Int32 new_data32 = old_data24;
-  truncated = false;
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int24_int64(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int32 old_data24 = sint3korr((char*)old_data);
-  Int64 new_data64 = old_data24;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int32_int64(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Int64 new_data64 = old_data32;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint8_uint16(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Uint16 new_data16 = old_data8;
-  truncated = false;
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint8_uint24(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Uint32 new_data24 = old_data8;
-  truncated = false;
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint8_uint32(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Uint32 new_data32 = old_data8;
-  truncated = false;
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint8_uint64(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Uint64 new_data64 = old_data8;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint16_uint24(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Uint32 new_data24 = old_data16;
-  truncated = false;
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint16_uint32(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Uint32 new_data32 = old_data16;
-  truncated = false;
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint16_uint64(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Uint64 new_data64 = old_data16;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint24_uint32(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint32 old_data24 = uint3korr((char*)old_data);
-  Uint32 new_data32 = old_data24;
-  truncated = false;
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint24_uint64(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint32 old_data24 = uint3korr((char*)old_data);
-  Uint64 new_data64 = old_data24;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint32_uint64(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Uint64 new_data64 = old_data32;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-// ----------------------------------------------------------------------
-// integral attribute demotion conversions
-// (follows MySQL replication semantics truncating to nearest legal value)
+// explicit template instantiations
 // ----------------------------------------------------------------------
 
-void *
-BackupRestore::convert_int16_int8(const void *old_data,
-                                  void *parameter,
-                                  bool &truncated)
-{
-  Int16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Int8 new_data8;
-  if (old_data16 < INT_MIN8) {
-    new_data8 = (Int8)(INT_MIN8);
-    truncated = true;
-  } else if (old_data16 > INT_MAX8) {
-    new_data8 = (Int8)(INT_MAX8);
-    truncated = true;
-  } else {
-    new_data8 = (Int8)(old_data16);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int24_int8(const void *old_data,
-                                  void *parameter,
-                                  bool &truncated)
-{
-  Int32 old_data24 = sint3korr((char*)old_data);
-  Int8 new_data8;
-  if (old_data24 < INT_MIN8) {
-    new_data8 = (Int8)(INT_MIN8);
-    truncated = true;
-  } else if (old_data24 > INT_MAX8) {
-    new_data8 = (Int8)(INT_MAX8);
-    truncated = true;
-  } else {
-    new_data8 = (Int8)(old_data24);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int24_int16(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int32 old_data24 = sint3korr((char*)old_data);
-  Int16 new_data16;
-  if (old_data24 < INT_MIN16) {
-    new_data16 = (Int16)(INT_MIN16);
-    truncated = true;
-  } else if (old_data24 > INT_MAX16) {
-    new_data16 = (Int16)(INT_MAX16);
-    truncated = true;
-  } else {
-    new_data16 = (Int16)(old_data24);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int32_int8(const void *old_data,
-                                  void *parameter,
-                                  bool &truncated)
-{
-  Int32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Int8 new_data8;
-  if (old_data32 < INT_MIN8) {
-    new_data8 = (Int8)(INT_MIN8);
-    truncated = true;
-  } else if (old_data32 > INT_MAX8) {
-    new_data8 = (Int8)(INT_MAX8);
-    truncated = true;
-  } else {
-    new_data8 = (Int8)(old_data32);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int32_int16(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Int16 new_data16;
-  if (old_data32 < INT_MIN16) {
-    new_data16 = (Int16)(INT_MIN16);
-    truncated = true;
-  } else if (old_data32 > INT_MAX16) {
-    new_data16 = (Int16)(INT_MAX16);
-    truncated = true;
-  } else {
-    new_data16 = (Int16)(old_data32);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int32_int24(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Int32 new_data24;
-  if (old_data32 < INT_MIN24) {
-    new_data24 = (Int32)(INT_MIN24);
-    truncated = true;
-  } else if (old_data32 > INT_MAX24) {
-    new_data24 = (Int32)(INT_MAX24);
-    truncated = true;
-  } else {
-    new_data24 = (Int32)(old_data32);
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int64_int8(const void *old_data,
-                                  void *parameter,
-                                  bool &truncated)
-{
-  Int64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Int8 new_data8;
-  if (old_data64 < INT_MIN8) {
-    new_data8 = (Int8)(INT_MIN8);
-    truncated = true;
-  } else if (old_data64 > INT_MAX8) {
-    new_data8 = (Int8)(INT_MAX8);
-    truncated = true;
-  } else {
-    new_data8 = (Int8)(old_data64);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int64_int16(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Int16 new_data16;
-  if (old_data64 < INT_MIN16) {
-    new_data16 = (Int16)(INT_MIN16);
-    truncated = true;
-  } else if (old_data64 > INT_MAX16) {
-    new_data16 = (Int16)(INT_MAX16);
-    truncated = true;
-  } else {
-    new_data16 = (Int16)(old_data64);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int64_int24(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Int32 new_data24;
-  if (old_data64 < INT_MIN24) {
-    new_data24 = (Int32)(INT_MIN24);
-    truncated = true;
-  } else if (old_data64 > INT_MAX24) {
-    new_data24 = (Int32)(INT_MAX24);
-    truncated = true;
-  } else {
-    new_data24 = (Int32)(old_data64);
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int64_int32(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Int32 new_data32;
-  if (old_data64 < INT_MIN32) {
-    new_data32 = (Int32)(INT_MIN32);
-    truncated = true;
-  } else if (old_data64 > INT_MAX32) {
-    new_data32 = (Int32)(INT_MAX32);
-    truncated = true;
-  } else {
-    new_data32 = (Int32)(old_data64);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint16_uint8(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Uint8 new_data8;
-  if (old_data16 > UINT_MAX8) {
-    new_data8 = (Uint8)(UINT_MAX8);
-    truncated = true;
-  } else {
-    new_data8 = (Uint8)(old_data16);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
+template class Vector<NdbDictionary::Table*>;
+template class Vector<const NdbDictionary::Table*>;
+template class Vector<NdbDictionary::Tablespace*>;
+template class Vector<NdbDictionary::LogfileGroup*>;
+template class Vector<NdbDictionary::HashMap*>;
+template class Vector<NdbDictionary::Index*>;
+template class Vector<Vector<NdbDictionary::Index*> >;
 
-void *
-BackupRestore::convert_uint24_uint8(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint32 old_data24 = uint3korr((char*)old_data);
-  Uint8 new_data8;
-  if (old_data24 > UINT_MAX8) {
-    new_data8 = (Uint8)(UINT_MAX8);
-    truncated = true;
-  } else {
-    new_data8 = (Uint8)(old_data24);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint24_uint16(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint32 old_data24 = uint3korr((char*)old_data);
-  Uint16 new_data16;
-  if (old_data24 > UINT_MAX16) {
-    new_data16 = (Uint16)(UINT_MAX16);
-    truncated = true;
-  } else {
-    new_data16 = (Uint16)(old_data24);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint32_uint8(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Uint8 new_data8;
-  if (old_data32 > UINT_MAX8) {
-    new_data8 = (Uint8)(UINT_MAX8);
-    truncated = true;
-  } else {
-    new_data8 = (Uint8)(old_data32);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint32_uint16(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Uint16 new_data16;
-  if (old_data32 > UINT_MAX16) {
-    new_data16 = (Uint16)(UINT_MAX16);
-    truncated = true;
-  } else {
-    new_data16 = (Uint16)(old_data32);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint32_uint24(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Uint32 new_data24;
-  if (old_data32 > UINT_MAX24) {
-    new_data24 = (Uint32)(UINT_MAX24);
-    truncated = true;
-  } else {
-    new_data24 = (Uint32)(old_data32);
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint64_uint8(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Uint8 new_data8;
-  if (old_data64 > UINT_MAX8) {
-    new_data8 = (Uint8)(UINT_MAX8);
-    truncated = true;
-  } else {
-    new_data8 = (Uint8)(old_data64);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint64_uint16(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Uint16 new_data16;
-  if (old_data64 > UINT_MAX16) {
-    new_data16 = (Uint16)(UINT_MAX16);
-    truncated = true;
-  } else {
-    new_data16 = (Uint16)(old_data64);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint64_uint24(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Uint32 new_data24;
-  if (old_data64 > UINT_MAX24) {
-    new_data24 = (Uint32)(UINT_MAX24);
-    truncated = true;
-  } else {
-    new_data24 = (Uint32)(old_data64);
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint64_uint32(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  Uint64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Uint32 new_data32;
-  if (old_data64 > UINT_MAX32) {
-    new_data32 = (Uint32)(UINT_MAX32);
-    truncated = true;
-  } else {
-    new_data32 = (Uint32)(old_data64);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-// ----------------------------------------------------------------------
-// integral attribute signedness conversions
-// (follows MySQL replication semantics truncating to nearest legal value)
-// ----------------------------------------------------------------------
-
-void *
-BackupRestore::convert_int8_uint8(const void *old_data,
-                                  void *parameter,
-                                  bool &truncated)
-{
-  Int8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Uint8 new_data8;
-  if (old_data8 < 0) {
-    new_data8 = (Uint8)0;
-    truncated = true;
-  } else {
-    new_data8 = (Uint8)(old_data8);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int16_uint16(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Uint16 new_data16;
-  if (old_data16 < 0) {
-    new_data16 = (Uint16)0;
-    truncated = true;
-  } else {
-    new_data16 = (Uint16)(old_data16);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int24_uint24(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int32 old_data24 = sint3korr((char*)old_data);
-  Uint32 new_data24;
-  if (old_data24 < 0) {
-    new_data24 = (Uint32)0;
-    truncated = true;
-  } else {
-    new_data24 = (Uint32)(old_data24);
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int32_uint32(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Uint32 new_data32;
-  if (old_data32 < 0) {
-    new_data32 = (Uint32)0;
-    truncated = true;
-  } else {
-    new_data32 = (Uint32)(old_data32);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int64_uint64(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Uint64 new_data64;
-  if (old_data64 < 0) {
-    new_data64 = (Uint64)0;
-    truncated = true;
-  } else {
-    new_data64 = (Uint64)(old_data64);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint8_int8(const void *old_data,
-                                  void *parameter,
-                                  bool &truncated)
-{
-  Uint8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Int8 new_data8;
-  if (old_data8 > INT_MAX8) {
-    new_data8 = (Int8)(INT_MAX8);
-    truncated = true;
-  } else {
-    new_data8 = (Int8)(old_data8);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint16_int16(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Int16 new_data16;
-  if (old_data16 > INT_MAX16) {
-    new_data16 = (Int16)(INT_MAX16);
-    truncated = true;
-  } else {
-    new_data16 = (Int16)(old_data16);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint24_int24(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint32 old_data24 = uint3korr((char*)old_data);
-  Int32 new_data24 = (Int32)((old_data24 > INT_MAX24) ? INT_MAX24
-                             : old_data24);
-  if (old_data24 > INT_MAX24) {
-    new_data24 = (Int32)(INT_MAX24);
-    truncated = true;
-  } else {
-    new_data24 = (Int32)(old_data24);
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint32_int32(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Int32 new_data32;
-  if (old_data32 > INT_MAX32) {
-    new_data32 = (Int32)(INT_MAX32);
-    truncated = true;
-  } else {
-    new_data32 = (Int32)(old_data32);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint64_int64(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Int64 new_data64;
-  if (old_data64 > INT_MAX64) {
-    new_data64 = (Int64)(INT_MAX64);
-    truncated = true;
-  } else {
-    new_data64 = (Int64)(old_data64);
-    truncated = false;
-  }
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-// ----------------------------------------------------------------------
-// integral attribute signedness+promotion conversions
-// (follows MySQL replication semantics truncating to nearest legal value)
-// ----------------------------------------------------------------------
-
-void *
-BackupRestore::convert_int8_uint16(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Uint16 new_data16;
-  if (old_data8 < 0) {
-    new_data16 = (Uint16)0;
-    truncated = true;
-  } else {
-    new_data16 = (Uint16)old_data8;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int8_uint24(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Uint32 new_data24;
-  if (old_data8 < 0) {
-    new_data24 = (Uint32)0;
-    truncated = true;
-  } else {
-    new_data24 = (Uint32)old_data8;
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int8_uint32(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Uint32 new_data32;
-  if (old_data8 < 0) {
-    new_data32 = (Uint32)0;
-    truncated = true;
-  } else {
-    new_data32 = (Uint32)old_data8;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int8_uint64(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Uint64 new_data64;
-  if (old_data8 < 0) {
-    new_data64 = (Uint64)0;
-    truncated = true;
-  } else {
-    new_data64 = (Uint64)old_data8;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int16_uint24(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Uint32 new_data24;
-  if (old_data16 < 0) {
-    new_data24 = (Uint32)0;
-    truncated = true;
-  } else {
-    new_data24 = (Uint32)old_data16;
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int16_uint32(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Uint32 new_data32;
-  if (old_data16 < 0) {
-    new_data32 = (Uint32)0;
-    truncated = true;
-  } else {
-    new_data32 = (Uint32)old_data16;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int16_uint64(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Uint64 new_data64;
-  if (old_data16 < 0) {
-    new_data64 = (Uint64)0;
-    truncated = true;
-  } else {
-    new_data64 = (Uint64)old_data16;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int24_uint32(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int32 old_data24 = sint3korr((char*)old_data);
-  Uint32 new_data32;
-  if (old_data24 < 0) {
-    new_data32 = (Uint32)0;
-    truncated = true;
-  } else {
-    new_data32 = (Uint32)old_data24;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int24_uint64(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int32 old_data24 = sint3korr((char*)old_data);
-  Uint64 new_data64;
-  if (old_data24 < 0) {
-    new_data64 = (Uint64)0;
-    truncated = true;
-  } else {
-    new_data64 = (Uint64)old_data24;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int32_uint64(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Uint64 new_data64;
-  if (old_data32 < 0) {
-    new_data64 = (Uint64)0;
-    truncated = true;
-  } else {
-    new_data64 = (Uint64)old_data32;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint8_int16(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Uint8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Int16 new_data16 = old_data8;
-  truncated = false;
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint8_int24(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Uint8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Int32 new_data24 = old_data8;
-  truncated = false;
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint8_int32(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Uint8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Int32 new_data32 = old_data8;
-  truncated = false;
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint8_int64(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Uint8 old_data8;
-  memcpy(&old_data8, old_data, 1);
-  Int64 new_data64 = old_data8;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint16_int24(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Int32 new_data24 = old_data16;
-  truncated = false;
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint16_int32(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Int32 new_data32 = old_data16;
-  truncated = false;
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint16_int64(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Int64 new_data64 = old_data16;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint24_int32(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint32 old_data24 = uint3korr((char*)old_data);
-  Int32 new_data32 = old_data24;
-  truncated = false;
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint24_int64(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint32 old_data24 = uint3korr((char*)old_data);
-  Int64 new_data64 = old_data24;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint32_int64(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Int64 new_data64 = old_data32;
-  truncated = false;
-  memcpy(parameter, &new_data64, 8);
-
-  return parameter;
-}
-
-// ----------------------------------------------------------------------
-// integral attribute signedness+demotion conversions
-// (follows MySQL replication semantics truncating to nearest legal value)
-// ----------------------------------------------------------------------
-
-void *
-BackupRestore::convert_int16_uint8(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Uint8 new_data8;
-  if (old_data16 < 0) {
-    new_data8 = (Uint8)0;
-    truncated = true;
-  } else if (old_data16 > UINT_MAX8) {
-    new_data8 = (Uint8)UINT_MAX8;
-    truncated = true;
-  } else {
-    new_data8 = (Uint8)old_data16;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int24_uint8(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int32 old_data24 = sint3korr((char*)old_data);
-  Uint8 new_data8;
-  if (old_data24 < 0) {
-    new_data8 = (Uint8)0;
-    truncated = true;
-  } else if (old_data24 > UINT_MAX8) {
-    new_data8 = (Uint8)UINT_MAX8;
-    truncated = true;
-  } else {
-    new_data8 = (Uint8)old_data24;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int24_uint16(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int32 old_data24 = sint3korr((char*)old_data);
-  Uint16 new_data16;
-  if (old_data24 < 0) {
-    new_data16 = (Uint16)0;
-    truncated = true;
-  } else if (old_data24 > UINT_MAX16) {
-    new_data16 = (Uint16)UINT_MAX16;
-    truncated = true;
-  } else {
-    new_data16 = (Uint16)old_data24;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int32_uint8(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Uint8 new_data8;
-  if (old_data32 < 0) {
-    new_data8 = (Uint8)0;
-    truncated = true;
-  } else if (old_data32 > UINT_MAX8) {
-    new_data8 = (Uint8)UINT_MAX8;
-    truncated = true;
-  } else {
-    new_data8 = (Uint8)old_data32;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int32_uint16(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Uint16 new_data16;
-  if (old_data32 < 0) {
-    new_data16 = (Uint16)0;
-    truncated = true;
-  } else if (old_data32 > UINT_MAX16) {
-    new_data16 = (Uint16)UINT_MAX16;
-    truncated = true;
-  } else {
-    new_data16 = (Uint16)old_data32;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int32_uint24(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Uint32 new_data24;
-  if (old_data32 < 0) {
-    new_data24 = (Uint32)0;
-    truncated = true;
-  } else if (old_data32 > UINT_MAX24) {
-    new_data24 = (Uint32)UINT_MAX24;
-    truncated = true;
-  } else {
-    new_data24 = (Uint32)old_data32;
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int64_uint8(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Int64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Uint8 new_data8;
-  if (old_data64 < 0) {
-    new_data8 = (Uint8)0;
-    truncated = true;
-  } else if (old_data64 > UINT_MAX8) {
-    new_data8 = (Uint8)UINT_MAX8;
-    truncated = true;
-  } else {
-    new_data8 = (Uint8)old_data64;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int64_uint16(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Uint16 new_data16;
-  if (old_data64 < 0) {
-    new_data16 = (Uint16)0;
-    truncated = true;
-  } else if (old_data64 > UINT_MAX16) {
-    new_data16 = (Uint16)UINT_MAX16;
-    truncated = true;
-  } else {
-    new_data16 = (Uint16)old_data64;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int64_uint24(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Uint32 new_data24;
-  if (old_data64 < 0) {
-    new_data24 = (Uint32)0;
-    truncated = true;
-  } else if (old_data64 > UINT_MAX24) {
-    new_data24 = (Uint32)UINT_MAX24;
-    truncated = true;
-  } else {
-    new_data24 = (Uint32)old_data64;
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_int64_uint32(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Int64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Uint32 new_data32;
-  if (old_data64 < 0) {
-    new_data32 = (Uint32)0;
-    truncated = true;
-  } else if (old_data64 > UINT_MAX32) {
-    new_data32 = (Uint32)UINT_MAX32;
-    truncated = true;
-  } else {
-    new_data32 = (Uint32)old_data64;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint16_int8(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Uint16 old_data16;
-  memcpy(&old_data16, old_data, 2);
-  Int8 new_data8;
-  if (old_data16 > INT_MAX8) {
-    new_data8 = (Int8)INT_MAX8;
-    truncated = true;
-  } else {
-    new_data8 = (Int8)old_data16;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint24_int8(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Uint32 old_data24 = uint3korr((char*)old_data);
-  Int8 new_data8;
-  if (old_data24 > INT_MAX8) {
-    new_data8 = (Int8)INT_MAX8;
-    truncated = true;
-  } else {
-    new_data8 = (Int8)old_data24;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint24_int16(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint32 old_data24 = uint3korr((char*)old_data);
-  Int16 new_data16;
-  if (old_data24 > INT_MAX16) {
-    new_data16 = (Int16)INT_MAX16;
-    truncated = true;
-  } else {
-    new_data16 = (Int16)old_data24;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint32_int8(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Uint32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Int8 new_data8;
-  if (old_data32 > INT_MAX8) {
-    new_data8 = (Int8)INT_MAX8;
-    truncated = true;
-  } else {
-    new_data8 = (Int8)old_data32;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint32_int16(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Int16 new_data16;
-  if (old_data32 > INT_MAX16) {
-    new_data16 = (Int16)INT_MAX16;
-    truncated = true;
-  } else {
-    new_data16 = (Int16)old_data32;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint32_int24(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint32 old_data32;
-  memcpy(&old_data32, old_data, 4);
-  Int32 new_data24;
-  if (old_data32 > INT_MAX24) {
-    new_data24 = (Int32)INT_MAX24;
-    truncated = true;
-  } else {
-    new_data24 = (Int32)old_data32;
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint64_int8(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  Uint64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Int8 new_data8;
-  if (old_data64 > INT_MAX8) {
-    new_data8 = (Int8)INT_MAX8;
-    truncated = true;
-  } else {
-    new_data8 = (Int8)old_data64;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data8, 1);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint64_int16(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Int16 new_data16;
-  if (old_data64 > INT_MAX16) {
-    new_data16 = (Int16)INT_MAX16;
-    truncated = true;
-  } else {
-    new_data16 = (Int16)old_data64;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data16, 2);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint64_int24(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Int32 new_data24;
-  if (old_data64 > INT_MAX24) {
-    new_data24 = (Int32)INT_MAX24;
-    truncated = true;
-  } else {
-    new_data24 = (Int32)old_data64;
-    truncated = false;
-  }
-  int3store((char*)parameter, new_data24);
-
-  return parameter;
-}
-
-void *
-BackupRestore::convert_uint64_int32(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  Uint64 old_data64;
-  memcpy(&old_data64, old_data, 8);
-  Int32 new_data32;
-  if (old_data64 > INT_MAX32) {
-    new_data32 = (Int32)INT_MAX32;
-    truncated = true;
-  } else {
-    new_data32 = (Int32)old_data64;
-    truncated = false;
-  }
-  memcpy(parameter, &new_data32, 4);
-
-  return parameter;
-}
-
-// ----------------------------------------------------------------------
-// attribute promotion/demotion conversions
-// ----------------------------------------------------------------------
-
-void *
-BackupRestore::convert_bit_bit(const void *old_data,
-                               void *parameter,
-                               bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const unsigned char * const s = (const unsigned char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-
-  // write data
-  if (t->n_new >= t->n_old)
-  {
-    // clear all bits
-    memset(t->new_row, 0, t->n_new);
-
-    memcpy(t->new_row, s, t->n_old);
-    truncated = false;
-  } else {
-    // set all bits, for parity with replication's demotion semantics
-    memset(t->new_row, 0xFF, t->n_new);
-    truncated = true;
-  }
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_char_char(const void *old_data,
-                                 void *parameter,
-                                 bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const char * const s = (const char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 0;
-  const Uint32 t_prefix_length = 0;
-
-  // read and adjust length
-  Uint32 length = t->n_old;
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (!m_preserve_trailing_spaces) {
-    // ignore padding chars for data copying or truncation reporting
-    while (length > 0 && s[length - 1] == ' ')
-      length--;
-  }
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write data and padding
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-  const Uint32 l = max_length - length;
-  memset(t->new_row + t_prefix_length + length, ' ', l);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_binary_binary(const void *old_data,
-                                     void *parameter,
-                                     bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const char * const s = (const char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 0;
-  const Uint32 t_prefix_length = 0;
-
-  // read and adjust length
-  Uint32 length = t->n_old;
-  if (!m_preserve_trailing_spaces) {
-    // ignore padding chars for data copying or truncation reporting
-    while (length > 0 && s[length - 1] == 0x00)
-      length--;
-  }
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write data and padding
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-  const Uint32 l = max_length - length;
-  memset(t->new_row + t_prefix_length + length, 0x00, l);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_char_varchar(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const char * const s = (const char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 0;
-  const Uint32 t_prefix_length = 1;
-
-  // read and adjust length
-  Uint32 length = t->n_old;
-  if (!m_preserve_trailing_spaces) {
-    // ignore padding chars for data copying or truncation reporting
-    while (length > 0 && s[length - 1] == ' ')
-      length--;
-  }
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write length prefix and data
-  t->new_row[0] = length & 0x000000FF;
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_varchar_char(const void *old_data,
-                                    void *parameter,
-                                    bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const unsigned char * const s = (const unsigned char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 1;
-  const Uint32 t_prefix_length = 0;
-
-  // read and adjust length
-  Uint32 length = s[0];
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write data and padding
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-  const Uint32 l = max_length - length;
-  memset(t->new_row + t_prefix_length + length, ' ', l);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_char_longvarchar(const void *old_data,
-                                        void *parameter,
-                                        bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const char * const s = (const char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 0;
-  const Uint32 t_prefix_length = 2;
-
-  // read and adjust length
-  Uint32 length = t->n_old;
-  if (!m_preserve_trailing_spaces) {
-    // ignore padding chars for data copying or truncation reporting
-    while (length > 0 && s[length - 1] == ' ')
-      length--;
-  }
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write length prefix and data
-  t->new_row[0] = length & 0x000000FF;
-  t->new_row[1] = (length & 0x0000FF00) >> 8;
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_longvarchar_char(const void *old_data,
-                                        void *parameter,
-                                        bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const unsigned char * const s = (const unsigned char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 2;
-  const Uint32 t_prefix_length = 0;
-
-  // read and adjust length
-  Uint32 length = s[0] + (s[1] << 8);
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write data and padding
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-  const Uint32 l = max_length - length;
-  memset(t->new_row + t_prefix_length + length, ' ', l);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_binary_varbinary(const void *old_data,
-                                        void *parameter,
-                                        bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const char * const s = (const char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 0;
-  const Uint32 t_prefix_length = 1;
-
-  // read and adjust length
-  Uint32 length = t->n_old;
-  if (!m_preserve_trailing_spaces) {
-    // ignore padding chars for data copying or truncation reporting
-    while (length > 0 && s[length - 1] == 0x00)
-      length--;
-  }
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write length prefix and data
-  t->new_row[0] = length & 0x000000FF;
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_varbinary_binary(const void *old_data,
-                                        void *parameter,
-                                        bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const unsigned char * const s = (const unsigned char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 1;
-  const Uint32 t_prefix_length = 0;
-
-  // read and adjust length
-  Uint32 length = s[0];
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write data and padding
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-  const Uint32 l = max_length - length;
-  memset(t->new_row + t_prefix_length + length, 0x00, l);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_binary_longvarbinary(const void *old_data,
-                                            void *parameter,
-                                            bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const char * const s = (const char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 0;
-  const Uint32 t_prefix_length = 2;
-
-  // read and adjust length
-  Uint32 length = t->n_old;
-  if (!m_preserve_trailing_spaces) {
-    // ignore padding chars for data copying or truncation reporting
-    while (length > 0 && s[length - 1] == 0x00)
-      length--;
-  }
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write length prefix and data
-  t->new_row[0] = length & 0x000000FF;
-  t->new_row[1] = (length & 0x0000FF00) >> 8;
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_longvarbinary_binary(const void *old_data,
-                                            void *parameter,
-                                            bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const unsigned char * const s = (const unsigned char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 2;
-  const Uint32 t_prefix_length = 0;
-
-  // read and adjust length
-  Uint32 length = s[0] + (s[1] << 8);
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write data and padding
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-  const Uint32 l = max_length - length;
-  memset(t->new_row + t_prefix_length + length, 0x00, l);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_var_var(const void *old_data,
-                               void *parameter,
-                               bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const unsigned char * const s = (const unsigned char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 1;
-  const Uint32 t_prefix_length = 1;
-
-  // read and adjust length
-  Uint32 length = s[0];
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write length prefix and data
-  t->new_row[0] = length & 0x000000FF;
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_var_longvar(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const unsigned char * const s = (const unsigned char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 1;
-  const Uint32 t_prefix_length = 2;
-
-  // read and adjust length
-  Uint32 length = s[0];
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write length prefix and data
-  t->new_row[0] = length & 0x000000FF;
-  t->new_row[1] = (length & 0x0000FF00) >> 8;
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_longvar_var(const void *old_data,
-                                   void *parameter,
-                                   bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const unsigned char * const s = (const unsigned char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 2;
-  const Uint32 t_prefix_length = 1;
-
-  // read and adjust length
-  Uint32 length = s[0] + (s[1] << 8);
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write length prefix and data
-  t->new_row[0] = length & 0x000000FF;
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-
-  return t->new_row;
-}
-
-void *
-BackupRestore::convert_longvar_longvar(const void *old_data,
-                                       void *parameter,
-                                       bool &truncated)
-{
-  if (!old_data || !parameter)
-    return NULL;
-
-  // shortcuts
-  const unsigned char * const s = (const unsigned char *)old_data;
-  char_n_padding_struct * const t = (char_n_padding_struct *)parameter;
-  const Uint32 s_prefix_length = 2;
-  const Uint32 t_prefix_length = 2;
-
-  // read and adjust length
-  Uint32 length = s[0] + (s[1] << 8);
-  const Uint32 max_length = t->n_new - t_prefix_length;
-  if (length <= max_length) {
-    truncated = false;
-  } else {
-    length = max_length;
-    truncated = true;
-  }
-
-  // write length prefix and data
-  t->new_row[0] = length & 0x000000FF;
-  t->new_row[1] = (length & 0x0000FF00) >> 8;
-  memcpy(t->new_row + t_prefix_length, s + s_prefix_length, length);
-
-  return t->new_row;
-}
-
-template class Vector<NdbDictionary::Table*>;
-template class Vector<const NdbDictionary::Table*>;
-template class Vector<NdbDictionary::Tablespace*>;
-template class Vector<NdbDictionary::LogfileGroup*>;
-template class Vector<NdbDictionary::HashMap*>;
-template class Vector<NdbDictionary::Index*>;
-template class Vector<Vector<NdbDictionary::Index*> >;
+// char array promotions/demotions
+template void * BackupRestore::convert_array< Hchar, Hchar >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hchar, Hvarchar >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hchar, Hlongvarchar >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hvarchar, Hchar >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hvarchar, Hvarchar >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hvarchar, Hlongvarchar >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hlongvarchar, Hchar >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hlongvarchar, Hvarchar >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hlongvarchar, Hlongvarchar >(const void *, void *, bool &);
+
+// binary array promotions/demotions
+template void * BackupRestore::convert_array< Hbinary, Hbinary >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hbinary, Hvarbinary >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hbinary, Hlongvarbinary >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hvarbinary, Hbinary >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hvarbinary, Hvarbinary >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hvarbinary, Hlongvarbinary >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hlongvarbinary, Hbinary >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hlongvarbinary, Hvarbinary >(const void *, void *, bool &);
+template void * BackupRestore::convert_array< Hlongvarbinary, Hlongvarbinary >(const void *, void *, bool &);
+
+// integral promotions
+template void * BackupRestore::convert_integral<Hint8, Hint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint8, Hint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint8, Hint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint8, Hint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint16, Hint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint16, Hint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint16, Hint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint24, Hint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint24, Hint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint32, Hint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint8, Huint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint8, Huint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint8, Huint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint8, Huint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint16, Huint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint16, Huint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint16, Huint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint24, Huint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint24, Huint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint32, Huint64>(const void *, void *, bool &);
+
+// integral demotions
+template void * BackupRestore::convert_integral<Hint16, Hint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint24, Hint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint24, Hint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint32, Hint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint32, Hint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint32, Hint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint64, Hint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint64, Hint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint64, Hint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint64, Hint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint16, Huint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint24, Huint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint24, Huint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint32, Huint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint32, Huint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint32, Huint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint64, Huint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint64, Huint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint64, Huint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint64, Huint32>(const void *, void *, bool &);
+
+// integral signedness BackupRestore::conversions
+template void * BackupRestore::convert_integral<Hint8, Huint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint16, Huint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint24, Huint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint32, Huint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint64, Huint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint8, Hint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint16, Hint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint24, Hint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint32, Hint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint64, Hint64>(const void *, void *, bool &);
+
+// integral signedness+promotion BackupRestore::conversions
+template void * BackupRestore::convert_integral<Hint8, Huint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint8, Huint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint8, Huint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint8, Huint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint16, Huint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint16, Huint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint16, Huint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint24, Huint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint24, Huint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint32, Huint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint8, Hint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint8, Hint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint8, Hint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint8, Hint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint16, Hint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint16, Hint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint16, Hint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint24, Hint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint24, Hint64>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint32, Hint64>(const void *, void *, bool &);
+
+// integral signedness+demotion BackupRestore::conversions
+template void * BackupRestore::convert_integral<Hint16, Huint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint24, Huint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint24, Huint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint32, Huint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint32, Huint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint32, Huint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint64, Huint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint64, Huint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint64, Huint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Hint64, Huint32>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint16, Hint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint24, Hint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint24, Hint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint32, Hint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint32, Hint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint32, Hint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint64, Hint8>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint64, Hint16>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint64, Hint24>(const void *, void *, bool &);
+template void * BackupRestore::convert_integral<Huint64, Hint32>(const void *, void *, bool &);

=== modified file 'storage/ndb/tools/restore/consumer_restore.hpp'
--- a/storage/ndb/tools/restore/consumer_restore.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/tools/restore/consumer_restore.hpp	2011-02-19 03:13:04 +0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+   Copyright (c) 2004, 2011, 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
@@ -138,227 +138,20 @@ public:
   static AttrConvType check_compat_lossy(const NDBCOL &old_col,
                                          const NDBCOL &new_col);
 
-  // integral attribute promotion conversions
-  static void* convert_int8_int16(const void *old_data,
-                                  void *parameter, bool &truncated);
-  static void* convert_int8_int24(const void *old_data,
-                                  void *parameter, bool &truncated);
-  static void* convert_int8_int32(const void *old_data,
-                                  void *parameter, bool &truncated);
-  static void* convert_int8_int64(const void *old_data,
-                                  void *parameter, bool &truncated);
-  static void* convert_int16_int24(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int16_int32(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int16_int64(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int24_int32(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int24_int64(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int32_int64(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_uint8_uint16(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint8_uint24(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint8_uint32(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint8_uint64(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint16_uint24(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_uint16_uint32(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_uint16_uint64(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_uint24_uint32(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_uint24_uint64(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_uint32_uint64(const void *old_data,
-                                     void *parameter, bool &truncated);
-
-  // integral attribute demotion conversions
-  static void* convert_int16_int8(const void *old_data,
-                                  void *parameter, bool &truncated);
-  static void* convert_int24_int8(const void *old_data,
-                                  void *parameter, bool &truncated);
-  static void* convert_int24_int16(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int32_int8(const void *old_data,
-                                  void *parameter, bool &truncated);
-  static void* convert_int32_int16(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int32_int24(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int64_int8(const void *old_data,
-                                  void *parameter, bool &truncated);
-  static void* convert_int64_int16(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int64_int24(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int64_int32(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_uint16_uint8(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint24_uint8(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint24_uint16(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_uint32_uint8(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint32_uint16(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_uint32_uint24(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_uint64_uint8(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint64_uint16(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_uint64_uint24(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_uint64_uint32(const void *old_data,
-                                     void *parameter, bool &truncated);
-
-  // integral attribute signedness conversions
-  static void* convert_int8_uint8(const void *old_data,
-                                  void *parameter, bool &truncated);
-  static void* convert_int16_uint16(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int24_uint24(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int32_uint32(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int64_uint64(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint8_int8(const void *old_data,
-                                  void *parameter, bool &truncated);
-  static void* convert_uint16_int16(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint24_int24(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint32_int32(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint64_int64(const void *old_data,
-                                    void *parameter, bool &truncated);
-
-  // integral attribute signedness+promotion conversions
-  static void* convert_int8_uint16(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int8_uint24(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int8_uint32(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int8_uint64(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int16_uint24(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int16_uint32(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int16_uint64(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int24_uint32(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int24_uint64(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int32_uint64(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint8_int16(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_uint8_int24(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_uint8_int32(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_uint8_int64(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_uint16_int24(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint16_int32(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint16_int64(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint24_int32(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint24_int64(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint32_int64(const void *old_data,
-                                    void *parameter, bool &truncated);
-
-  // integral attribute signedness+demotion conversions
-  static void* convert_int16_uint8(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int24_uint8(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int24_uint16(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int32_uint8(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int32_uint16(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int32_uint24(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int64_uint8(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_int64_uint16(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int64_uint24(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_int64_uint32(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint16_int8(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_uint24_int8(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_uint24_int16(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint32_int8(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_uint32_int16(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint32_int24(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint64_int8(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_uint64_int16(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint64_int24(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_uint64_int32(const void *old_data,
-                                    void *parameter, bool &truncated);
-
-  // char/binary promotion/demotion conversions
-  static void* convert_bit_bit(const void *old_data,
-                               void *parameter, bool &truncated);
-  static void* convert_char_char(const void *old_data,
-                                 void *parameter, bool &truncated);
-  static void* convert_binary_binary(const void *old_data,
-                                     void *parameter, bool &truncated);
-  static void* convert_char_varchar(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_varchar_char(const void *old_data,
-                                    void *parameter, bool &truncated);
-  static void* convert_char_longvarchar(const void *old_data,
-                                        void *parameter, bool &truncated);
-  static void* convert_longvarchar_char(const void *old_data,
-                                        void *parameter, bool &truncated);
-  static void* convert_binary_varbinary(const void *old_data,
-                                        void *parameter, bool &truncated);
-  static void* convert_varbinary_binary(const void *old_data,
-                                        void *parameter, bool &truncated);
-  static void* convert_binary_longvarbinary(const void *old_data,
-                                            void *parameter, bool &truncated);
-  static void* convert_longvarbinary_binary(const void *old_data,
-                                            void *parameter, bool &truncated);
-  static void* convert_var_var(const void *old_data,
-                               void *parameter, bool &truncated);
-  static void* convert_var_longvar(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_longvar_var(const void *old_data,
-                                   void *parameter, bool &truncated);
-  static void* convert_longvar_longvar(const void *old_data,
-                                       void *parameter, bool &truncated);
+  // bitset conversion handler
+  static void*
+  convert_bitset(const void * source, void * target, bool &truncated);
+
+  // char/binary array conversion handler
+  template< typename S, typename T >
+  static void *
+  convert_array(const void * source, void * target, bool & truncated);
+
+  // integral type conversion handler
+  // (follows MySQL replication semantics truncating to nearest legal value)
+  template< typename T, typename S >
+  static void *
+  convert_integral(const void * source, void * target, bool & truncated);
 
   // returns the handler function checking type conversion compatibility
   AttrCheckCompatFunc 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch(ole.john.aske:3439 to 3440) Ole John Aske23 Feb