List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:June 4 2006 1:17pm
Subject:bk commit into 5.1 tree (sergefp:1.2182) BUG#19055
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of psergey. When psergey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2182 06/06/04 17:17:37 sergefp@stripped +3 -0
  BUG#19055: There may exist a SEL_TREE objects with type==KEY and keys[i]==NULL for any i.
  (for example, such objects can be returned from get_mm_parts() for "string_field = int_val).
  Make find_used_partitions_imerge() to handle such SEL_TREE objects.

  sql/opt_range.cc
    1.219 06/06/04 17:17:32 sergefp@stripped +9 -2
    BUG#19055: There may exist a SEL_TREE objects with type==KEY and keys[i]==NULL for any i.
    (for example, such objects can be returned from get_mm_parts() for "string_field = int_val).
    Make find_used_partitions_imerge() to handle such SEL_TREE objects.

  mysql-test/t/partition_pruning.test
    1.13 06/06/04 17:17:32 sergefp@stripped +9 -1
    BUG#19055: testcase

  mysql-test/r/partition_pruning.result
    1.15 06/06/04 17:17:31 sergefp@stripped +8 -0
    BUG#19055: testcase

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	sergefp
# Host:	newbox.mylan
# Root:	/home/psergey/mysql-5.1-bug19055

--- 1.218/sql/opt_range.cc	2006-05-19 16:00:24 +04:00
+++ 1.219/sql/opt_range.cc	2006-06-04 17:17:32 +04:00
@@ -374,6 +374,12 @@
     keys_map.clear_all();
     bzero((char*) keys,sizeof(keys));
   }
+  /*
+    Note: there may exist SEL_TREE objects with sel_tree->type=KEY and
+    keys[i]=0 for all i. (SergeyP: it is not clear whether there is any
+    merit in range analyzer functions (e.g. get_mm_parts) returning a
+    pointer to such SEL_TREE instead of NULL)
+  */
   SEL_ARG *keys[MAX_KEY];
   key_map keys_map;        /* bitmask of non-NULL elements in keys */
 
@@ -2580,7 +2586,8 @@
     ppar->cur_part_fields= 0;
     ppar->cur_subpart_fields= 0;
     init_all_partitions_iterator(ppar->part_info, &ppar->part_iter);
-    if (-1 == (res |= find_used_partitions(ppar, (*ptree)->keys[0])))
+    SEL_ARG *key_tree= (*ptree)->keys[0];
+    if (!key_tree || (-1 == (res |= find_used_partitions(ppar, key_tree))))
       return -1;
   }
   return res;
@@ -5104,7 +5111,7 @@
       tree->keys_map.set_bit(key_part->key);
     }
   }
-
+  
   DBUG_RETURN(tree);
 }
 

--- 1.14/mysql-test/r/partition_pruning.result	2006-04-20 22:16:20 +04:00
+++ 1.15/mysql-test/r/partition_pruning.result	2006-06-04 17:17:31 +04:00
@@ -670,3 +670,11 @@
 a
 na
 drop table t1;
+create table t1 (s1 varchar(15)) partition by key (s1);
+select * from t1 where s1 = 0 or s1 is null;
+s1
+insert into t1 values ('aa'),('bb'),('0');
+explain partitions select * from t1 where s1 = 0 or s1 is null;
+id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	p0	ALL	NULL	NULL	NULL	NULL	3	Using where
+drop table t1;

--- 1.12/mysql-test/t/partition_pruning.test	2006-04-10 21:07:40 +04:00
+++ 1.13/mysql-test/t/partition_pruning.test	2006-06-04 17:17:32 +04:00
@@ -556,7 +556,7 @@
 # being fixed.
 
 #
-#BUG 17946 Like searches fail with partitioning
+# BUG#17946 Like searches fail with partitioning
 #
 create table t1 (a char(32) primary key)
 partition by key()
@@ -564,5 +564,13 @@
 insert into t1 values ('na');
 select * from t1;
 select * from t1 where a like 'n%';
+drop table t1;
+
+
+# BUG#19055 Crashes for varchar_col=NUMBER or varchar_col IS NULL
+create table t1 (s1 varchar(15)) partition by key (s1);
+select * from t1 where s1 = 0 or s1 is null;
+insert into t1 values ('aa'),('bb'),('0');
+explain partitions select * from t1 where s1 = 0 or s1 is null;
 drop table t1;
 
Thread
bk commit into 5.1 tree (sergefp:1.2182) BUG#19055Sergey Petrunia4 Jun