Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
da810728
Commit
da810728
authored
Mar 31, 2006
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/home/psergey/mysql-5.1-bug18025-r2
parents
486a48d4
3886483b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
1 deletion
+72
-1
mysql-test/r/partition_pruning.result
mysql-test/r/partition_pruning.result
+38
-0
mysql-test/t/partition_pruning.test
mysql-test/t/partition_pruning.test
+32
-0
sql/opt_range.cc
sql/opt_range.cc
+1
-1
sql/sql_partition.cc
sql/sql_partition.cc
+1
-0
No files found.
mysql-test/r/partition_pruning.result
View file @
da810728
...
@@ -545,3 +545,41 @@ show status like 'Handler_read_next';
...
@@ -545,3 +545,41 @@ show status like 'Handler_read_next';
Variable_name Value
Variable_name Value
Handler_read_next 0
Handler_read_next 0
drop table t1, t2;
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;
mysql-test/t/partition_pruning.test
View file @
da810728
...
@@ -447,5 +447,37 @@ show status like 'Handler_read_next';
...
@@ -447,5 +447,37 @@ show status like 'Handler_read_next';
drop
table
t1
,
t2
;
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
# No tests for NULLs in RANGE(monotonic_expr()) - they depend on BUG#15447
# being fixed.
# being fixed.
sql/opt_range.cc
View file @
da810728
...
@@ -339,7 +339,7 @@ public:
...
@@ -339,7 +339,7 @@ public:
if
(
min_flag
||
max_flag
)
if
(
min_flag
||
max_flag
)
return
FALSE
;
return
FALSE
;
byte
*
min_val
=
(
byte
*
)
min_value
;
byte
*
min_val
=
(
byte
*
)
min_value
;
byte
*
max_val
=
(
byte
*
)
m
in
_value
;
byte
*
max_val
=
(
byte
*
)
m
ax
_value
;
if
(
maybe_null
)
if
(
maybe_null
)
{
{
...
...
sql/sql_partition.cc
View file @
da810728
...
@@ -5643,6 +5643,7 @@ static void set_up_range_analysis_info(partition_info *part_info)
...
@@ -5643,6 +5643,7 @@ static void set_up_range_analysis_info(partition_info *part_info)
switch
(
field
->
type
())
{
switch
(
field
->
type
())
{
case
MYSQL_TYPE_TINY
:
case
MYSQL_TYPE_TINY
:
case
MYSQL_TYPE_SHORT
:
case
MYSQL_TYPE_SHORT
:
case
MYSQL_TYPE_INT24
:
case
MYSQL_TYPE_LONG
:
case
MYSQL_TYPE_LONG
:
case
MYSQL_TYPE_LONGLONG
:
case
MYSQL_TYPE_LONGLONG
:
part_info
->
get_part_iter_for_interval
=
part_info
->
get_part_iter_for_interval
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment