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.2259 06/03/31 03:45:11 sergefp@stripped +4 -0
Fix for BUG#18025: Wrong query results because of bugs in partition pruning
sql/sql_partition.cc
1.59 06/03/31 03:45:06 sergefp@stripped +1 -0
BUG#18025: In set_up_range_analysis_info(), treat MEDIUMINT as enumerable type just like other integer types.
sql/opt_range.cc
1.208 06/03/31 03:45:06 sergefp@stripped +1 -1
BUG#18025: Fix a typo bug in SEL_ARG::is_singlepoint()
mysql-test/t/partition_pruning.test
1.9 06/03/31 03:45:06 sergefp@stripped +32 -0
Testcase for BUG#18025
mysql-test/r/partition_pruning.result
1.10 06/03/31 03:45:06 sergefp@stripped +38 -0
Testcase for BUG#18025
# 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-18025-look
--- 1.207/sql/opt_range.cc 2006-03-28 16:25:12 +04:00
+++ 1.208/sql/opt_range.cc 2006-03-31 03:45:06 +04:00
@@ -339,7 +339,7 @@
if (min_flag || max_flag)
return FALSE;
byte *min_val= (byte *)min_value;
- byte *max_val= (byte *)min_value;
+ byte *max_val= (byte *)max_value;
if (maybe_null)
{
--- 1.58/sql/sql_partition.cc 2006-03-28 16:25:13 +04:00
+++ 1.59/sql/sql_partition.cc 2006-03-31 03:45:06 +04:00
@@ -5643,6 +5643,7 @@
switch (field->type()) {
case MYSQL_TYPE_TINY:
case MYSQL_TYPE_SHORT:
+ case MYSQL_TYPE_INT24:
case MYSQL_TYPE_LONG:
case MYSQL_TYPE_LONGLONG:
part_info->get_part_iter_for_interval=
--- 1.9/mysql-test/r/partition_pruning.result 2006-02-25 02:50:56 +03:00
+++ 1.10/mysql-test/r/partition_pruning.result 2006-03-31 03:45:06 +04:00
@@ -545,3 +545,41 @@
Variable_name Value
Handler_read_next 0
drop table t1, t2;
+create table t1 ( f_int1 mediumint, f_int2 integer)
+partition by list(mod(f_int1,4)) (
+partition p_3 values in (-3),
+partition p_2 values in (-2),
+partition p_1 values in (-1),
+partition p0 values in (0),
+partition p1 values in (1),
+partition p2 values in (2),
+partition p3 values in (3)
+);
+insert into t1 values (9, 9), (8, 8), (7, 7), (6, 6), (5, 5),
+(4, 4), (3, 3), (2, 2), (1, 1);
+select * from t1 where f_int1 between 5 and 15 order by f_int1;
+f_int1 f_int2
+5 5
+6 6
+7 7
+8 8
+9 9
+drop table t1;
+create table t1 (a char(10)) partition by list(length(a)) (
+partition p1 values in (1),
+partition p2 values in (2),
+partition p3 values in (3),
+partition p4 values in (4),
+partition p5 values in (5)
+);
+insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
+select * from t1 where a>='a' and a <= 'dddd';
+a
+a
+bb
+ccc
+dddd
+explain partitions select * from t1 where a>='a' and a <= 'dddd';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1,p2,p3,p4,p5 ALL NULL NULL NULL NULL 5 Using where
+drop table t1;
--- 1.8/mysql-test/t/partition_pruning.test 2006-02-06 18:33:31 +03:00
+++ 1.9/mysql-test/t/partition_pruning.test 2006-03-31 03:45:06 +04:00
@@ -447,5 +447,37 @@
drop table t1, t2;
+# BUG#18025
+# part1: mediumint columns
+create table t1 ( f_int1 mediumint, f_int2 integer)
+partition by list(mod(f_int1,4)) (
+ partition p_3 values in (-3),
+ partition p_2 values in (-2),
+ partition p_1 values in (-1),
+ partition p0 values in (0),
+ partition p1 values in (1),
+ partition p2 values in (2),
+ partition p3 values in (3)
+);
+
+insert into t1 values (9, 9), (8, 8), (7, 7), (6, 6), (5, 5),
+ (4, 4), (3, 3), (2, 2), (1, 1);
+select * from t1 where f_int1 between 5 and 15 order by f_int1;
+
+drop table t1;
+
+# part2: bug in pruning code
+create table t1 (a char(10)) partition by list(length(a)) (
+ partition p1 values in (1),
+ partition p2 values in (2),
+ partition p3 values in (3),
+ partition p4 values in (4),
+ partition p5 values in (5)
+);
+insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
+select * from t1 where a>='a' and a <= 'dddd';
+explain partitions select * from t1 where a>='a' and a <= 'dddd';
+drop table t1;
+
# No tests for NULLs in RANGE(monotonic_expr()) - they depend on BUG#15447
# being fixed.
| Thread |
|---|
| • bk commit into 5.1 tree (sergefp:1.2259) BUG#18025 | Sergey Petrunia | 31 Mar |