summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-prelocking.test
diff options
context:
space:
mode:
authorkostja@bodhi.(none) <>2007-07-18 17:09:03 +0400
committerkostja@bodhi.(none) <>2007-07-18 17:09:03 +0400
commit198b97a62579c73bd455bc476822230324de8a34 (patch)
treeaa5df5cea2fb2b599ff0a7b601d03909896007db /mysql-test/t/sp-prelocking.test
parent9bac763cc153cd4e5221c7baf3e5b0cf8e829b50 (diff)
downloadmariadb-git-198b97a62579c73bd455bc476822230324de8a34.tar.gz
Add a test case for Bug#22427 create table if not exists + stored
function results in inconsistent behavior. The bug itself was fixed by the patch for bug 20662.
Diffstat (limited to 'mysql-test/t/sp-prelocking.test')
-rw-r--r--mysql-test/t/sp-prelocking.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test
index ec5b7fbad7c..60e97260839 100644
--- a/mysql-test/t/sp-prelocking.test
+++ b/mysql-test/t/sp-prelocking.test
@@ -333,4 +333,27 @@ insert into bug_27907_t1(a) values (1);
drop table bug_27907_t1;
+--echo
+--echo Bug#22427 create table if not exists + stored function results in
+--echo inconsistent behavior
+--echo
+--echo Add a test case, the bug itself was fixed by the patch for
+--echo Bug#20662
+--echo
+--disable_warnings
+drop table if exists t1;
+drop function if exists f_bug22427;
+--enable_warnings
+create table t1 (i int);
+insert into t1 values (1);
+create function f_bug22427() returns int return (select max(i) from t1);
+select f_bug22427();
+# Until this bug was fixed, the following emitted error
+# ERROR 1213: Deadlock found when trying to get lock
+create table if not exists t1 select f_bug22427() as i;
+--error ER_TABLE_EXISTS_ERROR
+create table t1 select f_bug22427() as i;
+drop table t1;
+drop function f_bug22427;
+
--echo End of 5.0 tests