Below is the list of changes that have just been committed into a local
5.0 repository of pem. When pem 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
1.1963 05/09/06 16:36:00 pem@stripped +11 -0
Fixed BUG#12379: PROCEDURE with HANDLER calling FUNCTION with error
get strange result
Previously, failing stored functions would interrupt SELECT and return an
error, but this was inconsistent with how SELECT normally behaves, and it
doesn't work in the general case. (Which this bug shows.) Normally, SELECT
returns errors as warnings, and now we do this also for failing stored
functions.
The problem is that it doesn't actually work to catch errors from SELECT
with handlers as the reporter indended, but this is already a known
limitation with SELECT.
sql/item_func.cc
1.249 05/09/06 16:35:53 pem@stripped +9 -0
Don't report errors in SELECT when a stored function fails.
mysql-test/t/sp_trans.test
1.5 05/09/06 16:35:53 pem@stripped +6 -3
SELECT now always return errors as warnings. (BUG#12379)
mysql-test/t/sp.test
1.144 05/09/06 16:35:53 pem@stripped +45 -2
New test case for BUG#12379.
SELECT now always return errors as warnings.
mysql-test/t/sp-security.test
1.23 05/09/06 16:35:53 pem@stripped +4 -2
SELECT now always return errors as warnings. (BUG#12379)
mysql-test/t/sp-error.test
1.85 05/09/06 16:35:53 pem@stripped +18 -10
SELECT now always return errors as warnings. (BUG#12379)
mysql-test/t/sp-dynamic.test
1.2 05/09/06 16:35:53 pem@stripped +4 -3
SELECT now always return errors as warnings. (BUG#12379)
mysql-test/r/sp_trans.result
1.5 05/09/06 16:35:53 pem@stripped +66 -3
Updated results for BUG#12379: SELECT always returns errors as warnings.
mysql-test/r/sp.result
1.149 05/09/06 16:35:53 pem@stripped +49 -2
Updated results for BUG#12379: SELECT always returns errors as warnings.
mysql-test/r/sp-security.result
1.21 05/09/06 16:35:53 pem@stripped +10 -2
Updated results for BUG#12379: SELECT always returns errors as warnings.
mysql-test/r/sp-error.result
1.81 05/09/06 16:35:52 pem@stripped +57 -10
Updated results for BUG#12379: SELECT always returns errors as warnings.
mysql-test/r/sp-dynamic.result
1.2 05/09/06 16:35:52 pem@stripped +21 -3
Updated results for BUG#12379: SELECT always returns errors as warnings.
# 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: pem
# Host: mysql.comhem.se
# Root: /home/pem/work/mysql-5.0
--- 1.248/sql/item_func.cc 2005-09-03 01:13:09 +02:00
+++ 1.249/sql/item_func.cc 2005-09-06 16:35:53 +02:00
@@ -4728,6 +4728,15 @@
thd->reset_sub_statement_state(&statement_state, SUB_STMT_FUNCTION);
res= m_sp->execute_function(thd, args, arg_count, itp);
thd->restore_sub_statement_state(&statement_state);
+ /*
+ Reset net.report_error so we don't interrupt SELECT with errors, or
+ it will cause protocol errors in some cases.
+ This makes it behave like other errors during the execution of a SELECT,
+ where errors are sent as warnings instead and the SELECT is not interrupted.
+ QQ Remove this when SELECT error handling has been fixed!
+ */
+ if (thd->lex->sql_command == SQLCOM_SELECT)
+ thd->net.report_error= 0;
if (res && mysql_bin_log.is_open() &&
(m_sp->m_chistics->daccess == SP_CONTAINS_SQL ||
--- 1.1/mysql-test/r/sp-dynamic.result 2005-09-03 01:13:10 +02:00
+++ 1.2/mysql-test/r/sp-dynamic.result 2005-09-06 16:35:52 +02:00
@@ -131,11 +131,29 @@
return 1;
end|
select f1(0)|
-ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
+f1(0)
+NULL
+Warnings:
+Error 1336 Dynamic SQL is not allowed in stored function or trigger
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
select f1(f1(0))|
-ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
+f1(f1(0))
+NULL
+Warnings:
+Error 1336 Dynamic SQL is not allowed in stored function or trigger
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1336 Dynamic SQL is not allowed in stored function or trigger
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
select f1(f1(f1(0)))|
-ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
+f1(f1(f1(0)))
+NULL
+Warnings:
+Error 1336 Dynamic SQL is not allowed in stored function or trigger
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1336 Dynamic SQL is not allowed in stored function or trigger
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1336 Dynamic SQL is not allowed in stored function or trigger
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop function f1|
drop procedure p1|
create procedure p1()
--- 1.1/mysql-test/t/sp-dynamic.test 2005-09-03 01:13:11 +02:00
+++ 1.2/mysql-test/t/sp-dynamic.test 2005-09-06 16:35:53 +02:00
@@ -144,11 +144,12 @@
# allowed in a stored function or trigger, and here we get the
# corresponding error message.
---error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+# Note: These now give warnings instead of errors (select doesn't return error)
+#--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
select f1(0)|
---error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+#--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
select f1(f1(0))|
---error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+#--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
select f1(f1(f1(0)))|
drop function f1|
drop procedure p1|
--- 1.80/mysql-test/r/sp-error.result 2005-09-03 01:13:09 +02:00
+++ 1.81/mysql-test/r/sp-error.result 2005-09-06 16:35:52 +02:00
@@ -89,9 +89,17 @@
call p(1, 2)|
ERROR 42000: Incorrect number of arguments for PROCEDURE test.p; expected 1, got 2
select f()|
-ERROR 42000: Incorrect number of arguments for FUNCTION test.f; expected 1, got 0
+f()
+NULL
+Warnings:
+Error 1318 Incorrect number of arguments for FUNCTION test.f; expected 1, got 0
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
select f(1, 2)|
-ERROR 42000: Incorrect number of arguments for FUNCTION test.f; expected 1, got 2
+f(1, 2)
+NULL
+Warnings:
+Error 1318 Incorrect number of arguments for FUNCTION test.f; expected 1, got 2
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop procedure p|
drop function f|
create procedure p(val int, out res int)
@@ -134,7 +142,11 @@
end if;
end|
select f(10)|
-ERROR 2F005: FUNCTION f ended without RETURN
+f(10)
+NULL
+Warnings:
+Error 1321 FUNCTION f ended without RETURN
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop function f|
create procedure p()
begin
@@ -306,9 +318,23 @@
return 0;
end|
select val, f1(val) from t1|
-ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+val f1(val)
+42 NULL
+19 NULL
+Warnings:
+Error 1442 Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1442 Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
select val, f1(val) from t1 as tab|
-ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+val f1(val)
+42 NULL
+19 NULL
+Warnings:
+Error 1442 Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1442 Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
select * from t1|
val x
42 3.1
@@ -395,7 +421,11 @@
return 2;
end|
select bug3287()|
-ERROR 20000: Case not found for CASE statement
+bug3287()
+NULL
+Warnings:
+Error 1339 Case not found for CASE statement
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop function bug3287|
create procedure bug3287(x int)
case x
@@ -618,7 +648,11 @@
call bug8408_p()|
val x
select bug8408_f()|
-ERROR 0A000: Not allowed to return a result set from a function
+bug8408_f()
+NULL
+Warnings:
+Error 1415 Not allowed to return a result set from a function
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop procedure bug8408_p|
drop function bug8408_f|
create function bug8408() returns int
@@ -707,7 +741,12 @@
end if;
end|
select bug11394(2)|
-ERROR HY000: Recursive stored routines are not allowed.
+bug11394(2)
+NULL
+Warnings:
+Error 1424 Recursive stored routines are not allowed.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop function bug11394|
create function bug11394_1(i int) returns int
begin
@@ -718,7 +757,11 @@
end if;
end|
select bug11394_1(2)|
-ERROR HY000: Recursive stored routines are not allowed.
+bug11394_1(2)
+NULL
+Warnings:
+Error 1424 Recursive stored routines are not allowed.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop function bug11394_1|
create function bug11394_2(i int) returns int return i|
select bug11394_2(bug11394_2(10))|
@@ -755,6 +798,10 @@
10
drop function bug11834_1;
execute stmt;
-ERROR 42000: FUNCTION test.bug11834_1 does not exist
+bug11834_2()
+NULL
+Warnings:
+Error 1305 FUNCTION test.bug11834_1 does not exist
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
deallocate prepare stmt;
drop function bug11834_2;
--- 1.20/mysql-test/r/sp-security.result 2005-08-20 09:59:51 +02:00
+++ 1.21/mysql-test/r/sp-security.result 2005-09-06 16:35:53 +02:00
@@ -74,11 +74,19 @@
call db1_secret.stamp(5);
ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
select db1_secret.db();
-ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
+db1_secret.db()
+NULL
+Warnings:
+Error 1044 Access denied for user 'user1'@'localhost' to database 'db1_secret'
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
call db1_secret.stamp(6);
ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
select db1_secret.db();
-ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
+db1_secret.db()
+NULL
+Warnings:
+Error 1044 Access denied for user ''@'localhost' to database 'db1_secret'
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop database if exists db2;
create database db2;
use db2;
--- 1.148/mysql-test/r/sp.result 2005-08-27 12:29:29 +02:00
+++ 1.149/mysql-test/r/sp.result 2005-09-06 16:35:53 +02:00
@@ -2491,9 +2491,17 @@
return 'okay';
end|
select bug5278()|
-ERROR 42000: Can't find any matching row in the user table
+bug5278()
+NULL
+Warnings:
+Error 1133 Can't find any matching row in the user table
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
select bug5278()|
-ERROR 42000: Can't find any matching row in the user table
+bug5278()
+NULL
+Warnings:
+Error 1133 Can't find any matching row in the user table
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop function bug5278|
drop procedure if exists p1|
create table t3(id int)|
@@ -3167,6 +3175,45 @@
truncate t4|
drop table t3, t4|
drop procedure if exists bug12168|
+drop function if exists bug12379|
+drop procedure if exists bug12379_1|
+drop procedure if exists bug12379_2|
+drop table if exists t3|
+create table t3 (c1 char(1) primary key not null)|
+create function bug12379()
+returns integer
+begin
+insert into t3 values('X');
+insert into t3 values('X');
+return 0;
+end|
+create procedure bug12379_1()
+begin
+declare exit handler for sqlexception select 1;
+select myfunc();
+END|
+create procedure bug12379_2()
+begin
+declare exit handler for sqlexception begin end;
+select myfunc();
+end|
+select bug12379()|
+bug12379()
+NULL
+Warnings:
+Error 1062 Duplicate entry 'X' for key 1
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+call bug12379_1()|
+myfunc()
+NULL
+1
+1
+call bug12379_2()|
+myfunc()
+NULL
+drop function bug12379|
+drop procedure bug12379_1|
+drop procedure bug12379_2|
drop table if exists t3|
drop procedure if exists bug11333|
create table t3 (c1 char(128))|
--- 1.84/mysql-test/t/sp-error.test 2005-09-03 01:13:09 +02:00
+++ 1.85/mysql-test/t/sp-error.test 2005-09-06 16:35:53 +02:00
@@ -136,9 +136,10 @@
call p()|
--error 1318
call p(1, 2)|
---error 1318
+# Note: These now give warnings instead of errors (select doesn't return error)
+#--error 1318
select f()|
---error 1318
+#--error 1318
select f(1, 2)|
drop procedure p|
@@ -191,7 +192,8 @@
end if;
end|
---error 1321
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error 1321
select f(10)|
drop function f|
@@ -421,10 +423,11 @@
insert into t1 (val) values (i);
return 0;
end|
---error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+# Note: These now give warnings instead of errors (select doesn't return error)
+#--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
select val, f1(val) from t1|
# Table alias should not matter
---error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+#--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
select val, f1(val) from t1 as tab|
select * from t1|
--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
@@ -547,7 +550,8 @@
end case;
return 2;
end|
---error 1339
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error 1339
select bug3287()|
drop function bug3287|
@@ -875,7 +879,8 @@
select * from t1|
call bug8408_p()|
---error ER_SP_NO_RETSET
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error ER_SP_BADSELECT
select bug8408_f()|
drop procedure bug8408_p|
@@ -1016,7 +1021,8 @@
end|
# If we allow recursive functions without additional modifications
# this will crash server since Item for "IN" is not reenterable.
---error 1424
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error 1424
select bug11394(2)|
drop function bug11394|
create function bug11394_1(i int) returns int
@@ -1029,7 +1035,8 @@
end|
# The following statement will crash because some LEX members responsible
# for selects cannot be used in reentrant fashion.
---error 1424
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error 1424
select bug11394_1(2)|
drop function bug11394_1|
# Note that the following should be allowed since it does not contains
@@ -1081,7 +1088,8 @@
drop function bug11834_1;
# Attempt to execute statement should return proper error and
# should not crash server.
---error ER_SP_DOES_NOT_EXIST
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error ER_SP_DOES_NOT_EXIST
execute stmt;
deallocate prepare stmt;
drop function bug11834_2;
--- 1.22/mysql-test/t/sp-security.test 2005-08-20 09:59:51 +02:00
+++ 1.23/mysql-test/t/sp-security.test 2005-09-06 16:35:53 +02:00
@@ -123,7 +123,8 @@
# This should not work
--error 1044
call db1_secret.stamp(5);
---error 1044
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error 1044
select db1_secret.db();
#
@@ -134,7 +135,8 @@
# This should not work
--error 1044
call db1_secret.stamp(6);
---error 1044
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error 1044
select db1_secret.db();
#
--- 1.143/mysql-test/t/sp.test 2005-09-01 20:02:04 +02:00
+++ 1.144/mysql-test/t/sp.test 2005-09-06 16:35:53 +02:00
@@ -3121,9 +3121,7 @@
return 'okay';
end|
---error 1133
select bug5278()|
---error 1133
select bug5278()|
drop function bug5278|
@@ -3995,6 +3993,51 @@
truncate t4|
drop table t3, t4|
drop procedure if exists bug12168|
+
+#
+# BUG#12379: PROCEDURE with HANDLER calling FUNCTION with error get
+# strange result
+#
+--disable_warnings
+drop function if exists bug12379|
+drop procedure if exists bug12379_1|
+drop procedure if exists bug12379_2|
+drop table if exists t3|
+--enable_warnings
+
+create table t3 (c1 char(1) primary key not null)|
+
+create function bug12379()
+ returns integer
+begin
+ insert into t3 values('X');
+ insert into t3 values('X');
+ return 0;
+end|
+
+# QQ Note: The handlers will not actually catch while SELECT is sending
+# errors as "warnings". (A known limitation in SELECT.)
+create procedure bug12379_1()
+begin
+ declare exit handler for sqlexception select 1;
+
+ select myfunc();
+END|
+create procedure bug12379_2()
+begin
+ declare exit handler for sqlexception begin end;
+
+ select myfunc();
+end|
+
+select bug12379()|
+call bug12379_1()|
+call bug12379_2()|
+
+drop function bug12379|
+drop procedure bug12379_1|
+drop procedure bug12379_2|
+
#
# Bug #11333 "Stored Procedure: Memory blow up on repeated SELECT ... INTO
--- 1.4/mysql-test/r/sp_trans.result 2005-06-07 16:48:25 +02:00
+++ 1.5/mysql-test/r/sp_trans.result 2005-09-06 16:35:53 +02:00
@@ -153,11 +153,53 @@
end|
create procedure bug10015_8() alter table t1 add k int|
select *, bug10015_7() from t1|
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+id bug10015_7()
+1 NULL
+2 NULL
+3 NULL
+5 NULL
+6 NULL
+Warnings:
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop procedure bug10015_8|
create procedure bug10015_8() start transaction|
select *, bug10015_7() from t1|
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+id bug10015_7()
+1 NULL
+2 NULL
+3 NULL
+5 NULL
+6 NULL
+Warnings:
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop procedure bug10015_8|
create procedure bug10015_8() drop temporary table if exists t1_temp|
select *, bug10015_7() from t1|
@@ -170,7 +212,28 @@
drop procedure bug10015_8|
create procedure bug10015_8() commit|
select *, bug10015_7() from t1|
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+id bug10015_7()
+1 NULL
+2 NULL
+3 NULL
+5 NULL
+6 NULL
+Warnings:
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Error 1422 Explicit or implicit commit is not allowed in stored function or trigger.
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
+Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
drop procedure bug10015_8|
drop function bug10015_7|
drop table t1, t2|
--- 1.4/mysql-test/t/sp_trans.test 2005-06-07 16:48:25 +02:00
+++ 1.5/mysql-test/t/sp_trans.test 2005-09-06 16:35:53 +02:00
@@ -153,11 +153,13 @@
return 1;
end|
create procedure bug10015_8() alter table t1 add k int|
---error 1422
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error 1422
select *, bug10015_7() from t1|
drop procedure bug10015_8|
create procedure bug10015_8() start transaction|
---error 1422
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error 1422
select *, bug10015_7() from t1|
drop procedure bug10015_8|
# Again it is OK to drop temporary table
@@ -168,7 +170,8 @@
--enable_warnings
drop procedure bug10015_8|
create procedure bug10015_8() commit|
---error 1422
+# Note: This now give warnings instead of errors (select doesn't return error)
+#--error 1422
select *, bug10015_7() from t1|
drop procedure bug10015_8|
drop function bug10015_7|
| Thread |
|---|
| • bk commit into 5.0 tree (pem:1.1963) BUG#12379 | pem | 6 Sep |