From a07fd5fa8ff4b5b98fbe79b8e7301d5effaf9c2f Mon Sep 17 00:00:00 2001 From: "serg@janus.mylan" <> Date: Mon, 29 Jan 2007 10:40:26 +0100 Subject: WL#3700: Handler API change: all index search methods - that is, index_read(), index_read_idx(), index_read_last(), and records_in_range() - instead of 'uint keylen' argument take 'ulonglong keypart_map', a bitmap showing which keyparts are present in the key value. Fallback method is provided for handlers that are lagging behind. --- sql/sql_handler.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sql/sql_handler.cc') diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 91e61be0478..9c6c98cb151 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -515,7 +515,8 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, } List_iterator it_ke(*key_expr); Item *item; - for (key_len=0 ; (item=it_ke++) ; key_part++) + ulonglong keypart_map; + for (keypart_map= key_len=0 ; (item=it_ke++) ; key_part++) { my_bitmap_map *old_map; // 'item' can be changed by fix_fields() call @@ -532,6 +533,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, (void) item->save_in_field(key_part->field, 1); dbug_tmp_restore_column_map(table->write_set, old_map); key_len+=key_part->store_length; + keypart_map= (keypart_map << 1) | 1; } if (!(key= (byte*) thd->calloc(ALIGN_SIZE(key_len)))) @@ -540,7 +542,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, table->file->ha_index_init(keyno, 1); key_copy(key, table->record[0], table->key_info + keyno, key_len); error= table->file->index_read(table->record[0], - key,key_len,ha_rkey_mode); + key, keypart_map, ha_rkey_mode); mode=rkey_to_rnext[(int)ha_rkey_mode]; break; } -- cgit v1.2.1