diff options
author | unknown <monty@mysql.com> | 2004-07-09 10:55:16 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-07-09 10:55:16 +0300 |
commit | b42209774aa80452bee797238fbe9bd4006fffce (patch) | |
tree | 7e2ff70f1febc7a09674e0680a73d7c941c2a9ff /sql/ha_berkeley.cc | |
parent | 53ca595451d53fccd60b1112c444e5278021c1ee (diff) | |
download | mariadb-git-b42209774aa80452bee797238fbe9bd4006fffce.tar.gz |
Cleanup of db option cacheing
Some bug fixes to last pushed code
mysql-test/mysql-test-run.sh:
Fix for new valgrind (2.1.1)
mysql-test/r/bdb.result:
Updated results
mysql-test/t/ps_1general.test:
removed wrong error condition
sql/ha_berkeley.cc:
Fix for index_flags() in new code
sql/item_strfunc.cc:
Cleanup (fixed indentation, removed short variable names)
sql/mysql_priv.h:
Cleanup of db option cacheing
sql/mysqld.cc:
Cleanup of db option cacheing
sql/sql_db.cc:
Cleanup of db option cacheing
sql/sql_parse.cc:
Cleanup of db option cacheing
sql/sql_table.cc:
sprintf -> strxmov
sql/table.cc:
key_read should be tested on key parts, not the whole key
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r-- | sql/ha_berkeley.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index bb07bd9dc4b..39ef6ca855a 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -344,12 +344,24 @@ 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++) + for (uint i= all_parts ? 0 : part ; i <= part ; i++) { - if (table->key_info[idx].key_part[part].field->type() == FIELD_TYPE_BLOB) + if (table->key_info[idx].key_part[i].field->type() == FIELD_TYPE_BLOB) { /* We can't use BLOBS to shortcut sorts */ - flags&= ~ (HA_READ_ORDER | HA_KEYREAD_ONLY | HA_READ_RANGE); + flags&= ~(HA_READ_ORDER | HA_KEYREAD_ONLY | HA_READ_RANGE); + break; + } + switch (table->key_info[idx].key_part[i].field->key_type()) { + case HA_KEYTYPE_TEXT: + case HA_KEYTYPE_VARTEXT: + /* + As BDB stores only one copy of equal strings, we can't use key read + on these + */ + flags&= ~HA_KEYREAD_ONLY; + break; + default: // Keep compiler happy break; } } |