diff options
-rw-r--r-- | mysql-test/r/derived.result | 2 | ||||
-rw-r--r-- | sql/sql_derived.cc | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 5f405d83fa5..61937ba9266 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -137,7 +137,7 @@ a t explain select count(*) from t1 as tt1, (select * from t1) as tt2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -2 DERIVED tt1 index NULL a 4 NULL 10000 Using index +2 DERIVED tt1 ALL NULL NULL NULL NULL 10000 drop table t1; SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b; (SELECT * FROM (SELECT 1 as a) as a ) diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 2bf1a68e504..b2a055b3ee5 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -223,6 +223,8 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, /* Add new temporary table to list of open derived tables */ table->next= thd->derived_tables; thd->derived_tables= table; + thd->query_id++; + query_id++; } exit: |