Bug #42640 | mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLES mode) | ||
---|---|---|---|
Submitted: | 6 Feb 2009 7:17 | Modified: | 15 May 2009 1:37 |
Reporter: | Guangbao Ni | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.1-bugteam, 5.1 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | INSERT..SELECT..LIMIT, regression, STRICT_TRANS_TABLES MODE |
[6 Feb 2009 7:17]
Guangbao Ni
[6 Feb 2009 8:35]
Sveta Smirnova
Thank you for the report. I can not repeat described behavior with 5.1-bugteam sources checked out today. Please indicate how you compile mysqld, provide configuration options you use and indicate operating system.
[6 Feb 2009 8:39]
Sveta Smirnova
No additional information needed: bug is repeatable if have binlog turned on. Test case for our test suite: --source include/have_log_bin.inc set @@SQL_MODE=STRICT_TRANS_TABLES; create table t1 (i int primary key); create table t2 (i int primary key); insert into t1 select * from t2 limit 1; Probably related to bug #42634, but backtrace is different.
[6 Feb 2009 8:45]
Sveta Smirnova
Bug was introduced after 5.1.31: with 5.1.31 INSERT just fails with "Statement is not safe to log in statement format."
[12 Mar 2009 7:16]
Guangbao Ni
Discussed with Jasonh, here the warning shouldn't be elevated error.
[12 Mar 2009 10: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/69015 2846 Guangbao Ni 2009-03-12 BUG#42640 mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLES mode) Mysql server crashes because unsafe statements warning is wrongly elevated to error, which is set the error status of Diagnostics_area of the thread in THD::binlog_query(). Yet the caller believes that binary logging shouldn't touch the status, so it will set the status also later by my_ok(), my_error() or my_message() seperately according to the execution result of the statement or transaction. But the status of Diagnostics_area of the thread is allowed to set only once. Fixed to clear the error wrongly set by binary logging, but keep the warning message.
[26 Mar 2009 19:21]
Konstantin Osipov
Review sent by email.
[2 Apr 2009 9:48]
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/71186 2835 Guangbao Ni 2009-04-02 Bug #42640 mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLES mode) Mysql server crashes because unsafe statements warning is wrongly elevated to error, which is set the error status of Diagnostics_area of the thread in THD::binlog_query(). Yet the caller believes that binary logging shouldn't touch the status, so it will set the status also later by my_ok(), my_error() or my_message() seperately according to the execution result of the statement or transaction. But the status of Diagnostics_area of the thread is allowed to set only once. Fixed by setting ER_BINLOG_UNSAFE_STATEMENT warning to NOTE level modified: mysql-test/suite/binlog/r/binlog_stm_ps.result mysql-test/suite/binlog/r/binlog_unsafe.result mysql-test/suite/binlog/t/binlog_unsafe.test sql/sql_class.cc
[3 Apr 2009 9:08]
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/71293 2836 Guangbao Ni 2009-04-03 for BUG#42640, change unsafe warning to NOTE level modified: mysql-test/suite/rpl/r/rpl_skip_error.result mysql-test/suite/rpl/r/rpl_stm_loadfile.result mysql-test/suite/rpl/r/rpl_udf.result
[3 Apr 2009 10:34]
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/71304 2853 Guangbao Ni 2009-04-03 BUG#42640 mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLESmode) Mysql server crashes because unsafe statements warning is wrongly elevated to error, which is set the error status of Diagnostics_area of the thread in THD::binlog_query(). Yet the caller believes that binary logging shouldn't touch the status, so it will set the status also later by my_ok(), my_error() or my_message() seperately according to the execution result of the statement or transaction. But the status of Diagnostics_area of the thread is allowed to set only once. Fixed to clear the error wrongly set by binary logging, but keep the warning message. modified: mysql-test/suite/binlog/r/binlog_stm_ps.result mysql-test/suite/binlog/r/binlog_unsafe.result mysql-test/suite/binlog/t/binlog_unsafe.test mysql-test/suite/rpl/r/rpl_skip_error.result mysql-test/suite/rpl/r/rpl_stm_loadfile.result mysql-test/suite/rpl/r/rpl_udf.result sql/sql_class.cc
[3 Apr 2009 10:46]
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/71307 3175 Guangbao Ni 2009-04-03 [merge] Merge patch from 5.1-bugteam for bug#42640 modified: mysql-test/suite/binlog/r/binlog_stm_ps.result mysql-test/suite/binlog/r/binlog_unsafe.result mysql-test/suite/binlog/t/binlog_unsafe.test mysql-test/suite/rpl/r/rpl_skip_error.result mysql-test/suite/rpl/r/rpl_stm_loadfile.result mysql-test/suite/rpl/r/rpl_udf.result sql/sql_class.cc
[7 Apr 2009 2:05]
Guangbao Ni
merged into mysql-5.1-bugteam and mysql-6.0-bugteam
[5 May 2009 19:40]
Bugs System
Pushed into 5.1.35 (revid:davi.arnaut@sun.com-20090505190206-9xmh7dlc6kom8exp) (version source revid:davi.arnaut@sun.com-20090505190206-9xmh7dlc6kom8exp) (merge vers: 5.1.35) (pib:6)
[6 May 2009 14:10]
Bugs System
Pushed into 6.0.12-alpha (revid:svoj@sun.com-20090506125450-yokcmvqf2g7jhujq) (version source revid:gni@mysql.com-20090403183234-0p092jet7271nwsc) (merge vers: 6.0.11-alpha) (pib:6)
[15 May 2009 1:37]
Paul DuBois
Noted in 5.1.35, 6.0.12 changelogs. Incorrect elevation of warning messages to error messages for unsafe statements caused a server crash.
[15 Jun 2009 8:27]
Bugs System
Pushed into 5.1.35-ndb-6.3.26 (revid:jonas@mysql.com-20090615074202-0r5r2jmi83tww6sf) (version source revid:jonas@mysql.com-20090615070837-9pccutgc7repvb4d) (merge vers: 5.1.35-ndb-6.3.26) (pib:6)
[15 Jun 2009 9:06]
Bugs System
Pushed into 5.1.35-ndb-7.0.7 (revid:jonas@mysql.com-20090615074335-9hcltksp5cu5fucn) (version source revid:jonas@mysql.com-20090615072714-rmfkvrbbipd9r32c) (merge vers: 5.1.35-ndb-7.0.7) (pib:6)
[15 Jun 2009 9:47]
Bugs System
Pushed into 5.1.35-ndb-6.2.19 (revid:jonas@mysql.com-20090615061520-sq7ds4yw299ggugm) (version source revid:jonas@mysql.com-20090615054654-ebgpz7elwu1xj36j) (merge vers: 5.1.35-ndb-6.2.19) (pib:6)
[10 Jul 2009 23:19]
Bugs System
Pushed into 5.1.37 (revid:build@mysql.com-20090710231213-9guqdu0avc0uwdkp) (version source revid:build@mysql.com-20090710231213-9guqdu0avc0uwdkp) (merge vers: 5.1.37) (pib:11)
[23 Jul 2009 10:24]
Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090723102221-ps4uaphwbxzj8p0q) (version source revid:joerg@mysql.com-20090721145751-rqqnhv0kage18wfi) (merge vers: 5.4.4-alpha) (pib:11)
[26 Aug 2009 13:46]
Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 2009 13:46]
Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 2009 13:48]
Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 2009 16:33]
Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)