diff options
author | monty@mysql.com <> | 2004-07-08 15:45:25 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2004-07-08 15:45:25 +0300 |
commit | db7efa27803b1ee58a3b04c63a4cc14241420fd0 (patch) | |
tree | 15b952a3b20bb1c0c60974e9f451385a4fa45208 /sql/ha_berkeley.cc | |
parent | 6fdafa5635d5ad369f7a4e5272b818b9e4957a1c (diff) | |
download | mariadb-git-db7efa27803b1ee58a3b04c63a4cc14241420fd0.tar.gz |
New handler::index_flags() definition to make it easy to check the full used key and a specific key part.
Added key part to optimize_range() to fix problems when using fields in key parts.
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r-- | sql/ha_berkeley.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 4bed33af15b..bb07bd9dc4b 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -340,6 +340,23 @@ const char **ha_berkeley::bas_ext() const { static const char *ext[]= { ha_berkeley_ext, NullS }; return ext; } +ulong ha_berkeley::index_flags(uint idx, uint part, bool all_parts) const +{ + ulong flags= (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_KEYREAD_ONLY + | HA_READ_RANGE); + for (uint idx= all_parts ? 0 : part ; idx <= part ; idx++) + { + if (table->key_info[idx].key_part[part].field->type() == FIELD_TYPE_BLOB) + { + /* We can't use BLOBS to shortcut sorts */ + flags&= ~ (HA_READ_ORDER | HA_KEYREAD_ONLY | HA_READ_RANGE); + break; + } + } + return flags; +} + + static int berkeley_cmp_hidden_key(DB* file, const DBT *new_key, const DBT *saved_key) { |