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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
db2c48b0
Commit
db2c48b0
authored
Aug 05, 2006
by
mikael/pappa@dator5.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#21339: Crash at EXPLAIN PARTITIONS
Caused by missing check for end of partitions in prune range check
parent
a4eb61b8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
4 deletions
+76
-4
mysql-test/r/partition.result
mysql-test/r/partition.result
+28
-0
mysql-test/r/partition_range.result
mysql-test/r/partition_range.result
+10
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+18
-0
mysql-test/t/partition_range.test
mysql-test/t/partition_range.test
+13
-0
sql/sql_partition.cc
sql/sql_partition.cc
+7
-4
No files found.
mysql-test/r/partition.result
View file @
db2c48b0
...
...
@@ -1117,4 +1117,32 @@ hello/master-data/tmpinx/t1#P#p1#SP#subpart11.MYI
hello/master-data/tmpinx/t1#P#p2#SP#subpart20.MYI
hello/master-data/tmpinx/t1#P#p2#SP#subpart21.MYI
drop table t1;
create table t1 (a bigint unsigned not null, primary key(a))
engine = myisam
partition by key (a)
partitions 10;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE),
(18446744073709551613), (18446744073709551612);
select * from t1;
a
18446744073709551612
18446744073709551613
18446744073709551614
18446744073709551615
select * from t1 where a = 18446744073709551615;
a
18446744073709551615
delete from t1 where a = 18446744073709551615;
select * from t1;
a
18446744073709551612
18446744073709551613
18446744073709551614
drop table t1;
End of 5.1 tests
mysql-test/r/partition_range.result
View file @
db2c48b0
drop table if exists t1;
create table t1 (a date)
engine = innodb
partition by range (year(a))
(partition p0 values less than (2006),
partition p1 values less than (2007));
explain partitions select * from t1
where a between '2006-01-01' and '2007-06-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where
drop table t1;
create table t1 (a int unsigned)
partition by range (a)
(partition pnull values less than (0),
...
...
mysql-test/t/partition.test
View file @
db2c48b0
...
...
@@ -1300,4 +1300,22 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
drop
table
t1
;
--
exec
rmdir
$MYSQLTEST_VARDIR
/
master
-
data
/
tmpdata
||
true
--
exec
rmdir
$MYSQLTEST_VARDIR
/
master
-
data
/
tmpinx
||
true
#
# Bug 21388: Bigint fails to find record
#
create
table
t1
(
a
bigint
unsigned
not
null
,
primary
key
(
a
))
engine
=
myisam
partition
by
key
(
a
)
partitions
10
;
show
create
table
t1
;
insert
into
t1
values
(
18446744073709551615
),
(
0xFFFFFFFFFFFFFFFE
),
(
18446744073709551613
),
(
18446744073709551612
);
select
*
from
t1
;
select
*
from
t1
where
a
=
18446744073709551615
;
delete
from
t1
where
a
=
18446744073709551615
;
select
*
from
t1
;
drop
table
t1
;
--
echo
End
of
5.1
tests
mysql-test/t/partition_range.test
View file @
db2c48b0
...
...
@@ -9,6 +9,18 @@
drop
table
if
exists
t1
;
--
enable_warnings
#
# Bug 21339: Crash in Explain Partitions
#
create
table
t1
(
a
date
)
engine
=
innodb
partition
by
range
(
year
(
a
))
(
partition
p0
values
less
than
(
2006
),
partition
p1
values
less
than
(
2007
));
explain
partitions
select
*
from
t1
where
a
between
'2006-01-01'
and
'2007-06-01'
;
drop
table
t1
;
#
# More checks for partition pruning
#
...
...
@@ -686,3 +698,4 @@ EXPLAIN PARTITIONS SELECT * from t1
WHERE
(
a
>=
'2004-07-01'
AND
a
<=
'2004-09-30'
)
OR
(
a
>=
'2005-07-01'
AND
a
<=
'2005-09-30'
);
DROP
TABLE
t1
;
sql/sql_partition.cc
View file @
db2c48b0
...
...
@@ -2573,10 +2573,13 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
}
else
{
if
(
part_func_value
==
range_array
[
loc_part_id
])
loc_part_id
+=
test
(
include_endpoint
);
else
if
(
part_func_value
>
range_array
[
loc_part_id
])
loc_part_id
++
;
if
(
loc_part_id
<
max_partition
)
{
if
(
part_func_value
==
range_array
[
loc_part_id
])
loc_part_id
+=
test
(
include_endpoint
);
else
if
(
part_func_value
>
range_array
[
loc_part_id
])
loc_part_id
++
;
}
loc_part_id
++
;
}
DBUG_RETURN
(
loc_part_id
);
...
...
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