Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-08-03 10:36:10+02:00, andrey@lmy004. +10 -0
Fix for bug #20665 All commands supported in Stored Procedures
should work in Prepared Statements
SHOW BINLOG EVENTS
SHOW (MASTER | SLAVE) STATUS
SHOW (MASTER | BINARY) LOGS
SHOW (PROCEDURE | FUNCTION) CODE (parsable only in debug builds)
SHOW CREATE (PROCEDURE | FUNCTION | EVENT | TABLE | VIEW)
SHOW (AUTHORS | CONTRIBUTORS | WARNINGS | ERRORS)
CHANGE MASTER
RESET (MASTER | SLAVE | QUERY CACHE)
SLAVE (START | STOP)
CHECKSUM (TABLE | TABLES)
INSTALL PLUGIN
UNINSTALL PLUGIN
CACHE INDEX
LOAD INDEX INTO CACHE
GRANT
REVOKE
KILL
(CREATE | RENAME | DROP) DATABASE
(CREATE | RENAME | DROP) USER
FLUSH (TABLE | TABLES | TABLES WITH READ LOCK | HOSTS | PRIVILEGES |
LOGS | STATUS | MASTER | SLAVE | DES_KEY_FILE | USER_RESOURCES)
mysql-test/r/ps.result@stripped, 2006-08-03 10:35:58+02:00, andrey@lmy004. +196 -0
update result
mysql-test/r/ps_1general.result@stripped, 2006-08-03 10:35:58+02:00, andrey@lmy004. +0 -12
update result
mysql-test/r/ps_grant.result@stripped, 2006-08-03 10:35:58+02:00, andrey@lmy004. +0 -3
update result
mysql-test/r/sp-dynamic.result@stripped, 2006-08-03 10:35:58+02:00, andrey@lmy004. +2 -2
update result
mysql-test/t/ps.test@stripped, 2006-08-03 10:35:58+02:00, andrey@lmy004. +336 -0
Add more statements, probably all currently missing which are possible in
a SP but not preparable.
Every statement is tested in a SP, in a SF and attempted to prepare.
mysql-test/t/ps_1general.test@stripped, 2006-08-03 10:35:58+02:00, andrey@lmy004. +6 -18
Enable some of the statements, which are already possible in SP.
1295 -> ER_UNSUPPORTED_PS
mysql-test/t/ps_grant.test@stripped, 2006-08-03 10:35:58+02:00, andrey@lmy004. +0 -3
Enable already possible in SP statements.
sql/sp_head.cc@stripped, 2006-08-03 10:35:58+02:00, andrey@lmy004. +7 -5
- Reorder to keep some alphabet order.
- Add missing SHOW_SCHEDULER_STATUS.
sql/sql_parse.cc@stripped, 2006-08-03 10:35:58+02:00, andrey@lmy004. +1 -0
- Add missing SHOW_SCHEDULER_STATUS
sql/sql_prepare.cc@stripped, 2006-08-03 10:35:59+02:00, andrey@lmy004. +33 -0
Add possibility to prepare statements, which are already allowed in SP.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: andrey
# Host: lmy004.
# Root: /work/mysql-5.1-runtime-bug20665
--- 1.573/sql/sql_parse.cc 2006-08-03 10:36:24 +02:00
+++ 1.574/sql/sql_parse.cc 2006-08-03 10:36:24 +02:00
@@ -667,6 +667,7 @@
sql_command_flags[SQLCOM_SHOW_DATABASES]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_TRIGGERS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_EVENTS]= CF_STATUS_COMMAND;
+ sql_command_flags[SQLCOM_SHOW_SCHEDULER_STATUS]=CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_OPEN_TABLES]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_PLUGINS]= CF_STATUS_COMMAND;
sql_command_flags[SQLCOM_SHOW_FIELDS]= CF_STATUS_COMMAND;
--- 1.59/mysql-test/r/ps_1general.result 2006-08-03 10:36:24 +02:00
+++ 1.60/mysql-test/r/ps_1general.result 2006-08-03 10:36:24 +02:00
@@ -308,17 +308,11 @@
execute stmt4;
prepare stmt4 from ' show grants for user ';
prepare stmt4 from ' show create table t2 ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt4 from ' show master status ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt4 from ' show master logs ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt4 from ' show slave status ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt4 from ' show warnings limit 20 ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt4 from ' show errors limit 20 ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt4 from ' show storage engines ';
execute stmt4;
drop table if exists t5;
@@ -387,10 +381,8 @@
prepare stmt4 from ' use test ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt3 from ' create database mysqltest ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
create database mysqltest ;
prepare stmt3 from ' drop database mysqltest ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
drop database mysqltest ;
prepare stmt3 from ' describe t2 ';
execute stmt3;
@@ -412,7 +404,6 @@
prepare stmt1 from ' optimize table t1 ' ;
prepare stmt1 from ' analyze table t1 ' ;
prepare stmt1 from ' checksum table t1 ' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' repair table t1 ' ;
prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
@@ -440,11 +431,8 @@
1
SET sql_mode="";
prepare stmt1 from ' flush local privileges ' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' reset query cache ' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' KILL 0 ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' explain select a from t1 order by b ';
execute stmt1;
Catalog Database Table Table_alias Column Column_alias Type Length Max
length Is_null Flags Decimals Charsetnr
--- 1.33/mysql-test/t/ps_1general.test 2006-08-03 10:36:24 +02:00
+++ 1.34/mysql-test/t/ps_1general.test 2006-08-03 10:36:24 +02:00
@@ -329,17 +329,11 @@
execute stmt4;
--enable_result_log
prepare stmt4 from ' show grants for user ';
---error 1295
prepare stmt4 from ' show create table t2 ';
---error 1295
prepare stmt4 from ' show master status ';
---error 1295
prepare stmt4 from ' show master logs ';
---error 1295
prepare stmt4 from ' show slave status ';
---error 1295
prepare stmt4 from ' show warnings limit 20 ';
---error 1295
prepare stmt4 from ' show errors limit 20 ';
prepare stmt4 from ' show storage engines ';
# The output depends upon the precise order in which
@@ -426,14 +420,12 @@
prepare stmt1 from ' deallocate prepare never_prepared ' ;
## switch the database connection
---error 1295
+--error ER_UNSUPPORTED_PS
prepare stmt4 from ' use test ' ;
## create/drop database
---error 1295
prepare stmt3 from ' create database mysqltest ';
create database mysqltest ;
---error 1295
prepare stmt3 from ' drop database mysqltest ';
drop database mysqltest ;
@@ -445,12 +437,12 @@
--error 1146
execute stmt3;
## lock/unlock
---error 1295
+--error ER_UNSUPPORTED_PS
prepare stmt3 from ' lock tables t1 read ' ;
---error 1295
+--error ER_UNSUPPORTED_PS
prepare stmt3 from ' unlock tables ' ;
## Load/Unload table contents
---error 1295
+--error ER_UNSUPPORTED_PS
prepare stmt1 from ' load data infile ''data.txt''
into table t1 fields terminated by ''\t'' ';
prepare stmt1 from ' select * into outfile ''data.txt'' from t1 ';
@@ -458,13 +450,12 @@
##
prepare stmt1 from ' optimize table t1 ' ;
prepare stmt1 from ' analyze table t1 ' ;
---error 1295
prepare stmt1 from ' checksum table t1 ' ;
prepare stmt1 from ' repair table t1 ' ;
---error 1295
+--error ER_UNSUPPORTED_PS
prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;
## handler
---error 1295
+--error ER_UNSUPPORTED_PS
prepare stmt1 from ' handler t1 open ';
@@ -490,11 +481,8 @@
execute stmt5;
SET sql_mode="";
---error 1295
prepare stmt1 from ' flush local privileges ' ;
---error 1295
prepare stmt1 from ' reset query cache ' ;
---error 1295
prepare stmt1 from ' KILL 0 ';
## simple explain
--- 1.10/mysql-test/r/ps_grant.result 2006-08-03 10:36:24 +02:00
+++ 1.11/mysql-test/r/ps_grant.result 2006-08-03 10:36:24 +02:00
@@ -78,13 +78,10 @@
drop database mysqltest;
prepare stmt3 from ' grant all on test.t1 to drop_user@localhost
identified by ''looser'' ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
grant all on test.t1 to drop_user@localhost
identified by 'looser' ;
prepare stmt3 from ' revoke all privileges on test.t1 from
drop_user@localhost ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
revoke all privileges on test.t1 from drop_user@localhost ;
prepare stmt3 from ' drop user drop_user@localhost ';
-ERROR HY000: This command is not supported in the prepared statement protocol yet
drop user drop_user@localhost;
--- 1.6/mysql-test/t/ps_grant.test 2006-08-03 10:36:24 +02:00
+++ 1.7/mysql-test/t/ps_grant.test 2006-08-03 10:36:24 +02:00
@@ -117,15 +117,12 @@
#
# grant/revoke + drop user
#
---error 1295
prepare stmt3 from ' grant all on test.t1 to drop_user@localhost
identified by ''looser'' ';
grant all on test.t1 to drop_user@localhost
identified by 'looser' ;
---error 1295
prepare stmt3 from ' revoke all privileges on test.t1 from
drop_user@localhost ';
revoke all privileges on test.t1 from drop_user@localhost ;
---error 1295
prepare stmt3 from ' drop user drop_user@localhost ';
drop user drop_user@localhost;
--- 1.5/mysql-test/r/sp-dynamic.result 2006-08-03 10:36:24 +02:00
+++ 1.6/mysql-test/r/sp-dynamic.result 2006-08-03 10:36:24 +02:00
@@ -284,11 +284,11 @@
select * from t1|
id stmt_text status
1 select 1 supported
-2 flush tables not supported
+2 flush tables supported
3 handler t1 open as ha not supported
4 analyze table t1 supported
5 check table t1 not supported
-6 checksum table t1 not supported
+6 checksum table t1 supported
7 check table t1 not supported
8 optimize table t1 supported
9 repair table t1 supported
--- 1.230/sql/sp_head.cc 2006-08-03 10:36:24 +02:00
+++ 1.231/sql/sp_head.cc 2006-08-03 10:36:24 +02:00
@@ -161,17 +161,20 @@
}
/* fallthrough */
case SQLCOM_ANALYZE:
+ case SQLCOM_BACKUP_TABLE:
case SQLCOM_OPTIMIZE:
case SQLCOM_PRELOAD_KEYS:
case SQLCOM_ASSIGN_TO_KEYCACHE:
case SQLCOM_CHECKSUM:
case SQLCOM_CHECK:
case SQLCOM_HA_READ:
+ case SQLCOM_SHOW_AUTHORS:
case SQLCOM_SHOW_BINLOGS:
case SQLCOM_SHOW_BINLOG_EVENTS:
case SQLCOM_SHOW_CHARSETS:
case SQLCOM_SHOW_COLLATIONS:
case SQLCOM_SHOW_COLUMN_TYPES:
+ case SQLCOM_SHOW_CONTRIBUTORS:
case SQLCOM_SHOW_CREATE:
case SQLCOM_SHOW_CREATE_DB:
case SQLCOM_SHOW_CREATE_FUNC:
@@ -180,16 +183,20 @@
case SQLCOM_SHOW_DATABASES:
case SQLCOM_SHOW_ERRORS:
case SQLCOM_SHOW_FIELDS:
+ case SQLCOM_SHOW_FUNC_CODE:
case SQLCOM_SHOW_GRANTS:
case SQLCOM_SHOW_ENGINE_STATUS:
case SQLCOM_SHOW_ENGINE_LOGS:
case SQLCOM_SHOW_ENGINE_MUTEX:
+ case SQLCOM_SHOW_EVENTS:
case SQLCOM_SHOW_KEYS:
case SQLCOM_SHOW_MASTER_STAT:
case SQLCOM_SHOW_NEW_MASTER:
case SQLCOM_SHOW_OPEN_TABLES:
case SQLCOM_SHOW_PRIVILEGES:
case SQLCOM_SHOW_PROCESSLIST:
+ case SQLCOM_SHOW_PROC_CODE:
+ case SQLCOM_SHOW_SCHEDULER_STATUS:
case SQLCOM_SHOW_SLAVE_HOSTS:
case SQLCOM_SHOW_SLAVE_STAT:
case SQLCOM_SHOW_STATUS:
@@ -199,12 +206,7 @@
case SQLCOM_SHOW_TABLES:
case SQLCOM_SHOW_VARIABLES:
case SQLCOM_SHOW_WARNS:
- case SQLCOM_SHOW_PROC_CODE:
- case SQLCOM_SHOW_FUNC_CODE:
- case SQLCOM_SHOW_AUTHORS:
- case SQLCOM_SHOW_CONTRIBUTORS:
case SQLCOM_REPAIR:
- case SQLCOM_BACKUP_TABLE:
case SQLCOM_RESTORE_TABLE:
flags= sp_head::MULTI_RESULTS;
break;
--- 1.69/mysql-test/r/ps.result 2006-08-03 10:36:24 +02:00
+++ 1.70/mysql-test/r/ps.result 2006-08-03 10:36:24 +02:00
@@ -1263,3 +1263,199 @@
create temporary table t1 (i int);
ERROR 3D000: No database selected
use test;
+create procedure proc_1() reset query cache;
+drop procedure proc_1;
+create function func_1() returns int begin reset query cache; return 1; end|
+drop function func_1;
+prepare abc from "reset query cache";
+create procedure proc_1() reset master;
+drop procedure proc_1;
+create function func_1() returns int begin reset master; return 1; end|
+drop function func_1;
+prepare abc from "reset master";
+create procedure proc_1() reset slave;
+drop procedure proc_1;
+create function func_1() returns int begin reset slave; return 1; end|
+drop function func_1;
+prepare abc from "reset slave";
+create procedure proc_1(a integer) kill a;
+call proc_1(0);
+ERROR HY000: Unknown thread id: 0
+drop procedure proc_1;
+create function func_1() returns int begin kill 0; return 1; end|
+select func_1();
+ERROR HY000: Unknown thread id: 0
+drop function func_1;
+prepare abc from "kill 1";
+create procedure proc_1() flush hosts;
+drop procedure proc_1;
+create function func_1() returns int begin flush hosts; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush hosts";
+create procedure proc_1() flush privileges;
+drop procedure proc_1;
+create function func_1() returns int begin flush privileges; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush privileges";
+create procedure proc_1() flush tables with read lock;
+drop procedure proc_1;
+create function func_1() returns int begin flush tables with read lock; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush tables with read lock";
+create procedure proc_1() flush tables;
+drop procedure proc_1;
+create function func_1() returns int begin flush tables; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush tables";
+create procedure proc_1() flush table;
+drop procedure proc_1;
+create function func_1() returns int begin flush table; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush table";
+create procedure proc_1() flush logs;
+drop procedure proc_1;
+create function func_1() returns int begin flush logs; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush logs";
+create procedure proc_1() flush status;
+drop procedure proc_1;
+create function func_1() returns int begin flush status; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush status";
+create procedure proc_1() flush slave;
+drop procedure proc_1;
+create function func_1() returns int begin flush slave; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush slave";
+create procedure proc_1() flush master;
+drop procedure proc_1;
+create function func_1() returns int begin flush master; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush master";
+create procedure proc_1() flush des_key_file;
+drop procedure proc_1;
+create function func_1() returns int begin flush des_key_file; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush des_key_file";
+create procedure proc_1() flush user_resources;
+drop procedure proc_1;
+create function func_1() returns int begin flush user_resources; return 1; end|
+ERROR 0A000: FLUSH is not allowed in stored function or trigger
+prepare abc from "flush user_resources";
+create procedure proc_1() start slave;
+drop procedure proc_1;
+create function func_1() returns int begin start slave; return 1; end|
+drop function func_1;
+prepare abc from "start slave";
+create procedure proc_1() stop slave;
+drop procedure proc_1;
+create function func_1() returns int begin stop slave; return 1; end|
+drop function func_1;
+prepare abc from "stop slave";
+create procedure proc_1() show binlog events;
+drop procedure proc_1;
+create function func_1() returns int begin show binlog events; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show binlog events";
+create procedure proc_1() show slave status;
+drop procedure proc_1;
+create function func_1() returns int begin show slave status; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show slave status";
+create procedure proc_1() show master status;
+drop procedure proc_1;
+create function func_1() returns int begin show master status; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show master status";
+create procedure proc_1() show master logs;
+drop procedure proc_1;
+create function func_1() returns int begin show master logs; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show master logs";
+create procedure proc_1() show events;
+drop procedure proc_1;
+create function func_1() returns int begin show events; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show events";
+create procedure proc_1() show scheduler status;
+drop procedure proc_1;
+create function func_1() returns int begin show scheduler status; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show scheduler status";
+create procedure proc_1(a char) show create procedure a;
+drop procedure proc_1;
+create function func_1() returns int begin show create procedure a; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show create procedure a";
+create procedure proc_1(a char) show create function a;
+drop procedure proc_1;
+create function func_1() returns int begin show create function a; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show create function a";
+create procedure proc_1() show create table tab1;
+drop procedure proc_1;
+create function func_1() returns int begin show create table tab1; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show create table tab1";
+create procedure proc_1() show create view v1;
+drop procedure proc_1;
+create function func_1() returns int begin show create view v1; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show create view v1";
+create procedure proc_1() install plugin my_plug soname '/tmp/plugin';
+drop procedure proc_1;
+create function func_1() returns int begin install plugin my_plug soname '/tmp/plugin';
return 1; end|
+drop function func_1;
+prepare abc from "install plugin my_plug soname '/tmp/plugin'";
+create procedure proc_1() create database xyz;
+drop procedure proc_1;
+create function func_1() returns int begin create database xyz; return 1; end|
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+prepare abc from "create database xyz";
+create procedure proc_1() checksum table xyz;
+drop procedure proc_1;
+create function func_1() returns int begin checksum table xyz; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "checksum table xyz";
+create procedure proc_1() create user xyz;
+drop procedure proc_1;
+create function func_1() returns int begin create user xyz; return 1; end|
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+prepare abc from "create user xyz";
+create procedure proc_1() create event xyz on schedule at now() do select 123;
+drop procedure proc_1;
+create function func_1() returns int begin create event xyz on schedule at now() do
select 123; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "create event xyz on schedule at now() do select 123";
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+create procedure proc_1() alter event xyz comment 'xyz';
+drop procedure proc_1;
+create function func_1() returns int begin alter event xyz comment 'xyz'; return 1; end|
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+prepare abc from "alter event xyz comment 'xyz'";
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+create procedure proc_1() drop event xyz;
+drop procedure proc_1;
+create function func_1() returns int begin drop event xyz; return 1; end|
+ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+prepare abc from "drop event xyz";
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+create procedure proc_1() cache index t1 in non_existent_cache;
+drop procedure proc_1;
+prepare abc from "cache index t1 in non_existent_cache";
+create procedure proc_1() load index into cache t1 ignore leaves;
+drop procedure proc_1;
+create function func_1() returns int begin load index into cache t1 ignore leaves; return
1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "load index into cache t1 ignore leaves";
+create procedure proc_1() show errors;
+drop procedure proc_1;
+create function func_1() returns int begin show errors; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show errors";
+create procedure proc_1() show warnings;
+drop procedure proc_1;
+create function func_1() returns int begin show warnings; return 1; end|
+ERROR 0A000: Not allowed to return a result set from a function
+prepare abc from "show warnings";
+deallocate prepare abc;
--- 1.67/mysql-test/t/ps.test 2006-08-03 10:36:24 +02:00
+++ 1.68/mysql-test/t/ps.test 2006-08-03 10:36:24 +02:00
@@ -1265,3 +1265,339 @@
#
use test;
# End of 5.0 tests
+
+
+#
+# Bug #20665: All commands supported in Stored Procedures should work in
+# Prepared Statements
+#
+create procedure proc_1() reset query cache;
+drop procedure proc_1;
+delimiter |;
+create function func_1() returns int begin reset query cache; return 1; end|
+delimiter ;|
+drop function func_1;
+prepare abc from "reset query cache";
+
+create procedure proc_1() reset master;
+drop procedure proc_1;
+delimiter |;
+create function func_1() returns int begin reset master; return 1; end|
+delimiter ;|
+drop function func_1;
+prepare abc from "reset master";
+
+create procedure proc_1() reset slave;
+drop procedure proc_1;
+delimiter |;
+create function func_1() returns int begin reset slave; return 1; end|
+delimiter ;|
+drop function func_1;
+prepare abc from "reset slave";
+
+create procedure proc_1(a integer) kill a;
+--error ER_NO_SUCH_THREAD
+call proc_1(0);
+drop procedure proc_1;
+delimiter |;
+create function func_1() returns int begin kill 0; return 1; end|
+delimiter ;|
+--error ER_NO_SUCH_THREAD
+select func_1();
+drop function func_1;
+prepare abc from "kill 1";
+
+create procedure proc_1() flush hosts;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush hosts; return 1; end|
+delimiter ;|
+prepare abc from "flush hosts";
+
+create procedure proc_1() flush privileges;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush privileges; return 1; end|
+delimiter ;|
+prepare abc from "flush privileges";
+
+create procedure proc_1() flush tables with read lock;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush tables with read lock; return 1; end|
+delimiter ;|
+prepare abc from "flush tables with read lock";
+
+create procedure proc_1() flush tables;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush tables; return 1; end|
+delimiter ;|
+prepare abc from "flush tables";
+
+create procedure proc_1() flush table;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush table; return 1; end|
+delimiter ;|
+prepare abc from "flush table";
+
+create procedure proc_1() flush logs;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush logs; return 1; end|
+delimiter ;|
+prepare abc from "flush logs";
+
+create procedure proc_1() flush status;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush status; return 1; end|
+delimiter ;|
+prepare abc from "flush status";
+
+create procedure proc_1() flush slave;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush slave; return 1; end|
+delimiter ;|
+prepare abc from "flush slave";
+
+create procedure proc_1() flush master;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush master; return 1; end|
+delimiter ;|
+prepare abc from "flush master";
+
+create procedure proc_1() flush des_key_file;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush des_key_file; return 1; end|
+delimiter ;|
+prepare abc from "flush des_key_file";
+
+create procedure proc_1() flush user_resources;
+drop procedure proc_1;
+delimiter |;
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin flush user_resources; return 1; end|
+delimiter ;|
+prepare abc from "flush user_resources";
+
+create procedure proc_1() start slave;
+drop procedure proc_1;
+delimiter |;
+create function func_1() returns int begin start slave; return 1; end|
+delimiter ;|
+drop function func_1;
+prepare abc from "start slave";
+
+create procedure proc_1() stop slave;
+drop procedure proc_1;
+delimiter |;
+create function func_1() returns int begin stop slave; return 1; end|
+delimiter ;|
+drop function func_1;
+prepare abc from "stop slave";
+
+create procedure proc_1() show binlog events;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show binlog events; return 1; end|
+delimiter ;|
+prepare abc from "show binlog events";
+
+create procedure proc_1() show slave status;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show slave status; return 1; end|
+delimiter ;|
+prepare abc from "show slave status";
+
+create procedure proc_1() show master status;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show master status; return 1; end|
+delimiter ;|
+prepare abc from "show master status";
+
+create procedure proc_1() show master logs;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show master logs; return 1; end|
+delimiter ;|
+prepare abc from "show master logs";
+
+create procedure proc_1() show events;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show events; return 1; end|
+delimiter ;|
+prepare abc from "show events";
+
+create procedure proc_1() show scheduler status;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show scheduler status; return 1; end|
+delimiter ;|
+prepare abc from "show scheduler status";
+
+create procedure proc_1(a char) show create procedure a;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show create procedure a; return 1; end|
+delimiter ;|
+prepare abc from "show create procedure a";
+
+create procedure proc_1(a char) show create function a;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show create function a; return 1; end|
+delimiter ;|
+prepare abc from "show create function a";
+
+create procedure proc_1() show create table tab1;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show create table tab1; return 1; end|
+delimiter ;|
+prepare abc from "show create table tab1";
+
+create procedure proc_1() show create view v1;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show create view v1; return 1; end|
+delimiter ;|
+prepare abc from "show create view v1";
+
+create procedure proc_1() install plugin my_plug soname '/tmp/plugin';
+drop procedure proc_1;
+delimiter |;
+create function func_1() returns int begin install plugin my_plug soname '/tmp/plugin';
return 1; end|
+delimiter ;|
+drop function func_1;
+prepare abc from "install plugin my_plug soname '/tmp/plugin'";
+
+create procedure proc_1() create database xyz;
+drop procedure proc_1;
+delimiter |;
+--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin create database xyz; return 1; end|
+delimiter ;|
+prepare abc from "create database xyz";
+
+create procedure proc_1() checksum table xyz;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin checksum table xyz; return 1; end|
+delimiter ;|
+prepare abc from "checksum table xyz";
+
+create procedure proc_1() create user xyz;
+drop procedure proc_1;
+delimiter |;
+--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin create user xyz; return 1; end|
+delimiter ;|
+prepare abc from "create user xyz";
+
+create procedure proc_1() create event xyz on schedule at now() do select 123;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin create event xyz on schedule at now() do
select 123; return 1; end|
+delimiter ;|
+--error ER_UNSUPPORTED_PS
+prepare abc from "create event xyz on schedule at now() do select 123";
+
+create procedure proc_1() alter event xyz comment 'xyz';
+drop procedure proc_1;
+delimiter |;
+--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin alter event xyz comment 'xyz'; return 1; end|
+delimiter ;|
+--error ER_UNSUPPORTED_PS
+prepare abc from "alter event xyz comment 'xyz'";
+
+create procedure proc_1() drop event xyz;
+drop procedure proc_1;
+delimiter |;
+--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+create function func_1() returns int begin drop event xyz; return 1; end|
+delimiter ;|
+--error ER_UNSUPPORTED_PS
+prepare abc from "drop event xyz";
+
+create procedure proc_1() cache index t1 in non_existent_cache;
+drop procedure proc_1;
+prepare abc from "cache index t1 in non_existent_cache";
+
+create procedure proc_1() load index into cache t1 ignore leaves;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin load index into cache t1 ignore leaves; return
1; end|
+delimiter ;|
+prepare abc from "load index into cache t1 ignore leaves";
+
+#
+# Bug #21422: GRANT/REVOKE possible inside stored function, probably in a trigger
+# This is disabled for now till it is resolved in 5.0
+#
+
+#create procedure proc_1() grant all on *.* to abc@host;
+#drop procedure proc_1;
+#delimiter |;
+#--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+#create function func_1() returns int begin grant all on *.* to abc@host; return 1; end|
+#delimiter ;|
+#prepare abc from "grant all on *.* to abc@host";
+#
+#create procedure proc_1() revoke all on *.* from abc@host;
+#drop procedure proc_1;
+#delimiter |;
+#--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+#create function func_1() returns int begin revoke all on *.* from abc@host; return 1;
end|
+#delimiter ;|
+#prepare abc from "revoke all on *.* from abc@host";
+
+create procedure proc_1() show errors;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show errors; return 1; end|
+delimiter ;|
+prepare abc from "show errors";
+
+create procedure proc_1() show warnings;
+drop procedure proc_1;
+delimiter |;
+--error ER_SP_NO_RETSET
+create function func_1() returns int begin show warnings; return 1; end|
+delimiter ;|
+prepare abc from "show warnings";
+
+deallocate prepare abc;
+
--- 1.173/sql/sql_prepare.cc 2006-08-03 10:36:24 +02:00
+++ 1.174/sql/sql_prepare.cc 2006-08-03 10:36:24 +02:00
@@ -1740,6 +1740,20 @@
case SQLCOM_SHOW_ENGINE_MUTEX:
case SQLCOM_SHOW_CREATE_DB:
case SQLCOM_SHOW_GRANTS:
+ case SQLCOM_SHOW_BINLOG_EVENTS:
+ case SQLCOM_SHOW_MASTER_STAT:
+ case SQLCOM_SHOW_SLAVE_STAT:
+ case SQLCOM_SHOW_CREATE_PROC:
+ case SQLCOM_SHOW_CREATE_FUNC:
+ case SQLCOM_SHOW_CREATE_EVENT:
+ case SQLCOM_SHOW_CREATE:
+ case SQLCOM_SHOW_PROC_CODE:
+ case SQLCOM_SHOW_FUNC_CODE:
+ case SQLCOM_SHOW_AUTHORS:
+ case SQLCOM_SHOW_CONTRIBUTORS:
+ case SQLCOM_SHOW_WARNS:
+ case SQLCOM_SHOW_ERRORS:
+ case SQLCOM_SHOW_BINLOGS:
case SQLCOM_DROP_TABLE:
case SQLCOM_RENAME_TABLE:
case SQLCOM_ALTER_TABLE:
@@ -1754,6 +1768,25 @@
case SQLCOM_REPAIR:
case SQLCOM_ANALYZE:
case SQLCOM_OPTIMIZE:
+ case SQLCOM_CHANGE_MASTER:
+ case SQLCOM_RESET:
+ case SQLCOM_FLUSH:
+ case SQLCOM_SLAVE_START:
+ case SQLCOM_SLAVE_STOP:
+ case SQLCOM_INSTALL_PLUGIN:
+ case SQLCOM_UNINSTALL_PLUGIN:
+ case SQLCOM_CREATE_DB:
+ case SQLCOM_DROP_DB:
+ case SQLCOM_RENAME_DB:
+ case SQLCOM_CHECKSUM:
+ case SQLCOM_CREATE_USER:
+ case SQLCOM_RENAME_USER:
+ case SQLCOM_DROP_USER:
+ case SQLCOM_ASSIGN_TO_KEYCACHE:
+ case SQLCOM_PRELOAD_KEYS:
+ case SQLCOM_GRANT:
+ case SQLCOM_REVOKE:
+ case SQLCOM_KILL:
break;
default:
| Thread |
|---|
| • bk commit into 5.1 tree (andrey:1.2244) BUG#20665 | ahristov | 3 Aug |