[Commits] Rev 3542: MDEV-462: SHOW EXPLAIN: Assertion `table_list->table' fails in find_field_in_table_ref ... in file:///data0/psergey/dev2/5.5-show-explain-r34/

Sergey Petrunya psergey at askmonty.org
Sun Nov 4 21:38:01 EET 2012


At file:///data0/psergey/dev2/5.5-show-explain-r34/

------------------------------------------------------------
revno: 3542
revision-id: psergey at askmonty.org-20121006070918-01y2l86jdkav7fs4
parent: psergey at askmonty.org-20121006070337-effnsx9lkxgjkpj7
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.5-show-explain-r34
timestamp: Sat 2012-10-06 11:09:18 +0400
message:
  MDEV-462: SHOW EXPLAIN: Assertion `table_list->table' fails in find_field_in_table_ref ...
  - Only allow basic constants as SHOW EXPLAIN arguments.
=== modified file 'mysql-test/r/show_explain.result'
--- a/mysql-test/r/show_explain.result	2012-08-09 16:38:09 +0000
+++ b/mysql-test/r/show_explain.result	2012-10-06 07:09:18 +0000
@@ -7,7 +7,7 @@
 alter table t1 add b int, add c int, add filler char(32);
 update t1 set b=a, c=a, filler='fooo';
 alter table t1 add key(a), add key(b);
-show explain for 2*1000*1000*1000;
+show explain for 2000000000;
 ERROR HY000: Unknown thread id: 2000000000
 show explain for (select max(a) from t0);
 ERROR HY000: You may only use constant expressions in this statement
@@ -1069,5 +1069,10 @@
 2
 set debug_dbug='';
 set names default;
+#
+# MDEV-462: SHOW EXPLAIN: Assertion `table_list->table' fails in find_field_in_table_ref if FOR contains a non-numeric value
+#
+show explain for foo;
+ERROR HY000: You may only use constant expressions in this statement
 # End
 drop table t0;

=== modified file 'mysql-test/t/show_explain.test'
--- a/mysql-test/t/show_explain.test	2012-08-09 16:38:09 +0000
+++ b/mysql-test/t/show_explain.test	2012-10-06 07:09:18 +0000
@@ -43,7 +43,7 @@
 # Try killing a non-existent thread
 # 
 --error ER_NO_SUCH_THREAD
-show explain for 2*1000*1000*1000;
+show explain for 2000000000;
 
 --error ER_SET_CONSTANTS_ONLY
 show explain for (select max(a) from t0);
@@ -1105,5 +1105,11 @@
 set debug_dbug='';
 set names default;
 
+--echo #
+--echo # MDEV-462: SHOW EXPLAIN: Assertion `table_list->table' fails in find_field_in_table_ref if FOR contains a non-numeric value
+--echo #
+--error ER_SET_CONSTANTS_ONLY 
+show explain for foo;
+
 --echo # End
 drop table t0;

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2012-10-06 07:03:37 +0000
+++ b/sql/sql_parse.cc	2012-10-06 07:09:18 +0000
@@ -2159,7 +2159,8 @@
     }
 
     Item **it= lex->value_list.head_ref();
-    if ((!(*it)->fixed && (*it)->fix_fields(lex->thd, it)) || 
+    if (!(*it)->basic_const_item() ||
+        (!(*it)->fixed && (*it)->fix_fields(lex->thd, it)) || 
         (*it)->check_cols(1))
     {
       my_message(ER_SET_CONSTANTS_ONLY, ER(ER_SET_CONSTANTS_ONLY),



More information about the commits mailing list