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
28c2f979
Commit
28c2f979
authored
Oct 17, 2010
by
Kristofer Pettersson
Browse files
Options
Browse Files
Download
Plain Diff
Automerge
parents
91127b6d
9de94cd5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
2 deletions
+77
-2
mysql-test/r/partition_innodb.result
mysql-test/r/partition_innodb.result
+32
-0
mysql-test/t/partition_innodb.test
mysql-test/t/partition_innodb.test
+37
-0
sql/ha_partition.cc
sql/ha_partition.cc
+8
-2
No files found.
mysql-test/r/partition_innodb.result
View file @
28c2f979
drop table if exists t1, t2;
#
# Bug#56287: crash when using Partition datetime in sub in query
#
CREATE TABLE t1
(c1 bigint(20) unsigned NOT NULL AUTO_INCREMENT,
c2 varchar(40) not null default '',
c3 datetime not NULL,
PRIMARY KEY (c1,c3),
KEY partidx(c3))
ENGINE=InnoDB
PARTITION BY RANGE (TO_DAYS(c3))
(PARTITION p200912 VALUES LESS THAN (to_days('2010-01-01')),
PARTITION p201103 VALUES LESS THAN (to_days('2011-04-01')),
PARTITION p201912 VALUES LESS THAN MAXVALUE);
insert into t1(c2,c3) values ("Test row",'2010-01-01 00:00:00');
SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
PARTITION_NAME TABLE_ROWS
p200912 0
p201103 1
p201912 0
SELECT count(*) FROM t1 p where c3 in
(select c3 from t1 t where t.c3 < date '2011-04-26 19:19:44'
and t.c3 > date '2011-04-26 19:18:44') ;
count(*)
0
DROP TABLE t1;
#
# Bug#51830: Incorrect partition pruning on range partition (regression)
#
CREATE TABLE t1 (a INT NOT NULL)
...
...
@@ -387,3 +413,9 @@ a b
3 2003-03-03
COMMIT;
DROP TABLE t1;
CREATE TABLE t1 (i1 int NOT NULL primary key, f1 int) ENGINE = InnoDB
PARTITION BY HASH(i1) PARTITIONS 2;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1 WHERE i1 = ( SELECT i1 FROM t1 WHERE f1=0 LIMIT 1 );
i1 f1
DROP TABLE t1;
mysql-test/t/partition_innodb.test
View file @
28c2f979
...
...
@@ -7,6 +7,30 @@ drop table if exists t1, t2;
let
$MYSQLD_DATADIR
=
`SELECT @@datadir`
;
--
echo
#
--
echo
# Bug#56287: crash when using Partition datetime in sub in query
--
echo
#
CREATE
TABLE
t1
(
c1
bigint
(
20
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
c2
varchar
(
40
)
not
null
default
''
,
c3
datetime
not
NULL
,
PRIMARY
KEY
(
c1
,
c3
),
KEY
partidx
(
c3
))
ENGINE
=
InnoDB
PARTITION
BY
RANGE
(
TO_DAYS
(
c3
))
(
PARTITION
p200912
VALUES
LESS
THAN
(
to_days
(
'2010-01-01'
)),
PARTITION
p201103
VALUES
LESS
THAN
(
to_days
(
'2011-04-01'
)),
PARTITION
p201912
VALUES
LESS
THAN
MAXVALUE
);
insert
into
t1
(
c2
,
c3
)
values
(
"Test row"
,
'2010-01-01 00:00:00'
);
SELECT
PARTITION_NAME
,
TABLE_ROWS
FROM
INFORMATION_SCHEMA
.
PARTITIONS
WHERE
TABLE_NAME
=
't1'
AND
TABLE_SCHEMA
=
'test'
;
SELECT
count
(
*
)
FROM
t1
p
where
c3
in
(
select
c3
from
t1
t
where
t
.
c3
<
date
'2011-04-26 19:19:44'
and
t
.
c3
>
date
'2011-04-26 19:18:44'
)
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#51830: Incorrect partition pruning on range partition (regression)
--
echo
#
...
...
@@ -401,3 +425,16 @@ connection default;
SELECT
*
FROM
t1
;
COMMIT
;
DROP
TABLE
t1
;
#
# Bug #55146 Assertion `m_part_spec.start_part == m_part_spec.end_part' in index_read_idx_map
#
CREATE
TABLE
t1
(
i1
int
NOT
NULL
primary
key
,
f1
int
)
ENGINE
=
InnoDB
PARTITION
BY
HASH
(
i1
)
PARTITIONS
2
;
INSERT
INTO
t1
VALUES
(
1
,
1
),
(
2
,
2
);
SELECT
*
FROM
t1
WHERE
i1
=
(
SELECT
i1
FROM
t1
WHERE
f1
=
0
LIMIT
1
);
DROP
TABLE
t1
;
sql/ha_partition.cc
View file @
28c2f979
...
...
@@ -4266,8 +4266,12 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index,
get_partition_set
(
table
,
buf
,
index
,
&
m_start_key
,
&
m_part_spec
);
/* How can it be more than one partition with the current use? */
DBUG_ASSERT
(
m_part_spec
.
start_part
==
m_part_spec
.
end_part
);
/*
We have either found exactly 1 partition
(in which case start_part == end_part)
or no matching partitions (start_part > end_part)
*/
DBUG_ASSERT
(
m_part_spec
.
start_part
>=
m_part_spec
.
end_part
);
for
(
part
=
m_part_spec
.
start_part
;
part
<=
m_part_spec
.
end_part
;
part
++
)
{
...
...
@@ -4502,6 +4506,7 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
key not found.
*/
DBUG_PRINT
(
"info"
,
(
"scan with no partition to scan"
));
table
->
status
=
STATUS_NOT_FOUND
;
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
if
(
m_part_spec
.
start_part
==
m_part_spec
.
end_part
)
...
...
@@ -4526,6 +4531,7 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
if
(
start_part
==
MY_BIT_NONE
)
{
DBUG_PRINT
(
"info"
,
(
"scan with no partition to scan"
));
table
->
status
=
STATUS_NOT_FOUND
;
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
if
(
start_part
>
m_part_spec
.
start_part
)
...
...
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