mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
sql_base.cc:
Fixed bug #12470. A misplaced initialization of the cond_count counter resulted in a wrong calculation of it. This caused a memory corruption since this counter was used as a parameter of some memory allocation. view.test: Added a test case for bug #12470.
This commit is contained in:
@ -3660,6 +3660,7 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
|
||||
arena= 0; // For easier test
|
||||
|
||||
thd->set_query_id=1;
|
||||
select_lex->cond_count= 0;
|
||||
|
||||
for (table= tables; table; table= table->next_local)
|
||||
{
|
||||
@ -3667,7 +3668,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
|
||||
goto err_no_arena;
|
||||
}
|
||||
|
||||
select_lex->cond_count= 0;
|
||||
if (*conds)
|
||||
{
|
||||
thd->where="where clause";
|
||||
|
Reference in New Issue
Block a user