summaryrefslogtreecommitdiff
path: root/sql/ha_berkeley.cc
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-09-14 17:59:05 +0300
committermonty@hundin.mysql.fi <>2001-09-14 17:59:05 +0300
commit008472f3737bee96fb77f20726fb4478044ac81d (patch)
tree7e952862e45ea1418eb96e1cbd225a646acd0849 /sql/ha_berkeley.cc
parentc946439d6c8d402a0a1a2a6520760dab16648c21 (diff)
downloadmariadb-git-008472f3737bee96fb77f20726fb4478044ac81d.tar.gz
Fixed problem with "record not found" in BDB tables.
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r--sql/ha_berkeley.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 9a437607729..10866a1872b 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -365,11 +365,9 @@ berkeley_cmp_packed_key(DB *file, const DBT *new_key, const DBT *saved_key)
{
if (*new_key_ptr != *saved_key_ptr++)
return ((int) *new_key_ptr - (int) saved_key_ptr[-1]);
+ key_length--;
if (!*new_key_ptr++)
- {
- key_length--;
continue;
- }
}
if ((cmp=key_part->field->pack_cmp(new_key_ptr,saved_key_ptr,
key_part->length)))
@@ -1399,7 +1397,7 @@ int ha_berkeley::index_read_idx(byte * buf, uint keynr, const byte * key,
statistic_increment(ha_read_key_count,&LOCK_status);
DBUG_ENTER("index_read_idx");
current_row.flags=DB_DBT_REALLOC;
- active_index= -1;
+ active_index= (uint) -1;
DBUG_RETURN(read_row(key_file[keynr]->get(key_file[keynr], transaction,
pack_key(&last_key, keynr, key_buff, key,
key_len),
@@ -1504,7 +1502,7 @@ int ha_berkeley::index_first(byte * buf)
statistic_increment(ha_read_first_count,&LOCK_status);
bzero((char*) &row,sizeof(row));
DBUG_RETURN(read_row(cursor->c_get(cursor, &last_key, &row, DB_FIRST),
- (char*) buf, active_index, &row, &last_key, 0));
+ (char*) buf, active_index, &row, &last_key, 1));
}
int ha_berkeley::index_last(byte * buf)