[Commits] e2eb1d7: cleunup

Olaksandr Byslkin sanja at mariadb.com
Wed May 4 20:45:38 EEST 2016


revision-id: e2eb1d7e2c7f621bcb35da521a5fed5d2010ac16 (mariadb-10.1.11-19-ge2eb1d7)
parent(s): b1ddc7d546e6b147838af72dd03f86a8b272fdf0
committer: Oleksandr Byelkin
timestamp: 2016-05-04 19:45:38 +0200
message:

cleunup

---
 mysql-test/r/subselect.result                 | 8 +++-----
 mysql-test/r/subselect_no_exists_to_in.result | 8 +++-----
 mysql-test/r/subselect_no_mat.result          | 8 +++-----
 mysql-test/r/subselect_no_opts.result         | 8 +++-----
 mysql-test/r/subselect_no_scache.result       | 8 +++-----
 mysql-test/r/subselect_no_semijoin.result     | 8 +++-----
 sql/item_subselect.cc                         | 2 +-
 sql/sql_select.h                              | 2 --
 8 files changed, 19 insertions(+), 33 deletions(-)

diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 90d8f9f..952cb86 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -6805,9 +6805,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR alias1.a = 'y'
 HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
-1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible HAVING
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a ) AS field
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
@@ -6819,8 +6817,8 @@ SELECT MAX( alias2.a )
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	alias1	index	a	a	19	NULL	11	Using where; Using index
+1	PRIMARY	alias2	ref	a	a	19	test.alias1.a	2	Using index
 1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a )
diff --git a/mysql-test/r/subselect_no_exists_to_in.result b/mysql-test/r/subselect_no_exists_to_in.result
index dcceb61..196a171 100644
--- a/mysql-test/r/subselect_no_exists_to_in.result
+++ b/mysql-test/r/subselect_no_exists_to_in.result
@@ -6805,9 +6805,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR alias1.a = 'y'
 HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
-1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible HAVING
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a ) AS field
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
@@ -6819,8 +6817,8 @@ SELECT MAX( alias2.a )
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	alias1	index	a	a	19	NULL	11	Using where; Using index
+1	PRIMARY	alias2	ref	a	a	19	test.alias1.a	2	Using index
 1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a )
diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result
index 4e9f750..7bbed64 100644
--- a/mysql-test/r/subselect_no_mat.result
+++ b/mysql-test/r/subselect_no_mat.result
@@ -6800,9 +6800,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR alias1.a = 'y'
 HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
-1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible HAVING
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a ) AS field
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
@@ -6814,8 +6812,8 @@ SELECT MAX( alias2.a )
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	alias1	index	a	a	19	NULL	11	Using where; Using index
+1	PRIMARY	alias2	ref	a	a	19	test.alias1.a	2	Using index
 1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a )
diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result
index 4b09fd2..04b97f6 100644
--- a/mysql-test/r/subselect_no_opts.result
+++ b/mysql-test/r/subselect_no_opts.result
@@ -6796,9 +6796,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR alias1.a = 'y'
 HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
-1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible HAVING
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a ) AS field
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
@@ -6810,8 +6808,8 @@ SELECT MAX( alias2.a )
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	alias1	index	a	a	19	NULL	11	Using where; Using index
+1	PRIMARY	alias2	ref	a	a	19	test.alias1.a	2	Using index
 1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a )
diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result
index 322e64d..59d384c 100644
--- a/mysql-test/r/subselect_no_scache.result
+++ b/mysql-test/r/subselect_no_scache.result
@@ -6811,9 +6811,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR alias1.a = 'y'
 HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
-1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible HAVING
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a ) AS field
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
@@ -6825,8 +6823,8 @@ SELECT MAX( alias2.a )
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	alias1	index	a	a	19	NULL	11	Using where; Using index
+1	PRIMARY	alias2	ref	a	a	19	test.alias1.a	2	Using index
 1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a )
diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result
index d380528..77c7d56 100644
--- a/mysql-test/r/subselect_no_semijoin.result
+++ b/mysql-test/r/subselect_no_semijoin.result
@@ -6796,9 +6796,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR alias1.a = 'y'
 HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
-1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible HAVING
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a ) AS field
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
@@ -6810,8 +6808,8 @@ SELECT MAX( alias2.a )
 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
 WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	alias1	index	a	a	19	NULL	11	Using index
-1	PRIMARY	alias2	index	a	a	19	NULL	11	Using where; Using index; Using join buffer (flat, BNL join)
+1	PRIMARY	alias1	index	a	a	19	NULL	11	Using where; Using index
+1	PRIMARY	alias2	ref	a	a	19	test.alias1.a	2	Using index
 1	PRIMARY	alias3	index	NULL	a	19	NULL	11	Using index; Using join buffer (flat, BNL join)
 2	SUBQUERY	t1	index_subquery	a	a	19	const	1	Using index; Using where
 SELECT MAX( alias2.a )
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index f45d83d..8d8bdc5 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -574,7 +574,7 @@ bool Item_subselect::is_expensive()
       If the subquery is not optimised or in the process of optimization
       it supposed to be expensive
     */
-    if (!cur_join->optimized || cur_join->in_optimize)
+    if (!cur_join->optimized)
       return true;
 
     /*
diff --git a/sql/sql_select.h b/sql/sql_select.h
index e57844fd..9f90473 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1292,7 +1292,6 @@ class JOIN :public Sql_alloc
                                  OPTIMIZATION_IN_PROGRESS=1,
                                  OPTIMIZATION_DONE=2};
   bool optimized; ///< flag to avoid double optimization in EXPLAIN
-  bool in_optimize;
   bool initialized; ///< flag to avoid double init_execution calls
 
   Explain_select *explain;
@@ -1381,7 +1380,6 @@ class JOIN :public Sql_alloc
     ref_pointer_array_size= 0;
     zero_result_cause= 0;
     optimized= 0;
-    in_optimize= 0;
     have_query_plan= QEP_NOT_PRESENT_YET;
     initialized= 0;
     cleaned= 0;


More information about the commits mailing list