1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
Files
mariadb/sql
Jorgen Loland 2c780b461d Bug#16540042: WRONG QUERY RESULT WHEN USING RANGE OVER
PARTIAL INDEX

Consider the following table definition:

CREATE TABLE t (
  my_col CHAR(10),
  ...
  INDEX my_idx (my_col(1))
)

The my_idx index is not able to distinguish between rows with
equal first-character my_col-values (e.g. "f", "foo", "fee").

Prior to this CS, the range optimizer would translate

"WHERE my_col NOT IN ('f', 'h')" into (optimizer trace syntax)

"ranges": [
  "NULL < my_col < f",
  "f < my_col"
]

But this was not correct because the rows with values "foo" 
and "fee" would not belong to any of those ranges. However, the
predicate "my_col != 'f' AND my_col != 'h'" would translate
to 

"ranges": [
  "NULL < my_col"
]

because get_mm_leaf() changes from "<" to "<=" for partial
keyparts. This CS changes the range optimizer implementation 
for NOT IN to behave like a conjunction of NOT EQUAL: it 
replaces "<" with "<=" for all but the first range when the
keypart is partial.
2013-04-12 09:39:56 +02:00
..
2011-06-30 17:31:31 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-05-21 10:21:08 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-07-04 01:25:49 +02:00
2013-02-25 15:26:00 +01:00
2013-02-25 15:26:00 +01:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-07-04 01:25:49 +02:00
2011-06-30 17:46:53 +02:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2013-03-31 06:52:16 +05:30
2013-03-28 19:17:28 +05:30
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2013-03-28 14:18:51 +05:30
2013-03-26 20:52:01 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-07-03 17:47:37 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2012-02-16 10:48:16 +01:00
2012-02-16 10:48:16 +01:00
2012-02-16 10:48:16 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2013-02-25 15:26:00 +01:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2013-02-25 15:26:00 +01:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2012-02-16 10:48:16 +01:00
2013-02-25 15:26:00 +01:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2013-03-28 17:41:22 +02:00
2013-03-28 17:41:22 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2012-09-12 08:59:44 +02:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2012-10-12 22:59:21 +02:00
2013-02-25 15:26:00 +01:00
2011-11-17 09:00:58 +01:00
2010-12-07 16:11:13 +00:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2013-03-28 14:18:51 +05:30
2013-04-02 16:20:49 +02:00
2011-06-30 17:46:53 +02:00
2013-02-25 15:26:00 +01:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-07-04 01:25:49 +02:00
2012-09-22 18:07:04 +05:30
2012-02-16 10:48:16 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2013-02-25 15:26:00 +01:00
2011-06-30 17:46:53 +02:00
2011-06-30 17:46:53 +02:00
2011-07-04 01:25:49 +02:00