Bug #22338 | Valgrind warning: uninitialized variable in create_tmp_table | ||
---|---|---|---|
Submitted: | 14 Sep 2006 10:44 | Modified: | 3 Oct 2006 19:42 |
Reporter: | Timour Katchaounov | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.x | OS: | |
Assigned to: | Dmitry Lenev | CPU Architecture: | Any |
Tags: | valgrind |
[14 Sep 2006 10:44]
Timour Katchaounov
[14 Sep 2006 13:06]
Timour Katchaounov
The warning is caused by the line: if (!group && !thd->lex->current_select->with_sum_func) in create_tmp_table(), sql_select.cc. I already chcked that: * removing "thd->lex->current_select->with_sum_func" results in removing the valgrind warning, so it is for sure that the memeber SELECT_LEX::with_sum_func is not initialized in this case. Most likely the cause for this is wrong or incomplete or partly uninitialized SELECT_LEX object. * when valgrind issues the warning, the mehtod SELECT_LEX::init_select() was not called for the "thd->lex->current_select", which might be the cause of the bug (normally this method should be called for every new select).
[24 Sep 2006 13:36]
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/12447 ChangeSet@1.2273, 2006-09-24 17:36:59+04:00, dlenev@mockturtle.local +1 -0 Proposed fix for bug#22338 "Valgrind warning: uninitialized variable in create_tmp_table()". The fix for bug 21787 "COUNT(*) + ORDER BY + LIMIT returns wrong result" introduced valgrind warnings which occured during execution of information_schema.test and sp-prelocking.test. There were no user visible effects. The latter fix made create_tmp_table() dependant on THD::lex::current_select value. Valgrind warnings occured when this function was executed and THD::lex::current_select member pointed to uninitialized SELECT_LEX instance. The proposed fix tries to remove this dependancy by moving some logic outside of create_tmp_table() function. Question for reviewer is marked by QQ.
[28 Sep 2006 19:47]
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/12771 ChangeSet@1.2553, 2006-09-28 23:47:49+04:00, dlenev@mockturtle.local +1 -0 Fix for bug#22338 "Valgrind warning: uninitialized variable in create_tmp_table()". The fix for bug 21787 "COUNT(*) + ORDER BY + LIMIT returns wrong result" introduced valgrind warnings which occured during execution of information_schema.test and sp-prelocking.test in version 5.0. There were no user visible effects. The latter fix made create_tmp_table() dependant on THD::lex::current_select value. Valgrind warnings occured when this function was executed and THD::lex::current_select member pointed to uninitialized SELECT_LEX instance. This fix tries to remove this dependancy by moving some logic outside of create_tmp_table() function.
[3 Oct 2006 19:42]
Dmitry Lenev
Bug #22938 was marked as duplicate of this bug. This bug was fixed in 4.1.22, 5.0.27 and 5.1.12. ChangeLog entry is not needed as this bug should not have any user observable effects.