MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Ramil Kalimullin Date:August 13 2009 7:49pm
Subject:bzr commit into mysql-5.1-bugteam branch (ramil:3068) Bug#46614
View as plain text  
#At file:///home/ram/mysql/mysql-5.1-bugteam/ based on revid:li-bing.song@stripped

 3068 Ramil Kalimullin	2009-08-14
      Fix for bug #46614: Assertion in show_create_trigger() 
      on SHOW CREATE TRIGGER + MERGE table
      
      Problem: SHOW CREATE TRIGGER erroneously relies on fact
      that we have the only underlying table for a trigger
      (wrong for merge tables).
      
      Fix: remove erroneous assert().
     @ mysql-test/r/merge.result
        Fix for bug #46614: Assertion in show_create_trigger() 
        on SHOW CREATE TRIGGER + MERGE table
          - test result.
     @ mysql-test/t/merge.test
        Fix for bug #46614: Assertion in show_create_trigger() 
        on SHOW CREATE TRIGGER + MERGE table
          - test case.
     @ sql/sql_show.cc
        Fix for bug #46614: Assertion in show_create_trigger() 
        on SHOW CREATE TRIGGER + MERGE table
          - unnecessary assert() removed as we may have more than 1 
        tables open e.g. for a merge table.

    modified:
      mysql-test/r/merge.result
      mysql-test/t/merge.test
      sql/sql_show.cc
=== modified file 'mysql-test/r/merge.result'
--- a/mysql-test/r/merge.result	2009-07-30 10:34:41 +0000
+++ b/mysql-test/r/merge.result	2009-08-13 19:49:28 +0000
@@ -2207,4 +2207,16 @@ ERROR HY000: Table storage engine for 'm
 DROP TABLE m1,t1,t2,t3,t4,t5,t6,t7;
 SELECT 1 FROM m1;
 ERROR 42S02: Table 'test.m1' doesn't exist
+#
+# Bug #46614: Assertion in show_create_trigger()
+#
+CREATE TABLE t1(a int);
+CREATE TABLE t2(a int);
+CREATE TABLE t3(a int) ENGINE = MERGE UNION(t1, t2);
+CREATE TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo();
+SHOW CREATE TRIGGER tr1;
+Trigger	sql_mode	SQL Original Statement	character_set_client	collation_connection	Database Collation
+tr1		CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo()	latin1	latin1_swedish_ci	latin1_swedish_ci
+DROP TRIGGER tr1;
+DROP TABLE t1, t2, t3;
 End of 5.1 tests

=== modified file 'mysql-test/t/merge.test'
--- a/mysql-test/t/merge.test	2009-07-30 10:34:41 +0000
+++ b/mysql-test/t/merge.test	2009-08-13 19:49:28 +0000
@@ -1622,4 +1622,15 @@ DROP TABLE m1,t1,t2,t3,t4,t5,t6,t7;
 --error ER_NO_SUCH_TABLE
 SELECT 1 FROM m1; # Should not hang!
 
+--echo #
+--echo # Bug #46614: Assertion in show_create_trigger()
+--echo #
+CREATE TABLE t1(a int);
+CREATE TABLE t2(a int);
+CREATE TABLE t3(a int) ENGINE = MERGE UNION(t1, t2);
+CREATE TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo();
+SHOW CREATE TRIGGER tr1;
+DROP TRIGGER tr1;
+DROP TABLE t1, t2, t3;
+
 --echo End of 5.1 tests

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2009-07-29 14:58:31 +0000
+++ b/sql/sql_show.cc	2009-08-13 19:49:28 +0000
@@ -7071,8 +7071,6 @@ bool show_create_trigger(THD *thd, const
     /* Perform closing actions and return error status. */
   }
 
-  DBUG_ASSERT(num_tables == 1);
-
   Table_triggers_list *triggers= lst->table->triggers;
 
   if (!triggers)


Attachment: [text/bzr-bundle] bzr/ramil@mysql.com-20090813194928-3djdqvpock0pxhgp.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (ramil:3068) Bug#46614Ramil Kalimullin13 Aug