diff options
author | monty@donna.mysql.fi <> | 2001-03-10 17:05:10 +0200 |
---|---|---|
committer | monty@donna.mysql.fi <> | 2001-03-10 17:05:10 +0200 |
commit | c1402e2d5c606bfb5e35542ff92ba8e53cb797ab (patch) | |
tree | cc1b41b3c722e4793c0fc03a04d720d88cfa332d /sql/ha_berkeley.cc | |
parent | 267c8760cb33208e2c1d772340c2aaf234806c45 (diff) | |
download | mariadb-git-c1402e2d5c606bfb5e35542ff92ba8e53cb797ab.tar.gz |
Fixed bug in MAX() optimizing for BDB tables
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r-- | sql/ha_berkeley.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 3f6b2629e16..10ff4dcc260 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -1429,7 +1429,12 @@ int ha_berkeley::index_read(byte * buf, const byte * key, pack_key(&last_key, active_index, key_buff, key, key_len); /* Store for compare */ memcpy(key_buff2, key_buff, (key_len=last_key.size)); - key_info->handler.bdb_return_if_eq= -1; + /* + If HA_READ_AFTER_KEY is set, return next key, else return first + matching key. + */ + key_info->handler.bdb_return_if_eq= (find_flag == HA_READ_AFTER_KEY ? + 1 : -1); error=read_row(cursor->c_get(cursor, &last_key, &row, DB_SET_RANGE), (char*) buf, active_index, &row, (DBT*) 0, 0); key_info->handler.bdb_return_if_eq= 0; |