2929 Konstantin Osipov 2009-11-21
Backport the test caes for Bug#36510 from 6.0-codebase.
@ mysql-test/t/sp-error.test
Backport test of Bug#36510 (the bug itself is fixed by other
backports, inc. SINGAL code).
modified:
mysql-test/r/sp-error.result
mysql-test/t/sp-error.test
2928 Konstantin Osipov 2009-11-20
Backport of:
------------------------------------------------------------
revno: 2572.23.1
committer: davi@stripped/endora.local
timestamp: Wed 2008-03-19 09:03:08 -0300
message:
Bug#17954 Threads_connected > Threads_created
The problem is that insert delayed threads are counted as connected
but not as created, leading to a Threads_connected value greater then
the Threads_created value.
The solution is to enforce the documented behavior that the
Threads_connected value shall be the number of currently
open connections and that Threads_created shall be the
number of threads created to handle connections.
@ mysql-test/r/status.result
Add test case result for Bug#17954
@ mysql-test/t/status.test
Add test case for Bug#17954
@ sql/mysqld.cc
Change Threads_connected to reflect the number of
open connections. SHOW_INT type variables are not
reset.
modified:
mysql-test/r/status.result
mysql-test/t/status.test
sql/mysqld.cc
=== modified file 'mysql-test/r/sp-error.result'
--- a/mysql-test/r/sp-error.result 2009-11-19 23:48:08 +0000
+++ b/mysql-test/r/sp-error.result 2009-11-20 22:42:57 +0000
@@ -1659,6 +1659,29 @@ begin
declare continue handler for sqlstate '00000' set @x=0;
end$$
ERROR 42000: Bad SQLSTATE: '00000'
+drop procedure if exists proc_36510;
+create procedure proc_36510()
+begin
+declare should_be_illegal condition for sqlstate '00123';
+declare continue handler for should_be_illegal set @x=0;
+end$$
+ERROR 42000: Bad SQLSTATE: '00123'
+create procedure proc_36510()
+begin
+declare continue handler for sqlstate '00123' set @x=0;
+end$$
+ERROR 42000: Bad SQLSTATE: '00123'
+create procedure proc_36510()
+begin
+declare should_be_illegal condition for 0;
+declare continue handler for should_be_illegal set @x=0;
+end$$
+ERROR HY000: Incorrect CONDITION value: '0'
+create procedure proc_36510()
+begin
+declare continue handler for 0 set @x=0;
+end$$
+ERROR HY000: Incorrect CONDITION value: '0'
drop procedure if exists p1;
set @old_recursion_depth = @@max_sp_recursion_depth;
set @@max_sp_recursion_depth = 255;
=== modified file 'mysql-test/t/sp-error.test'
--- a/mysql-test/t/sp-error.test 2009-11-19 23:48:08 +0000
+++ b/mysql-test/t/sp-error.test 2009-11-20 22:42:57 +0000
@@ -2420,6 +2420,43 @@ end$$
delimiter ;$$
#
+# Bug#36510 (Stored Procedures: mysql_error_code 0 should be illegal)
+#
+
+--disable_warnings
+drop procedure if exists proc_36510;
+--enable_warnings
+
+delimiter $$;
+
+--error ER_SP_BAD_SQLSTATE
+create procedure proc_36510()
+begin
+ declare should_be_illegal condition for sqlstate '00123';
+ declare continue handler for should_be_illegal set @x=0;
+end$$
+
+--error ER_SP_BAD_SQLSTATE
+create procedure proc_36510()
+begin
+ declare continue handler for sqlstate '00123' set @x=0;
+end$$
+
+--error ER_WRONG_VALUE
+create procedure proc_36510()
+begin
+ declare should_be_illegal condition for 0;
+ declare continue handler for should_be_illegal set @x=0;
+end$$
+
+--error ER_WRONG_VALUE
+create procedure proc_36510()
+begin
+ declare continue handler for 0 set @x=0;
+end$$
+delimiter ;$$
+
+#
# Bug#15192: "fatal errors" are caught by handlers in stored procedures
#
Attachment: [text/bzr-bundle] bzr/kostja@sun.com-20091120224257-1x4j0dl1t865gqnl.bundle
| Thread |
|---|
| • bzr push into mysql-5.6-next-mr branch (kostja:2928 to 2929) Bug#36510 | Konstantin Osipov | 20 Nov |