1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-21 06:21:35 +03:00
Files
mariadb/mysql-test/t
Sergey Petrunya 0e19f3e36f Backport of:
revno: 2876.47.174
revision-id: jorgen.loland@oracle.com-20110519120355-qn7eprkad9jqwu5j
parent: mayank.prasad@oracle.com-20110518143645-bdxv4udzrmqsjmhq
committer: Jorgen Loland <jorgen.loland@oracle.com>
branch nick: mysql-trunk-11765831
timestamp: Thu 2011-05-19 14:03:55 +0200
message:
  BUG#11765831: 'RANGE ACCESS' MAY INCORRECTLY FILTER 
                        AWAY QUALIFYING ROWS
        
  The problem was that the ranges created when OR'ing two 
  conditions could be incorrect. Without the bugfix, 
  "I <> 6 OR (I <> 8 AND J = 5)" would create these ranges:
  
  "NULL < I < 6",
  "6 <= I <= 6 AND 5 <= J <= 5",
  "6 < I < 8",
  "8 <= I <= 8 AND 5 <= J <= 5",
  "8 < I"
  
  While the correct ranges is
  "NULL < I < 6",
  "6 <= I <= 6 AND 5 <= J <= 5",
  "6 < I"
  
  The problem occurs when key_or() ORs
  (1) "NULL < I < 6, 6 <= I <= 6 AND 5 <= J <= 5, 6 < I" with 
  (2) "8 < I AND 5 <= J <= 5"
  
  The reason for the bug is that in key_or(), SEL_ARG *tmp is 
  used to point to the range in (1) above that is merged with 
  (2) while key1 points to the root of the red-black tree of 
  (1). When merging (1) and (2), tmp refers to the "6 < I" 
  part whereas the root is the "6 <= ... AND 5 <= J <= 5" part. 
  
  key_or() decides that the tmp range needs to be split into
  "6 < I < 8, 8 <= I <= 8, 8 < I", in which next_key_part of the 
  second range should be that of tmp. However, next_key_part is
  set to key1->next_key_part ("5 <= J <= 5") instead of 
  tmp->next_key_part (empty). Fixing this gives the correct but
  not optimal ranges:
  "NULL < I < 6",
  "6 <= I <= 6 AND 5 <= J <= 5",
  "6 < I < 8",
  "8 <= I <= 8",
  "8 < I"
  
  A second problem can be seen above: key_or() may create 
  adjacent ranges that could be replaced with a single range. 
  Fixes for this is also included in the patch so that the range
  above becomes correct AND optimal:
  "NULL < I < 6",
  "6 <= I <= 6 AND 5 <= J <= 5",
  "6 < I"
  
  Merging adjacent ranges like this gives a slightly lower cost 
  estimate for the range access.
2011-08-05 22:01:49 +04:00
..
2010-02-25 23:13:11 +04:00
2010-09-12 18:40:01 +02:00
2010-06-10 11:11:52 +02:00
2011-05-28 05:11:32 +03:00
2011-05-12 16:31:54 +02:00
2011-01-25 12:14:28 +05:30
2011-05-10 18:17:43 +03:00
2011-05-02 20:58:45 +03:00
2010-11-25 00:57:34 +02:00
2011-05-28 05:11:32 +03:00
2010-01-15 17:27:55 +02:00
2011-07-21 15:55:08 -07:00
2011-06-21 15:50:07 +03:00
2011-06-10 21:15:13 +02:00
2011-05-03 19:10:10 +03:00
2011-05-10 23:20:35 +03:00
2010-11-25 00:57:34 +02:00
2011-06-07 18:13:02 +02:00
2011-06-09 17:23:39 +02:00
2010-11-25 00:57:34 +02:00
2011-06-07 18:13:02 +02:00
2011-06-10 21:15:13 +02:00
2011-05-02 20:58:45 +03:00
2011-05-02 20:58:45 +03:00
2011-01-18 00:53:41 +02:00
2011-07-20 21:55:55 -07:00
2010-12-27 14:22:05 -08:00
2011-02-20 18:51:43 +02:00
2010-10-19 15:58:35 +02:00
2011-07-29 17:09:16 -07:00
2011-07-21 00:43:37 -07:00
2011-06-24 21:43:31 +04:00
2011-05-02 20:58:45 +03:00
2011-01-11 15:36:41 +02:00
2011-03-29 10:09:05 +02:00
2010-09-06 02:15:34 +03:00
2011-05-19 19:19:44 +02:00
2010-11-23 23:39:59 +02:00
2010-09-06 02:15:34 +03:00
2011-05-02 20:58:45 +03:00
2011-05-10 18:17:43 +03:00
2010-08-25 22:22:33 +02:00
2011-05-02 20:58:45 +03:00
2011-05-10 18:17:43 +03:00
2010-06-14 18:58:52 +02:00
2010-11-25 00:57:34 +02:00
2011-05-28 05:11:32 +03:00
2011-08-05 22:01:49 +04:00
2011-05-02 20:58:45 +03:00
2009-11-27 18:10:28 +02:00
2011-06-03 21:45:24 +04:00
2011-07-18 23:45:38 +03:00
2011-07-19 23:19:10 +03:00
2011-07-20 16:09:28 -07:00
2011-07-20 21:48:41 +03:00
2011-05-28 05:11:32 +03:00
2010-05-26 21:55:40 +03:00
2011-05-28 05:11:32 +03:00
2011-06-09 17:23:39 +02:00
2011-06-07 18:13:02 +02:00
2011-06-09 17:23:39 +02:00
2011-05-19 19:01:46 +02:00
2011-05-28 05:11:32 +03:00
2010-06-10 11:11:52 +02:00
2011-03-09 15:47:59 +02:00
2011-05-10 18:17:43 +03:00
2011-05-31 15:33:14 +03:00
2011-07-21 15:55:08 -07:00
2010-10-27 16:31:22 -07:00
2011-03-31 14:29:23 +02:00