Commit 0bc3e69f authored by unknown's avatar unknown

A fix and a test case for Bug#25859 ALTER DATABASE works w/o parameters.

Fix the parser to make the database options not optional.


mysql-test/r/information_schema.result:
  Update results (Bug#25859)
mysql-test/t/information_schema.test:
  Add a test case for Bug#25859 "ALTER DATABASE works w/o parameters"
sql/sql_yacc.yy:
  Fix Bug#25859 ALTER DATABASE works w/o parameters - require
  parameters in the parser.
parent a64be676
...@@ -1013,7 +1013,7 @@ c int(11) YES NULL ...@@ -1013,7 +1013,7 @@ c int(11) YES NULL
drop view v1; drop view v1;
drop table t1; drop table t1;
alter database information_schema; alter database information_schema;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' 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
drop database information_schema; drop database information_schema;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
drop table information_schema.tables; drop table information_schema.tables;
...@@ -1326,3 +1326,8 @@ v2 YES ...@@ -1326,3 +1326,8 @@ v2 YES
delete from v1; delete from v1;
drop view v1,v2; drop view v1,v2;
drop table t1,t2; drop table t1,t2;
alter database;
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
alter database test;
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
End of 5.0 tests.
...@@ -697,7 +697,7 @@ drop table t1; ...@@ -697,7 +697,7 @@ drop table t1;
# #
# Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA' # Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA'
# #
--error 1044 --error ER_PARSE_ERROR
alter database information_schema; alter database information_schema;
--error 1044 --error 1044
drop database information_schema; drop database information_schema;
...@@ -1038,4 +1038,11 @@ delete from v1; ...@@ -1038,4 +1038,11 @@ delete from v1;
drop view v1,v2; drop view v1,v2;
drop table t1,t2; drop table t1,t2;
# End of 5.0 tests. #
# Bug#25859 ALTER DATABASE works w/o parameters
#
--error ER_PARSE_ERROR
alter database;
--error ER_PARSE_ERROR
alter database test;
--echo End of 5.0 tests.
...@@ -3621,7 +3621,7 @@ alter: ...@@ -3621,7 +3621,7 @@ alter:
Lex->create_info.default_table_charset= NULL; Lex->create_info.default_table_charset= NULL;
Lex->create_info.used_fields= 0; Lex->create_info.used_fields= 0;
} }
opt_create_database_options create_database_options
{ {
LEX *lex=Lex; LEX *lex=Lex;
lex->sql_command=SQLCOM_ALTER_DB; lex->sql_command=SQLCOM_ALTER_DB;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment