diff options
Diffstat (limited to 'mysql-test/t/warnings.test')
-rw-r--r-- | mysql-test/t/warnings.test | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index b3999e75dab..29714438835 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -241,3 +241,43 @@ insert into t1 values (1),(-1),(0),(-2); drop table t1; --echo End of 5.1 tests + +# +# Bug#55847: SHOW WARNINGS returns empty result set when SQLEXCEPTION is active +# + +--echo +--echo -- Bug#55847 +--echo + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +CREATE TABLE t1(a INT UNIQUE); + +delimiter |; + +CREATE FUNCTION f1(x INT) RETURNS INT +BEGIN + INSERT INTO t1 VALUES(x); + INSERT INTO t1 VALUES(x); + RETURN x; +END| + +delimiter ;| + +--echo + +--error ER_DUP_ENTRY +SHOW TABLES WHERE f1(11) = 11; + +--echo + +SHOW WARNINGS; + +--echo + +DROP TABLE t1; +DROP FUNCTION f1; |