Bug #33515 Create trigger, partition, insert = crash
Submitted: 26 Dec 2007 13:29 Modified: 13 Jun 2008 16:09
Reporter: Philip Stoev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S1 (Critical)
Version:6.0.4 OS:Any
Assigned to: CPU Architecture:Any

[26 Dec 2007 13:29] Philip Stoev
Description:
If an (insert) trigger which inserts into a second table is created before a table is partitioned, an insert after the table is partitioned will cause a crash.

How to repeat:
CREATE TABLE trig_logs (entry_dsc VARCHAR(255));
CREATE TABLE part_tbl_i1 (id MEDIUMINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id));

DELIMITER //;
CREATE TRIGGER part_trig_i1_bi BEFORE INSERT ON part_tbl_i1 FOR EACH ROW
BEGIN
   INSERT INTO trig_logs (entry_dsc) VALUES ('a');
END//
DELIMITER ;//

ALTER TABLE part_tbl_i1 PARTITION BY KEY (id) PARTITIONS 2;
INSERT INTO part_tbl_i1 VALUES (NULL);
[26 Dec 2007 13:31] Philip Stoev
Backtrace:

0x824a171 handle_segfault + 441
0x81b68d0 _Z26get_partition_id_key_nosubP14partition_infoPjPx + 32
0x8312d17 _ZN12ha_partition9write_rowEPh + 79
0x830e798 _ZN7handler12ha_write_rowEPh + 24
0x82b8ade _Z12write_recordP3THDP8st_tableP12st_copy_info + 2090
0x82b7d82 _Z12mysql_insertP3THDP10TABLE_LISTR4ListI4ItemERS3_IS5_ES6_S6_15enum_duplicatesb + 2754
0x8256f3c _Z21mysql_execute_commandP3THD + 7676
0x825b59d _Z11mysql_parseP3THDPKcjPS2_ + 269
0x82540b5 _Z16dispatch_command19enum_server_commandP3THDPcj + 909
0x8253cf8 _Z10do_commandP3THD + 176
0x8252547 handle_one_connection + 287
[28 Jan 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[13 Jun 2008 16:09] Philip Stoev
Does not crash on 6.0.5 . Closing.