List:Commits« Previous MessageNext Message »
From:Martin Zaun Date:February 22 2011 9:54pm
Subject:bzr push into mysql-5.1-telco-7.1 branch (martin.zaun:4105 to 4107)
View as plain text  
 4107 Martin Zaun	2011-02-22 [merge]
      merge from 7.0 to 7.1

    added:
      mysql-test/include/execute_with_statistics.inc
    modified:
      mysql-test/r/greedy_optimizer.result
      mysql-test/t/greedy_optimizer.test
      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/testMgm.cpp
 4106 Martin Zaun	2011-02-22 [merge]
      merge from ndb-7.1-ndb_restore-test-cleanup to ndb-7.1

    added:
      mysql-test/suite/ndb/r/ndb_restore_schema_tolerance.result
      mysql-test/suite/ndb/t/ndb_restore_schema_tolerance.test
    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:
      mysql-test/suite/ndb/t/ndb_restore_print.test
      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
 4105 Craig L Russell	2011-02-22
      Clean up tables after clusterj tests.

    modified:
      mysql-test/suite/ndb/t/clusterj.test
=== 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%';

=== 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-22 18:43:37 +0000
@@ -198,7 +198,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
@@ -207,10 +207,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
@@ -219,10 +230,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	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using join buffer
@@ -231,10 +253,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	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;
+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
@@ -243,10 +276,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	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;
+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
@@ -255,10 +299,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	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;
+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
@@ -267,14 +319,22 @@ 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	289.418727
+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 +343,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
@@ -295,10 +366,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	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
@@ -307,10 +389,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;
+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 +412,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;
+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 +435,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;
+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,14 +455,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
+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
@@ -359,10 +479,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
@@ -371,10 +502,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	t2	ALL	NULL	NULL	NULL	NULL	6	
 1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	12	Using join buffer
@@ -383,10 +525,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	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;
+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
@@ -395,10 +548,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	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;
+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
@@ -407,10 +571,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	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;
+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
@@ -419,9 +591,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	289.418727
+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 +610,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 +619,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
@@ -451,10 +642,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
@@ -463,10 +665,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
@@ -475,10 +688,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
@@ -487,10 +711,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
@@ -499,14 +731,22 @@ 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_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 +755,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
@@ -527,10 +778,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	t3	eq_ref	PRIMARY	PRIMARY	4	test.t1.c12	1	Using index
@@ -539,10 +801,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;
+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 +824,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;
+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 +847,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;
+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 +867,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
+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 +891,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
@@ -603,10 +914,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
@@ -615,10 +937,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
@@ -627,10 +960,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
@@ -639,10 +983,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
@@ -651,9 +1003,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
 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);

=== 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-22 14:49:03 +0000
@@ -196,58 +196,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 +291,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;
 

=== 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-02-22 05:36:41 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigManager.cpp	2011-02-22 21:29:46 +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,7 +1340,7 @@ ConfigManager::execCONFIG_CHECK_REQ(Sign
     other_checksum = checksum;
   }
 
-  if (m_prepared_config)
+  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). "
@@ -1338,6 +1352,19 @@ ConfigManager::execCONFIG_CHECK_REQ(Sign
     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, "
@@ -1812,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;
 
@@ -1834,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-02-01 08:52:56 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigManager.hpp	2011-02-22 21:29:46 +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/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;
 }
 


Attachment: [text/bzr-bundle] bzr/martin.zaun@oracle.com-20110222212946-g94nuunp9x7a5tza.bundle
Thread
bzr push into mysql-5.1-telco-7.1 branch (martin.zaun:4105 to 4107) Martin Zaun22 Feb