diff options
-rw-r--r-- | mysql-test/r/sp.result | 8 | ||||
-rw-r--r-- | mysql-test/t/sp.test | 18 | ||||
-rw-r--r-- | sql/sp_head.cc | 5 |
3 files changed, 28 insertions, 3 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 91617d5681d..5bacffcb778 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2237,6 +2237,14 @@ Tables_in_test (foo) table_type Variable_name Value Level Code Message drop procedure bug4902| +drop table if exists t3| +create procedure bug4904() +begin +declare continue handler for sqlstate 'HY000' begin end; +create table t2 as select * from t; +end| +call bug4904()| +drop procedure bug4904| drop table if exists fac| create table fac (n int unsigned not null primary key, f bigint unsigned)| create procedure ifac(n int unsigned) diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 6e562fa79ce..ef2371f45cd 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -1717,6 +1717,24 @@ call bug4902()| drop procedure bug4902| +# +# BUG#4904 +# +--disable_warnings +drop table if exists t3| +--enable_warnings + +create procedure bug4904() +begin + declare continue handler for sqlstate 'HY000' begin end; + + create table t2 as select * from t; +end| + +call bug4904()| + +drop procedure bug4904| + # # Some "real" examples diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 987f20c23f6..6ba72215e39 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -486,8 +486,7 @@ sp_head::execute(THD *thd) continue; } } - } while (ret == 0 && !thd->killed && !thd->query_error && - !thd->net.report_error); + } while (ret == 0 && !thd->killed && !thd->query_error); if (thd->current_arena) cleanup_items(thd->current_arena->free_list); @@ -497,7 +496,7 @@ sp_head::execute(THD *thd) DBUG_PRINT("info", ("ret=%d killed=%d query_error=%d", ret, thd->killed, thd->query_error)); - if (thd->killed || thd->query_error || thd->net.report_error) + if (thd->killed || thd->query_error) ret= -1; /* If the DB has changed, the pointer has changed too, but the original thd->db will then have been freed */ |