Commit 507c1ebb authored by MySQL Build Team's avatar MySQL Build Team

Backport into build-200909221805-5.1.37sp1

> ------------------------------------------------------------
> revno: 3068
> revision-id: ramil@mysql.com-20090813194928-3djdqvpock0pxhgp
> parent: li-bing.song@sun.com-20090813024857-1emgf5lhj0zikoj8
> committer: Ramil Kalimullin <ramil@mysql.com>
> branch nick: mysql-5.1-bugteam
> timestamp: Fri 2009-08-14 00:49:28 +0500
> message:
>   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().
parent 8ef621e1
......@@ -2141,4 +2141,16 @@ SELECT * FROM m1;
c1
DROP TABLE m1;
DROP TABLE t1;
#
# 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
......@@ -1555,4 +1555,15 @@ SELECT * FROM m1;
DROP TABLE m1;
DROP TABLE t1;
--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
......@@ -7098,8 +7098,6 @@ bool show_create_trigger(THD *thd, const sp_name *trg_name)
/* Perform closing actions and return error status. */
}
DBUG_ASSERT(num_tables == 1);
Table_triggers_list *triggers= lst->table->triggers;
if (!triggers)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment