mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for BUG#21774: Column count doesn't match value count at row x
The cause of the bug was an incomplete fix for bug 18080. The problem was that setup_tables() unconditionally reset the name resolution context to its 'tables' argument, which pointed to the first table of an SQL statement. The bug fix limits resetting of the name resolution context in setup_tables() only in the cases when the context was not set by earlier parser/optimizer phases.
This commit is contained in:
@ -411,6 +411,15 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
||||
table= table_list->table;
|
||||
|
||||
context= &thd->lex->select_lex.context;
|
||||
/*
|
||||
These three asserts test the hypothesis that the resetting of the name
|
||||
resolution context below is not necessary at all since the list of local
|
||||
tables for INSERT always consists of one table.
|
||||
*/
|
||||
DBUG_ASSERT(!table_list->next_local);
|
||||
DBUG_ASSERT(!context->table_list->next_local);
|
||||
DBUG_ASSERT(!context->first_name_resolution_table->next_name_resolution_table);
|
||||
|
||||
/* Save the state of the current name resolution context. */
|
||||
ctx_state.save_state(context, table_list);
|
||||
|
||||
|
Reference in New Issue
Block a user