diff options
author | unknown <konstantin@mysql.com> | 2006-04-07 22:26:25 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2006-04-07 22:26:25 +0400 |
commit | 9b6e83f4b83abcd33c8cf20b95d3e3f4e7a7851a (patch) | |
tree | 08a1e94cef7b86ac1d24825210056d138d5029b4 /sql/item_row.h | |
parent | 00cfd1a75f97eefcd9bfd64c63ee84cd33c2f648 (diff) | |
download | mariadb-git-9b6e83f4b83abcd33c8cf20b95d3e3f4e7a7851a.tar.gz |
A fix and a test case for Bug#16248 "WHERE (col1,col2) IN ((?,?))
gives wrong results". Implement previously missing
Item_row::cleanup. The bug is not repeatable in 5.0, probably
due to a coincidence: the problem is present in 5.0 as well.
mysql-test/r/ps.result:
Update the result file (Bug#16248)
mysql-test/t/ps.test:
Add a test case for Bug#16248 "WHERE (col1,col2) IN ((?,?)) gives
wrong results"
sql/item_row.cc:
Implement Item_row::cleanup(): we should reset used_tables_cache
before reexecution of a prepared statement. In case ROW
arguments contain a placeholder, used_tables_cache has PARAM_TABLE
bit set in statement prepare. As a result, when executing a statement,
the condition push down algorithm (make_cond_for_table) would think
that the WHERE clause belongs to the non-existent PARAM_TABLE and
wouldn't attach the WHERE clause to any of the real tables,
effectively optimizing the clause away.
sql/item_row.h:
Remove a never used member 'array_holder'. Add declaration for
Item_row::cleanup.
Diffstat (limited to 'sql/item_row.h')
-rw-r--r-- | sql/item_row.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/item_row.h b/sql/item_row.h index 39bc4513e1e..28cb47b6815 100644 --- a/sql/item_row.h +++ b/sql/item_row.h @@ -19,7 +19,6 @@ class Item_row: public Item Item **items; table_map used_tables_cache; uint arg_count; - bool array_holder; bool const_item_cache; bool with_null; public: @@ -29,7 +28,6 @@ public: items(item->items), used_tables_cache(item->used_tables_cache), arg_count(item->arg_count), - array_holder(0), const_item_cache(item->const_item_cache), with_null(0) {} @@ -57,6 +55,7 @@ public: return 0; }; bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref); + void cleanup(); void split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields); table_map used_tables() const { return used_tables_cache; }; bool const_item() const { return const_item_cache; }; |