diff options
author | ramil/ram@mysql.com/myoffice.izhnet.ru <> | 2006-10-19 12:52:37 +0500 |
---|---|---|
committer | ramil/ram@mysql.com/myoffice.izhnet.ru <> | 2006-10-19 12:52:37 +0500 |
commit | 0027b6e4b772a6b90ed67048451f3455aacfbf5d (patch) | |
tree | 46f10dec22a47aca4f01060db36cdfc4d2465f82 /sql/table.cc | |
parent | cfd442b67f8b13ebfc665d2c63436319c360870a (diff) | |
download | mariadb-git-0027b6e4b772a6b90ed67048451f3455aacfbf5d.tar.gz |
Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes
We miss some records sometimes using RANGE method if we have
partial key segments.
Example:
Create table t1(a char(2), key(a(1)));
insert into t1 values ('a'), ('xx');
select a from t1 where a > 'x';
We call index_read() passing 'x' key and HA_READ_AFTER_KEY flag
in the handler::read_range_first() wich is wrong because we have
a partial key segment for the field and might miss records like 'xx'.
Fix: don't use open segments in such a case.
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc index 0efed04c06e..f99afa61db9 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -676,7 +676,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, as we need to test for NULL = NULL. */ if (field->real_maybe_null()) - key_part->key_part_flag|= HA_PART_KEY_SEG; + key_part->key_part_flag|= HA_NULL_PART; } else { // Error: shorten key |