Bug #54812 | assert in Diagnostics_area::set_ok_status during EXPLAIN | ||
---|---|---|---|
Submitted: | 25 Jun 2010 14:58 | Modified: | 6 Jan 2011 2:40 |
Reporter: | Matthias Leich | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.1, 5.5 | OS: | Any |
Assigned to: | Jørgen Løland | CPU Architecture: | Any |
[25 Jun 2010 14:58]
Matthias Leich
[25 Jun 2010 15:03]
Matthias Leich
Archive with log and grammars
Attachment: problem.tgz (application/x-compressed-tar, text), 88.65 KiB.
[9 Nov 2010 9:09]
Jørgen Løland
Encountered a very similar trace with the WL5004_sql.yy grammar. Command used to test: ./runall.pl --mem --grammar=conf/runtime/WL5004_sql.yy --gendata=conf/runtime/WL5004_data.zz --basedir=/mysql/mysql-5.5-runtime --queries=10M --duration=36000 --threads=30 --reporter=Deadlock,Backtrace,Shutdown --mysqld=--lock-wait-timeout=1 Trace: ------ #8 0xb7444648 in *__GI___assert_fail (assertion=0x86fdad5 "! is_set()", file=0x86fd9f0 "mysql/mysql-5.5-runtime/sql/sql_error.cc", line=360, function=0x86fe060 "void Diagnostics_area::set_ok_status(THD*, ulonglong, ulonglong, const char*)") at assert.c:81 #9 0x081f1bec in Diagnostics_area::set_ok_status (this=0xa690dd3c, thd=0xa690bfc0, affected_rows_arg=0, last_insert_id_arg=0, message_arg=0x0) at mysql/mysql-5.5-runtime/sql/sql_error.cc:360 #10 0x081b6571 in my_ok (thd=0xa690bfc0, affected_rows=0, id=0, message=0x0) at mysql/mysql-5.5-runtime/sql/sql_class.h:2767 #11 0x081e34c8 in select_dumpvar::send_eof (this=0xb096dd8) at mysql/mysql-5.5-runtime/sql/sql_class.cc:2926 #12 0x0823f32a in JOIN::exec (this=0xa5daefa0) at mysql/mysql-5.5-runtime/sql/sql_select.cc:1869 #13 0x0824165a in mysql_select (thd=0xa690bfc0, rref_pointer_array=0xb0962f4, tables=0xb096a30, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147486464, result=0xb096dd8, unit=0xb095dc4, select_lex=0xb0961fc) at mysql/mysql-5.5-runtime/sql/sql_select.cc:2560 #14 0x0823a620 in handle_select (thd=0xa690bfc0, lex=0xb095d60, result=0xb096dd8, setup_tables_done_option=0) at mysql/mysql-5.5-runtime/sql/sql_select.cc:297 #15 0x08216d83 in execute_sqlcom_select (thd=0xa690bfc0, all_tables=0xb096a30) at mysql/mysql-5.5-runtime/sql/sql_parse.cc:4485 #16 0x0820f077 in mysql_execute_command (thd=0xa690bfc0) at mysql/mysql-5.5-runtime/sql/sql_parse.cc:2081 #17 0x0847ea63 in sp_instr_stmt::exec_core (this=0xb096e20, thd=0xa690bfc0, nextp=0xa6b08510) at mysql/mysql-5.5-runtime/sql/sp_head.cc:3159 #18 0x0847e29d in sp_lex_keeper::reset_lex_and_exec_core (this=0xb096e48, thd=0xa690bfc0, nextp=0xa6b08510, open_tables=false, instr=0xb096e20) at mysql/mysql-5.5-runtime/sql/sp_head.cc:2957
[9 Nov 2010 9:12]
Jørgen Løland
(continued - query that fails) ... #33 0x08218e08 in mysql_parse (thd=0xa690bfc0, rawbuf=0xb1745d0 "REPLACE INTO testdb_N . t1_view1_N ( `col_int_key` , `pk` , `col_int` ) SELECT `col_int_key` , `pk` , `col_int` FROM testdb_S . t1_base2_S AS A WHERE testdb_N . f1_2_N () = 6 AND `pk` = 3 LIMI"...,
[11 Nov 2010 12:07]
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/123597 3120 Jorgen Loland 2010-11-11 Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN Before the patch, send_eof() of some subclasses of select_result (e.g., select_send::send_eof()) could handle being called after an error had occured while others could not. In the bug, an ASSERT triggered because select_dumpvar::send_eof() was not well behaved after an error had occured, but the problem also applied to other subclasses of select_result. This patch uniforms send_eof() of all subclasses of select_result to handle being called after an error has occured. @ mysql-test/r/errors.result Add test for BUG#54812 @ mysql-test/t/errors.test Add test for BUG#54812 @ sql/sql_class.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured. @ sql/sql_insert.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured. @ sql/sql_update.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured.
[11 Nov 2010 15:13]
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/123634 3120 Jorgen Loland 2010-11-11 Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN Before the patch, send_eof() of some subclasses of select_result (e.g., select_send::send_eof()) could handle being called after an error had occured while others could not. The methods that were not well-behaved would trigger an ASSERT on debug builds. Release builds were not affected. In the bug, an ASSERT triggered because select_dumpvar::send_eof() was not well behaved after an error had occured, but the problem also applied to other subclasses of select_result. This patch uniforms send_eof() of all subclasses of select_result to handle being called after an error has occured. @ sql/sql_class.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured. @ sql/sql_insert.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured. @ sql/sql_prepare.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured. @ sql/sql_update.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured.
[11 Nov 2010 15:25]
Jon Olav Hauglid
Patch approved with minor comments discussed on IRC.
[11 Nov 2010 15:32]
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/123639 3120 Jorgen Loland 2010-11-11 Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN Before the patch, send_eof() of some subclasses of select_result (e.g., select_send::send_eof()) could handle being called after an error had occured while others could not. The methods that were not well-behaved would trigger an ASSERT on debug builds. Release builds were not affected. Consider the following query as an example for how the ASSERT could be triggered: A user without execute privilege on f() does SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1; resulting in "ERROR 42000: execute command denied to user..." The server would end the query by calling send_eof(). The fact that the error had occured would make the ASSERT trigger. select_dumpvar::send_eof() was the offending method in the bug report, but the problem also applied to other subclasses of select_result. This patch uniforms send_eof() of all subclasses of select_result to handle being called after an error has occured. @ mysql-test/r/not_embedded_server.result Added test for BUG#54812 @ mysql-test/t/not_embedded_server.test Added test for BUG#54812 @ sql/sql_class.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured. @ sql/sql_insert.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured. @ sql/sql_prepare.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured. @ sql/sql_update.cc Make send_eof() of all subclasses of select_result handle being called after an error has occured.
[12 Nov 2010 13:41]
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/123727 3121 Jorgen Loland 2010-11-12 Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN Before the patch, send_eof() of some subclasses of select_result (e.g., select_send::send_eof()) could handle being called after an error had occured while others could not. The methods that were not well-behaved would trigger an ASSERT on debug builds. Release builds were not affected. Consider the following query as an example for how the ASSERT could be triggered: A user without execute privilege on f() does SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1; resulting in "ERROR 42000: execute command denied to user..." The server would end the query by calling send_eof(). The fact that the error had occured would make the ASSERT trigger. select_dumpvar::send_eof() was the offending method in the bug report, but the problem also applied to other subclasses of select_result. This patch uniforms send_eof() of all subclasses of select_result to handle being called after an error has occured. @ mysql-test/r/not_embedded_server.result Added test for BUG#54812 @ mysql-test/t/not_embedded_server.test Added test for BUG#54812 @ sql/sql_class.cc send_eof() of all subclasses of select_result can now handle being called after an error has occured. @ sql/sql_insert.cc send_eof() of all subclasses of select_result can now handle being called after an error has occured. @ sql/sql_prepare.cc send_eof() of all subclasses of select_result can now handle being called after an error has occured. @ sql/sql_update.cc send_eof() of all subclasses of select_result can now handle being called after an error has occured.
[15 Nov 2010 15:18]
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/123928 3124 Jorgen Loland 2010-11-15 Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN Before the patch, send_eof() of some subclasses of select_result (e.g., select_send::send_eof()) could handle being called after an error had occured while others could not. The methods that were not well-behaved would trigger an ASSERT on debug builds. Release builds were not affected. Consider the following query as an example for how the ASSERT could be triggered: A user without execute privilege on f() does SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1; resulting in "ERROR 42000: execute command denied to user..." The server would end the query by calling send_eof(). The fact that the error had occured would make the ASSERT trigger. select_dumpvar::send_eof() was the offending method in the bug report, but the problem also applied to other subclasses of select_result. This patch uniforms send_eof() of all subclasses of select_result to handle being called after an error has occured. @ mysql-test/r/not_embedded_server.result Added test for BUG#54812 @ mysql-test/t/not_embedded_server.test Added test for BUG#54812 @ sql/sql_class.cc send_eof() of all subclasses of select_result can now handle being called after an error has occured. @ sql/sql_insert.cc send_eof() of all subclasses of select_result can now handle being called after an error has occured. Also fix call to abort() in select_create::send_eof(), which was supposed to abort the result set, not terminate the server. This call to abort() should have been changed when the function was renamed from abort_result_set() but was forgotten. New test case added by BUG#54812 covered this line and terminated server. @ sql/sql_prepare.cc send_eof() of all subclasses of select_result can now handle being called after an error has occured. @ sql/sql_update.cc send_eof() of all subclasses of select_result can now handle being called after an error has occured.
[15 Nov 2010 15:35]
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/123932 3341 Jorgen Loland 2010-11-15 [merge] Merge BUG#54812 from 5.5-bugteam to trunk-bugfixing. No conflicts.
[15 Nov 2010 15:37]
Jørgen Løland
Pushed to 5.5-bugteam, merged to trunk-bugfixing
[5 Dec 2010 12:41]
Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (version source revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (merge vers: 5.6.1) (pib:23)
[16 Dec 2010 22:31]
Bugs System
Pushed into mysql-5.5 5.5.9 (revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (version source revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (merge vers: 5.5.9) (pib:24)
[6 Jan 2011 2:40]
Paul DuBois
Noted in 5.5.8 changelog. In debug builds, an assertion could be raised if a send_eof() method was called after an error occurred.