summaryrefslogtreecommitdiff
path: root/storage/myisam/ha_myisam.cc
diff options
context:
space:
mode:
authorserg@janus.mylan <>2007-01-29 10:40:26 +0100
committerserg@janus.mylan <>2007-01-29 10:40:26 +0100
commita07fd5fa8ff4b5b98fbe79b8e7301d5effaf9c2f (patch)
treef14bd08181ddd81d2a41f06d9bf0f11d6edf53b5 /storage/myisam/ha_myisam.cc
parent045d7047095be717c94fd823252d513dad8c4478 (diff)
downloadmariadb-git-a07fd5fa8ff4b5b98fbe79b8e7301d5effaf9c2f.tar.gz
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.
Diffstat (limited to 'storage/myisam/ha_myisam.cc')
-rw-r--r--storage/myisam/ha_myisam.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 397856a4a4e..83180872f5f 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1203,34 +1203,37 @@ int ha_myisam::delete_row(const byte * buf)
return mi_delete(file,buf);
}
-int ha_myisam::index_read(byte * buf, const byte * key,
- uint key_len, enum ha_rkey_function find_flag)
+int ha_myisam::index_read(byte *buf, const byte *key, ulonglong keypart_map,
+ enum ha_rkey_function find_flag)
{
DBUG_ASSERT(inited==INDEX);
statistic_increment(table->in_use->status_var.ha_read_key_count,
&LOCK_status);
- int error=mi_rkey(file,buf,active_index, key, key_len, find_flag);
+ int error=mi_rkey(file, buf, active_index, key, keypart_map, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisam::index_read_idx(byte * buf, uint index, const byte * key,
- uint key_len, enum ha_rkey_function find_flag)
+int ha_myisam::index_read_idx(byte *buf, uint index, const byte *key,
+ ulonglong keypart_map,
+ enum ha_rkey_function find_flag)
{
statistic_increment(table->in_use->status_var.ha_read_key_count,
&LOCK_status);
- int error=mi_rkey(file,buf,index, key, key_len, find_flag);
+ int error=mi_rkey(file, buf, index, key, keypart_map, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
-int ha_myisam::index_read_last(byte * buf, const byte * key, uint key_len)
+int ha_myisam::index_read_last(byte *buf, const byte *key,
+ ulonglong keypart_map)
{
DBUG_ENTER("ha_myisam::index_read_last");
DBUG_ASSERT(inited==INDEX);
statistic_increment(table->in_use->status_var.ha_read_key_count,
&LOCK_status);
- int error=mi_rkey(file,buf,active_index, key, key_len, HA_READ_PREFIX_LAST);
+ int error=mi_rkey(file, buf, active_index, key, keypart_map,
+ HA_READ_PREFIX_LAST);
table->status=error ? STATUS_NOT_FOUND: 0;
DBUG_RETURN(error);
}
@@ -1338,7 +1341,7 @@ int ha_myisam::info(uint flag)
stats.index_file_length=info.index_file_length;
stats.delete_length = info.delete_length;
stats.check_time = info.check_time;
- stats. mean_rec_length=info.mean_reclength;
+ stats.mean_rec_length=info.mean_reclength;
}
if (flag & HA_STATUS_CONST)
{
@@ -1698,8 +1701,9 @@ void ha_myisam::get_auto_increment(ulonglong offset, ulonglong increment,
key_copy(key, table->record[0],
table->key_info + table->s->next_number_index,
table->s->next_number_key_offset);
- error= mi_rkey(file,table->record[1],(int) table->s->next_number_index,
- key,table->s->next_number_key_offset,HA_READ_PREFIX_LAST);
+ error= mi_rkey(file, table->record[1], (int) table->s->next_number_index,
+ key, make_prev_keypart_map(table->s->next_number_keypart),
+ HA_READ_PREFIX_LAST);
if (error)
nr= 1;
else