From 11b1949303e032c517d31d87e7a18397c2f7480c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Jul 2010 16:59:10 +0300 Subject: [PATCH] Fixed an error in the creation of REF access method for materialized subquery execution, where the the REF buffer format was mistaken to be in record format instead of key format. The error was that the null byte for all fields of the record was in the front of the buffer, and not before each field data. --- sql/item_subselect.cc | 2 -- sql/sql_select.cc | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 454a3929f99..92cd23bb351 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -3957,8 +3957,6 @@ subselect_hash_sj_engine::make_unique_engine() Item_iterator_row it(item_in->left_expr); /* The only index on the temporary table. */ KEY *tmp_key= tmp_table->key_info; - /* Number of keyparts in tmp_key. */ - uint tmp_key_parts= tmp_key->key_parts; JOIN_TAB *tab; DBUG_ENTER("subselect_hash_sj_engine::make_unique_engine"); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 887196fed9b..7b9fd1362ed 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7925,7 +7925,7 @@ bool TABLE_REF::tmp_table_index_lookup_init(THD *thd, use that information instead. */ cur_ref_buff + null_count, - null_count ? key_buff : 0, + null_count ? cur_ref_buff : 0, cur_key_part->length, items[i], value); cur_ref_buff+= cur_key_part->store_length; }