diff options
author | konstantin@mysql.com <> | 2005-09-03 03:13:18 +0400 |
---|---|---|
committer | konstantin@mysql.com <> | 2005-09-03 03:13:18 +0400 |
commit | 38486e83c1ee11abb7c52ea6a215960aca0c92a8 (patch) | |
tree | 981df38c4f1f46f7080926e10ff505778048f4af /mysql-test/t/sp-error.test | |
parent | a3ddcdf8fbf2058eeae6d7db7f1dc99785329d7b (diff) | |
download | mariadb-git-38486e83c1ee11abb7c52ea6a215960aca0c92a8.tar.gz |
Implement WL#2661 "Prepared Statements: Dynamic SQL in Stored Procedures".
The idea of the patch is to separate statement processing logic,
such as parsing, validation of the parsed tree, execution and cleanup,
from global query processing logic, such as logging, resetting
priorities of a thread, resetting stored procedure cache, resetting
thread count of errors and warnings.
This makes PREPARE and EXECUTE behave similarly to the rest of SQL
statements and allows their use in stored procedures.
This patch contains a change in behaviour:
until recently for each SQL prepared statement command, 2 queries
were written to the general log, e.g.
[Query] prepare stmt from @stmt_text;
[Prepare] select * from t1 <-- contents of @stmt_text
The chagne was necessary to prevent [Prepare] commands from being written
to the general log when executing a stored procedure with Dynamic SQL.
We should consider whether the old behavior is preferrable and probably
restore it.
This patch refixes Bug#7115, Bug#10975 (partially), Bug#10605 (various bugs
in Dynamic SQL reported before it was disabled).
Diffstat (limited to 'mysql-test/t/sp-error.test')
-rw-r--r-- | mysql-test/t/sp-error.test | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 5921d59b284..e289748ba2f 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -875,7 +875,7 @@ create procedure bug8408_p() select * from t1| call bug8408_p()| ---error ER_SP_BADSELECT +--error ER_SP_NO_RETSET select bug8408_f()| drop procedure bug8408_p| @@ -956,39 +956,10 @@ end| drop procedure bug10969| -# -# BUG#NNNN: New bug synopsis -# -#--disable_warnings -#drop procedure if exists bugNNNN| -#--enable_warnings -#create procedure bugNNNN... - - drop table t1| delimiter ;| -# -# Bug#10975, #10605, #7115: Dynamic SQL by means of -# PREPARE/EXECUTE/DEALLOCATE is not supported yet. -# Check that an error message is returned. -# -prepare stmt from "select 1"; ---error ER_SP_BADSTATEMENT -create procedure p() deallocate prepare stmt; ---error ER_SP_BADSTATEMENT -create function f() returns int begin deallocate prepare stmt; ---error ER_SP_BADSTATEMENT -create procedure p() prepare stmt from "select 1"; ---error ER_SP_BADSTATEMENT -create function f() returns int begin prepare stmt from "select 1"; ---error ER_SP_BADSTATEMENT -create procedure p() execute stmt; ---error ER_SP_BADSTATEMENT -create function f() returns int begin execute stmt; -deallocate prepare stmt; - # BUG#9814: Closing a cursor that is not open create table t1(f1 int); create table t2(f1 int); @@ -1114,3 +1085,12 @@ drop function bug11834_1; execute stmt; deallocate prepare stmt; drop function bug11834_2; +# +# BUG#NNNN: New bug synopsis +# +#--disable_warnings +#drop procedure if exists bugNNNN| +#--enable_warnings +#create procedure bugNNNN... + + |