summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <joerg@trift2.>2007-06-14 21:27:33 +0200
committerunknown <joerg@trift2.>2007-06-14 21:27:33 +0200
commit77961c895e3ec5773c0a0b216fa980ba797b954c (patch)
treebd357c09ecb6b48b6bd09a7b5862d1c4356090d6
parentef4a6f850c77f738abcb76ecf2f9ea4452dcb4eb (diff)
parent102d4c924e814a44aa58d08c92f19012f71a0ce0 (diff)
downloadmariadb-git-77961c895e3ec5773c0a0b216fa980ba797b954c.tar.gz
Merge trift2.:/MySQL/M41/mysql-4.1
into trift2.:/MySQL/M41/push-4.1
-rw-r--r--mysql-test/r/subselect.result2
-rw-r--r--mysql-test/t/subselect.test7
-rw-r--r--sql/sql_yacc.yy8
3 files changed, 11 insertions, 6 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 5bb79a53771..ff120912902 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -2834,6 +2834,8 @@ a
4
DROP TABLE t1,t2,t3;
purge master logs before (select adddate(current_timestamp(), interval -4 day));
+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 'select adddate(current_timestamp(), interval -4 day))' at line 1
+purge master logs before adddate(current_timestamp(), interval -4 day);
CREATE TABLE t1 (f1 INT);
CREATE TABLE t2 (f2 INT);
INSERT INTO t1 VALUES (1);
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 67a18e7a30f..978c8f26552 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -1815,11 +1815,12 @@ SELECT * FROM t1
DROP TABLE t1,t2,t3;
#
-# BUG #10308: purge log with subselect
+# BUG#10308: purge log with subselect
+# Bug#28553: mysqld crash in "purge master log before(select time from information_schema)"
#
-
+--error 1064
purge master logs before (select adddate(current_timestamp(), interval -4 day));
-
+purge master logs before adddate(current_timestamp(), interval -4 day);
#
# Bug#18503: Queries with a quantified subquery returning empty set may
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index b72caac46a0..d53dba6bf1b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -3567,7 +3567,8 @@ select_derived2:
LEX *lex= Lex;
lex->derived_tables= 1;
if (lex->sql_command == (int)SQLCOM_HA_READ ||
- lex->sql_command == (int)SQLCOM_KILL)
+ lex->sql_command == (int)SQLCOM_KILL ||
+ lex->sql_command == (int)SQLCOM_PURGE)
{
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
@@ -4748,6 +4749,7 @@ purge:
{
LEX *lex=Lex;
lex->type=0;
+ lex->sql_command = SQLCOM_PURGE;
} purge_options
{}
;
@@ -4759,7 +4761,6 @@ purge_options:
purge_option:
TO_SYM TEXT_STRING_sys
{
- Lex->sql_command = SQLCOM_PURGE;
Lex->to_log = $2.str;
}
| BEFORE_SYM expr
@@ -6212,7 +6213,8 @@ subselect_start:
{
LEX *lex=Lex;
if (lex->sql_command == (int)SQLCOM_HA_READ ||
- lex->sql_command == (int)SQLCOM_KILL)
+ lex->sql_command == (int)SQLCOM_KILL ||
+ lex->sql_command == (int)SQLCOM_PURGE)
{
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;