From 0aabb89ee11a7492a0788470be9a6ba018152c9f Mon Sep 17 00:00:00 2001 From: "gshchepa/uchum@gleb.loc" <> Date: Sat, 10 Nov 2007 23:44:48 +0400 Subject: Fixed bug #28076: inconsistent binary/varbinary comparison. After adding an index the IN (SELECT ...) clause returned a wrong result: the VARBINARY value was illegally padded with zero bytes to the length of the BINARY column for the index search. (, ...) IN (SELECT , ... ) clauses are affected too. --- sql/sp_rcontext.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sql/sp_rcontext.cc') diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index ac7c46c9fe5..54e016f6099 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -503,14 +503,14 @@ sp_cursor::fetch(THD *thd, List *vars) */ Item_cache * -sp_rcontext::create_case_expr_holder(THD *thd, Item_result result_type) +sp_rcontext::create_case_expr_holder(THD *thd, const Item *item) { Item_cache *holder; Query_arena current_arena; thd->set_n_backup_active_arena(thd->spcont->callers_arena, ¤t_arena); - holder= Item_cache::get_cache(result_type); + holder= Item_cache::get_cache(item); thd->restore_active_arena(thd->spcont->callers_arena, ¤t_arena); @@ -559,7 +559,7 @@ sp_rcontext::set_case_expr(THD *thd, int case_expr_id, Item **case_expr_item_ptr case_expr_item->result_type()) { m_case_expr_holders[case_expr_id]= - create_case_expr_holder(thd, case_expr_item->result_type()); + create_case_expr_holder(thd, case_expr_item); } m_case_expr_holders[case_expr_id]->store(case_expr_item); -- cgit v1.2.1