summaryrefslogtreecommitdiff
path: root/sql/ha_berkeley.cc
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2004-08-19 15:15:10 +0500
committerunknown <bar@mysql.com>2004-08-19 15:15:10 +0500
commit7fbc796d4ad9681fa2381791f8c895be4cbd738b (patch)
tree01ac6df006d72fc8d39e0e1c185bc3c8bc11a7bb /sql/ha_berkeley.cc
parent6cf9fd7cdb9d102ee1e12408f5a8e871d069618d (diff)
downloadmariadb-git-7fbc796d4ad9681fa2381791f8c895be4cbd738b.tar.gz
Bug#4521: unique key prefix interacts poorly with utf8.
Fix for binary collations for MyISAM and HEAP BTREE. This patch also changes trailing spaces behaviour for binary collations. Binary collations now have PAD characteristic too.
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r--sql/ha_berkeley.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 39ef6ca855a..7cd534d60b3 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -357,9 +357,11 @@ ulong ha_berkeley::index_flags(uint idx, uint part, bool all_parts) const
case HA_KEYTYPE_VARTEXT:
/*
As BDB stores only one copy of equal strings, we can't use key read
- on these
+ on these. Binary collations do support key read though.
*/
- flags&= ~HA_KEYREAD_ONLY;
+ if (!(table->key_info[idx].key_part[i].field->charset()->state
+ & MY_CS_BINSORT))
+ flags&= ~HA_KEYREAD_ONLY;
break;
default: // Keep compiler happy
break;