diff options
author | unknown <timour/timka@lamia.home> | 2006-09-12 17:50:24 +0300 |
---|---|---|
committer | unknown <timour/timka@lamia.home> | 2006-09-12 17:50:24 +0300 |
commit | 900e66f89567d740c4290963825206ac8a672df8 (patch) | |
tree | 286e374656cd969885c91d0497b5c1d7551aee72 /sql/sql_parse.cc | |
parent | 01ec88dcd8d49aede05ba1f22270708d132f3ffe (diff) | |
download | mariadb-git-900e66f89567d740c4290963825206ac8a672df8.tar.gz |
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.
mysql-test/r/insert_select.result:
Test for BUG#21774.
mysql-test/t/insert_select.test:
Test for BUG#21774.
sql/sql_base.cc:
Do not reset the name resolution contect unconditionally.
Instead set the context to 'tables' only if it was not
set before calling setup_tables().
sql/sql_insert.cc:
Added asserts to make sure that in the case of INSERT ... VALUES ...
statements it is not necessary to reset the name resolution context
to the first table, because there is only one table in the list of
tables anyway. The actual code is not removed in order not to
confuse it with the actual bug fix.
sql/sql_parse.cc:
Removed unnecessary reset of the name resolution context.
The context is anyway unconditionally reset in mysql_insert()
and mysql_prepare_insert().
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0e3bd7934eb..905e8cdc71a 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3344,8 +3344,6 @@ end_with_restore_list: DBUG_ASSERT(first_table == all_tables && first_table != 0); if ((res= insert_precheck(thd, all_tables))) break; - /* Skip first table, which is the table we are inserting in */ - select_lex->context.table_list= first_table->next_local; if (!thd->locked_tables && !(need_start_waiting= !wait_if_global_read_lock(thd, 0, 1))) |