summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <ram@gw.mysql.r18.ru>2004-11-16 14:36:25 +0400
committerunknown <ram@gw.mysql.r18.ru>2004-11-16 14:36:25 +0400
commit0f9f2b02c1f87eef80b1ff0a6873be28ddcfc3fe (patch)
tree114e6c45ed3d65c4ddd427cac40a9adb36199f1d
parenta2b3d71d1f1c866406b691e6b15de275b0d8dceb (diff)
downloadmariadb-git-0f9f2b02c1f87eef80b1ff0a6873be28ddcfc3fe.tar.gz
A fix (bug #6449: DO server-crashing bug).
sql/sql_yacc.yy: A fix (bug #6449: DO server-crashing bug). expr_list is used for DO command.
-rw-r--r--mysql-test/r/select.result4
-rw-r--r--mysql-test/t/select.test9
-rw-r--r--sql/sql_yacc.yy9
3 files changed, 18 insertions, 4 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index ba0a80331b1..3417c7ecb85 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2057,6 +2057,10 @@ t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
drop table t4, t3, t2, t1;
DO 1;
DO benchmark(100,1+1),1,1;
+do default;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+do foobar;
+ERROR 42S22: Unknown column 'foobar' in 'field list'
CREATE TABLE t1 (
id mediumint(8) unsigned NOT NULL auto_increment,
pseudo varchar(35) NOT NULL default '',
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 5bae44796dc..3b36ba6bfb2 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1757,6 +1757,15 @@ DO 1;
DO benchmark(100,1+1),1,1;
#
+# Bug #6449: do default;
+#
+
+--error 1064
+do default;
+--error 1054
+do foobar;
+
+#
# random in WHERE clause
#
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 521196085bb..8cbfaf3f99b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -3932,11 +3932,12 @@ do: DO_SYM
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_DO;
- if (!(lex->insert_list = new List_item))
- YYABORT;
+ mysql_init_select(lex);
+ }
+ expr_list
+ {
+ Lex->insert_list= $3;
}
- values
- {}
;
/*