MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:konstantin Date:July 18 2007 1:09pm
Subject:bk commit into 5.0 tree (kostja:1.2532) BUG#22427
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kostja. When kostja 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@stripped, 2007-07-18 17:09:03+04:00, kostja@bodhi.(none) +2 -0
  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.

  mysql-test/r/sp-prelocking.result@stripped, 2007-07-18 17:09:01+04:00, kostja@bodhi.(none) +22 -0
    Update results (Bug#22427)

  mysql-test/t/sp-prelocking.test@stripped, 2007-07-18 17:09:01+04:00, kostja@bodhi.(none) +23 -0
    Add a test case for Bug#22427 create table if not exists + stored 
    function results in inconsistent behavior

diff -Nrup a/mysql-test/r/sp-prelocking.result b/mysql-test/r/sp-prelocking.result
--- a/mysql-test/r/sp-prelocking.result	2007-05-18 12:29:02 +04:00
+++ b/mysql-test/r/sp-prelocking.result	2007-07-18 17:09:01 +04:00
@@ -267,4 +267,26 @@ drop table bug_27907_logs;
 insert into bug_27907_t1(a) values (1);
 ERROR 42S02: Table 'test.bug_27907_logs' doesn't exist
 drop table bug_27907_t1;
+
+Bug#22427 create table if not exists + stored function results in
+inconsistent behavior
+
+Add a test case, the bug itself was fixed by the patch for
+Bug#20662
+
+drop table if exists t1;
+drop function if exists f_bug22427;
+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();
+f_bug22427()
+1
+create table if not exists t1 select f_bug22427() as i;
+Warnings:
+Note	1050	Table 't1' already exists
+create table t1 select f_bug22427() as i;
+ERROR 42S01: Table 't1' already exists
+drop table t1;
+drop function f_bug22427;
 End of 5.0 tests
diff -Nrup a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test
--- a/mysql-test/t/sp-prelocking.test	2007-05-18 12:29:02 +04:00
+++ b/mysql-test/t/sp-prelocking.test	2007-07-18 17:09:01 +04:00
@@ -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
Thread
bk commit into 5.0 tree (kostja:1.2532) BUG#22427konstantin18 Jul