Bug #47150 | Assertion in Field_long::val_int() on MERGE + TRIGGER + multi-table UPDATE | ||
---|---|---|---|
Submitted: | 5 Sep 2009 11:13 | Modified: | 18 Dec 2009 23:52 |
Reporter: | Philip Stoev | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 5.1,5.4 | OS: | Any |
Assigned to: | Sergei Glukhov | CPU Architecture: | Any |
[5 Sep 2009 11:13]
Philip Stoev
[22 Sep 2009 11:23]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/84104 3124 Sergey Glukhov 2009-09-22 Bug#47150 Assertion in Field_long::val_int() on MERGE + TRIGGER + multi-table UPDATE On PREPARE stage(see test case) we call mark_common_columns() func which creates ON condition for NATURAL JOIN and sets appropriate table read_set bitmaps for fields which are used in ON condition. On EXECUTE stage mark_common_columns() is not called, we set necessary read_set bitmaps in setup_conds(). But 'B.f1' field is already processed and related item alredy fixed before setup_conds() as updated field and setup_conds can not set read_set bitmap because of that. The fix is to set read_set bitmap in Item_direct_view_ref for appropriate field even if the item is fixed. @ mysql-test/r/join.result test result @ mysql-test/t/join.test test case @ sql/item.cc On PREPARE stage(see test case) we call mark_common_columns() func which creates ON condition for NATURAL JOIN and sets appropriate table read_set bitmaps for fields which are used in ON condition. On EXECUTE stage mark_common_columns() is not called, we set necessary read_set bitmaps in setup_conds(). But 'B.f1' field is already processed and related item alredy fixed before setup_conds() as updated field and setup_conds can not set read_set bitmap because of that. The fix is to set read_set bitmap in Item_direct_view_ref for appropriate field even if the item is fixed.
[28 Sep 2009 7:11]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/84789 3124 Sergey Glukhov 2009-09-28 Bug#47150 Assertion in Field_long::val_int() on MERGE + TRIGGER + multi-table UPDATE The bug is not related to MERGE table or TRIGGER. More correct description would be 'assertion on multi-table UPDATE + NATURAL JOIN + MERGEABLE VIEW'. On PREPARE stage(see test case) we call mark_common_columns() func which creates ON condition for NATURAL JOIN and sets appropriate table read_set bitmaps for fields which are used in ON condition. On EXECUTE stage mark_common_columns() is not called, we set necessary read_set bitmaps in setup_conds(). But 'B.f1' field is already processed and related item alredy fixed before setup_conds() as updated field and setup_conds can not set read_set bitmap because of that. The fix is to set read_set bitmap for appropriate table field even if Item_direct_view_ref item which represents a refernce to this field is fixed. @ mysql-test/r/join.result test result @ mysql-test/t/join.test test case @ sql/item.cc The bug is not related to MERGE table or TRIGGER. More correct description would be 'assertion on multi-table UPDATE + NATURAL JOIN + MERGEABLE VIEW'. On PREPARE stage(see test case) we call mark_common_columns() func which creates ON condition for NATURAL JOIN and sets appropriate table read_set bitmaps for fields which are used in ON condition. On EXECUTE stage mark_common_columns() is not called, we set necessary read_set bitmaps in setup_conds(). But 'B.f1' field is already processed and related item alredy fixed before setup_conds() as updated field and setup_conds can not set read_set bitmap because of that. The fix is to set read_set bitmap for appropriate table field even if Item_direct_view_ref item which represents a refernce to this field is fixed.
[28 Sep 2009 13:22]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/84858 3139 Sergey Glukhov 2009-09-28 Bug#47150 Assertion in Field_long::val_int() on MERGE + TRIGGER + multi-table UPDATE The bug is not related to MERGE table or TRIGGER. More correct description would be 'assertion on multi-table UPDATE + NATURAL JOIN + MERGEABLE VIEW'. On PREPARE stage(see test case) we call mark_common_columns() func which creates ON condition for NATURAL JOIN and sets appropriate table read_set bitmaps for fields which are used in ON condition. On EXECUTE stage mark_common_columns() is not called, we set necessary read_set bitmaps in setup_conds(). But 'B.f1' field is already processed and related item alredy fixed before setup_conds() as updated field and setup_conds can not set read_set bitmap because of that. The fix is to set read_set bitmap for appropriate table field even if Item_direct_view_ref item which represents a refernce to this field is fixed. @ mysql-test/r/join.result test result @ mysql-test/t/join.test test case @ sql/item.cc The bug is not related to MERGE table or TRIGGER. More correct description would be 'assertion on multi-table UPDATE + NATURAL JOIN + MERGEABLE VIEW'. On PREPARE stage(see test case) we call mark_common_columns() func which creates ON condition for NATURAL JOIN and sets appropriate table read_set bitmaps for fields which are used in ON condition. On EXECUTE stage mark_common_columns() is not called, we set necessary read_set bitmaps in setup_conds(). But 'B.f1' field is already processed and related item alredy fixed before setup_conds() as updated field and setup_conds can not set read_set bitmap because of that. The fix is to set read_set bitmap for appropriate table field even if Item_direct_view_ref item which represents a refernce to this field is fixed.
[29 Sep 2009 3:23]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/84927 3144 Sergey Glukhov 2009-09-29 Bug#47150 Assertion in Field_long::val_int() on MERGE + TRIGGER + multi-table UPDATE The bug is not related to MERGE table or TRIGGER. More correct description would be 'assertion on multi-table UPDATE + NATURAL JOIN + MERGEABLE VIEW'. On PREPARE stage(see test case) we call mark_common_columns() func which creates ON condition for NATURAL JOIN and sets appropriate table read_set bitmaps for fields which are used in ON condition. On EXECUTE stage mark_common_columns() is not called, we set necessary read_set bitmaps in setup_conds(). But 'B.f1' field is already processed and related item alredy fixed before setup_conds() as updated field and setup_conds can not set read_set bitmap because of that. The fix is to set read_set bitmap for appropriate table field even if Item_direct_view_ref item which represents a refernce to this field is fixed. @ mysql-test/r/join.result test result @ mysql-test/t/join.test test case @ sql/item.cc The bug is not related to MERGE table or TRIGGER. More correct description would be 'assertion on multi-table UPDATE + NATURAL JOIN + MERGEABLE VIEW'. On PREPARE stage(see test case) we call mark_common_columns() func which creates ON condition for NATURAL JOIN and sets appropriate table read_set bitmaps for fields which are used in ON condition. On EXECUTE stage mark_common_columns() is not called, we set necessary read_set bitmaps in setup_conds(). But 'B.f1' field is already processed and related item alredy fixed before setup_conds() as updated field and setup_conds can not set read_set bitmap because of that. The fix is to set read_set bitmap for appropriate table field even if Item_direct_view_ref item which represents a refernce to this field is fixed.
[6 Oct 2009 9:00]
Bugs System
Pushed into 5.1.40 (revid:joro@sun.com-20091006073316-lea2cpijh9r6on7c) (version source revid:sergey.glukhov@sun.com-20090929022338-1t6w2ecpg0j6u1p1) (merge vers: 5.1.40) (pib:11)
[14 Oct 2009 15:37]
Paul DuBois
Noted in 5.1.40 changelog. A multiple-table UPDATE involving a natural join and a mergeable view raised an assertion. Setting report to NDI pending push into 5.5.x+.
[22 Oct 2009 6:35]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091022063126-l0qzirh9xyhp0bpc) (version source revid:alik@sun.com-20091019135554-s1pvptt6i750lfhv) (merge vers: 6.0.14-alpha) (pib:13)
[22 Oct 2009 7:07]
Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091022060553-znkmxm0g0gm6ckvw) (version source revid:alik@sun.com-20091013094238-g67x6tgdm9a7uik0) (merge vers: 5.5.0-beta) (pib:13)
[22 Oct 2009 19:42]
Paul DuBois
Noted in 5.5.0, 6.0.14 changelogs.
[18 Dec 2009 10:34]
Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:49]
Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 11:05]
Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:19]
Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)
[10 Sep 2014 6:56]
Roel Van de Paar
Just FYI, this bug is still present in MySQL 5.6.20 2014-09-10 19:47:39 19032 [Note] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug: ready for connections. Version: '5.6.20-debug-log' socket: '/sda/324483/current1_1/tmp/master.sock' port: 13000 MySQL Community Server (GPL) mysqld-debug: /bzr/mysql-5.6/sql/field.cc:3819: virtual longlong Field_long::val_int(): Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed. 16:51:04 UTC - mysqld got signal 6 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. key_buffer_size=1048576 read_buffer_size=131072 max_used_connections=4 max_threads=151 thread_count=2 connection_count=2 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 61081 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x7fefe3a54000 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 7ff01738be20 thread_stack 0x40000 /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(my_print_stacktrace+0x35)[0xa902dc] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(handle_fatal_signal+0x3f3)[0x7234a3] /lib64/libpthread.so.0(+0xf130)[0x7ff016dd8130] /lib64/libc.so.6(gsignal+0x39)[0x7ff015be1989] /lib64/libc.so.6(abort+0x148)[0x7ff015be3098] /lib64/libc.so.6(+0x2e8f6)[0x7ff015bda8f6] /lib64/libc.so.6(+0x2e9a2)[0x7ff015bda9a2] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_ZN10Field_long7val_intEv+0x75)[0x8f727f] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_ZN12ha_partition28set_auto_increment_if_higherEP5Field+0x33)[0xe147b5] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_ZN12ha_partition10update_rowEPKhPh+0x4dc)[0xe0a1d4] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_ZN7handler13ha_update_rowEPKhPh+0x165)[0x6421ab] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z12mysql_updateP3THDP10TABLE_LISTR4ListI4ItemES6_PS4_jP8st_ordery15enum_duplicatesbPySB_+0x1bf6)[0x85f1fe] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z21mysql_execute_commandP3THD+0x272a)[0x7d1052] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z11mysql_parseP3THDPcjP12Parser_state+0x485)[0x7d8fa4] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z16dispatch_command19enum_server_commandP3THDPcj+0xcbe)[0x7cc557] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z10do_commandP3THD+0x33e)[0x7cb646] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z24do_handle_one_connectionP3THD+0x1b6)[0x793a61] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(handle_one_connection+0x33)[0x79354a] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(pfs_spawn_thread+0x159)[0xade888] /lib64/libpthread.so.0(+0x7df3)[0x7ff016dd0df3] /lib64/libc.so.6(clone+0x6d)[0x7ff015ca23dd] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (7fefd5c20010): UPDATE `view_table500_innodb_compressed_key_pk_parts_2_int` SET `c21` = 2 WHERE `pk` >= 'b' Connection ID (thread ID): 9 Status: NOT_KILLED
[10 Sep 2014 6:56]
Roel Van de Paar
Maybe a missed code path?
[10 Sep 2014 6:59]
Roel Van de Paar
Maybe different assert. In any case, logged as bug #73869