summaryrefslogtreecommitdiff
path: root/sql/opt_range.h
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-10-19 12:52:37 +0500
committerunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-10-19 12:52:37 +0500
commitda7af481cda9d0fb836f010d421ce00830b69f56 (patch)
tree46f10dec22a47aca4f01060db36cdfc4d2465f82 /sql/opt_range.h
parent9a506df0c2f831ed91a6ca4dea9f44982f28f2f7 (diff)
downloadmariadb-git-da7af481cda9d0fb836f010d421ce00830b69f56.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. mysql-test/r/range.result: Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes - test result. mysql-test/t/range.test: Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes - test case. sql/opt_range.cc: Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes - check if we have a partial key segment for a Item_func::GT_FUNC; if so, don't set NEAR_MIN flag in order to use HA_READ_KEY_OR_NEXT instead of HA_READ_AFTER_KEY. sql/opt_range.h: Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes - key segment 'flag' slot added. sql/sql_select.cc: Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes - test (HA_PART_KEY_SEG | HA_NULL_PART) as we split it in the sql/table.cc sql/table.cc: Fix for bug #20732: Partial index and long sjis search with '>' fails sometimes - set HA_NULL_PART flag instead of HA_PART_KEY_SEG in order not to mix them.
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r--sql/opt_range.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 367a85dc6f2..4d425604921 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -36,7 +36,7 @@
typedef struct st_key_part {
uint16 key,part, store_length, length;
- uint8 null_bit;
+ uint8 null_bit, flag;
Field *field;
Field::imagetype image_type;
} KEY_PART;