From b42209774aa80452bee797238fbe9bd4006fffce Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Jul 2004 10:55:16 +0300 Subject: 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 --- sql/ha_berkeley.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'sql/ha_berkeley.cc') 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; } } -- cgit v1.2.1