You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a patch for the bug#24449174 -- dropping a partition drops the trigger on 8.0.0.
In case there is a trigger assigned to a partitioned table, attempt to
drop the partition led to dropping any trigger associated with the table.
We solve this problem by moving triggers from old table definition to
a new one, before replacing former with the latter.
All places where dd::rename_table<dd::Table> is called were checked.
While doing it a dead block was detected that calls dd::rename_table.
The block is located in the function mysql_update_dd() and it was removed.
Additionally, the function sync_ddl_log() was dropped since it isn't called
anymore.
Copy file name to clipboardExpand all lines: mysql-test/r/trigger.result
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2624,3 +2624,20 @@ CREATE TRIGGER non_existent_db.trg1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN END;
2624
2624
ERROR 42000: Unknown database 'non_existent_db'
2625
2625
DROP TRIGGER non_existent_db.trg1;
2626
2626
ERROR 42000: Unknown database 'non_existent_db'
2627
+
#
2628
+
# Bug#24449174 - DROPPING A PARTITION DROPS THE TRIGGER ON 8.0.0
2629
+
#
2630
+
CREATE TABLE t1 (val INT NOT NULL) ENGINE=InnoDB
2631
+
PARTITION BY LIST(val) (
2632
+
PARTITION p1 VALUES IN (1,2,3),
2633
+
PARTITION p2 VALUES IN (4,5)
2634
+
);
2635
+
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW BEGIN END;
2636
+
SHOW CREATE TRIGGER t1_bi;
2637
+
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created
2638
+
t1_bi ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER `t1_bi` BEFORE INSERT ON `t1` FOR EACH ROW BEGIN END latin1 latin1_swedish_ci latin1_swedish_ci #
2639
+
ALTER TABLE t1 DROP PARTITION p1;
2640
+
SHOW CREATE TRIGGER t1_bi;
2641
+
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created
2642
+
t1_bi ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER `t1_bi` BEFORE INSERT ON `t1` FOR EACH ROW BEGIN END latin1 latin1_swedish_ci latin1_swedish_ci #
0 commit comments