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
c3970e73
Commit
c3970e73
authored
Feb 27, 2007
by
sergefp@pylon.mylan
Browse files
Options
Browse Files
Download
Plain Diff
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into mysql.com:/home/psergey/mysql-5.1-bug26117
parents
1967d342
d61f9e2d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
135 additions
and
4 deletions
+135
-4
mysql-test/r/partition_innodb.result
mysql-test/r/partition_innodb.result
+54
-0
mysql-test/t/partition_innodb.test
mysql-test/t/partition_innodb.test
+58
-0
sql/ha_partition.cc
sql/ha_partition.cc
+17
-4
sql/ha_partition.h
sql/ha_partition.h
+6
-0
No files found.
mysql-test/r/partition_innodb.result
View file @
c3970e73
...
...
@@ -74,3 +74,57 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */
drop table t1;
create table t1
(
id int unsigned auto_increment,
time datetime not null,
first_name varchar(40),
last_name varchar(50),
primary key (id, time),
index first_index (first_name),
index last_index (last_name)
) engine=Innodb partition by range (to_days(time)) (
partition p1 values less than (to_days('2007-02-07')),
partition p2 values less than (to_days('2007-02-08')),
partition p3 values less than MAXVALUE
);
insert into t1 (time, first_name, last_name) values ('2007-02-07', 'Q', 'Robert'),
('2007-02-07', 'Mark', 'Nate'), ('2007-02-07', 'Nate', 'Oscar'),
('2007-02-07', 'Zack', 'Alice'), ('2007-02-07', 'Jack', 'Kathy'),
('2007-02-06', 'Alice', 'Alice'), ('2007-02-06', 'Brian', 'Charles'),
('2007-02-06', 'Charles', 'David'), ('2007-02-06', 'David', 'Eric'),
('2007-02-07', 'Hector', 'Isaac'), ('2007-02-07', 'Oscar', 'Patricia'),
('2007-02-07', 'Patricia', 'Q'), ('2007-02-07', 'X', 'Yuri'),
('2007-02-07', 'Robert', 'Shawn'), ('2007-02-07', 'Kathy', 'Lois'),
('2007-02-07', 'Eric', 'Francis'), ('2007-02-06', 'Shawn', 'Theron'),
('2007-02-06', 'U', 'Vincent'), ('2007-02-06', 'Francis', 'George'),
('2007-02-06', 'George', 'Hector'), ('2007-02-06', 'Vincent', 'Walter'),
('2007-02-06', 'Walter', 'X'), ('2007-02-07', 'Lois', 'Mark'),
('2007-02-07', 'Yuri', 'Zack'), ('2007-02-07', 'Isaac', 'Jack'),
('2007-02-07', 'Sharon', 'Mark'), ('2007-02-07', 'Michael', 'Michelle'),
('2007-02-07', 'Derick', 'Nathan'), ('2007-02-07', 'Peter', 'Xavier'),
('2007-02-07', 'Fred', 'Harold'), ('2007-02-07', 'Katherine', 'Lisa'),
('2007-02-07', 'Tom', 'Rina'), ('2007-02-07', 'Jerry', 'Victor'),
('2007-02-07', 'Alexander', 'Terry'), ('2007-02-07', 'Justin', 'John'),
('2007-02-07', 'Greg', 'Ernest'), ('2007-02-07', 'Robert', 'Q'),
('2007-02-07', 'Nate', 'Mark'), ('2007-02-07', 'Oscar', 'Nate'),
('2007-02-07', 'Alice', 'Zack'), ('2007-02-07', 'Kathy', 'Jack'),
('2007-02-06', 'Alice', 'Alice'), ('2007-02-06', 'Charles', 'Brian'),
('2007-02-06', 'David', 'Charles'), ('2007-02-06', 'Eric', 'David'),
('2007-02-07', 'Isaac', 'Hector'), ('2007-02-07', 'Patricia', 'Oscar'),
('2007-02-07', 'Q', 'Patricia'), ('2007-02-07', 'Yuri', 'X'),
('2007-02-07', 'Shawn', 'Robert'), ('2007-02-07', 'Lois', 'Kathy'),
('2007-02-07', 'Francis', 'Eric'), ('2007-02-06', 'Theron', 'Shawn'),
('2007-02-06', 'Vincent', 'U'), ('2007-02-06', 'George', 'Francis'),
('2007-02-06', 'Hector', 'George'), ('2007-02-06', 'Walter', 'Vincent'),
('2007-02-06', 'X', 'Walter'), ('2007-02-07', 'Mark', 'Lois'),
('2007-02-07', 'Zack', 'Yuri'), ('2007-02-07', 'Jack', 'Isaac'),
('2007-02-07', 'Mark', 'Sharon'), ('2007-02-07', 'Michelle', 'Michael'),
('2007-02-07', 'Nathan', 'Derick'), ('2007-02-07', 'Xavier', 'Peter'),
('2007-02-07', 'Harold', 'Fred'), ('2007-02-07', 'Lisa', 'Katherine'),
('2007-02-07', 'Rina', 'Tom'), ('2007-02-07', 'Victor', 'Jerry'),
('2007-02-07', 'Terry', 'Alexander'), ('2007-02-07', 'John', 'Justin'),
('2007-02-07', 'Ernest', 'Greg');
SELECT * FROM t1 WHERE first_name='Andy' OR last_name='Jake';
id time first_name last_name
drop table t1;
mysql-test/t/partition_innodb.test
View file @
c3970e73
...
...
@@ -75,4 +75,62 @@ alter table t1 engine = x;
show
create
table
t1
;
drop
table
t1
;
# BUG#26117: index_merge sort-union over partitioned table crashes
create
table
t1
(
id
int
unsigned
auto_increment
,
time
datetime
not
null
,
first_name
varchar
(
40
),
last_name
varchar
(
50
),
primary
key
(
id
,
time
),
index
first_index
(
first_name
),
index
last_index
(
last_name
)
)
engine
=
Innodb
partition
by
range
(
to_days
(
time
))
(
partition
p1
values
less
than
(
to_days
(
'2007-02-07'
)),
partition
p2
values
less
than
(
to_days
(
'2007-02-08'
)),
partition
p3
values
less
than
MAXVALUE
);
insert
into
t1
(
time
,
first_name
,
last_name
)
values
(
'2007-02-07'
,
'Q'
,
'Robert'
),
(
'2007-02-07'
,
'Mark'
,
'Nate'
),
(
'2007-02-07'
,
'Nate'
,
'Oscar'
),
(
'2007-02-07'
,
'Zack'
,
'Alice'
),
(
'2007-02-07'
,
'Jack'
,
'Kathy'
),
(
'2007-02-06'
,
'Alice'
,
'Alice'
),
(
'2007-02-06'
,
'Brian'
,
'Charles'
),
(
'2007-02-06'
,
'Charles'
,
'David'
),
(
'2007-02-06'
,
'David'
,
'Eric'
),
(
'2007-02-07'
,
'Hector'
,
'Isaac'
),
(
'2007-02-07'
,
'Oscar'
,
'Patricia'
),
(
'2007-02-07'
,
'Patricia'
,
'Q'
),
(
'2007-02-07'
,
'X'
,
'Yuri'
),
(
'2007-02-07'
,
'Robert'
,
'Shawn'
),
(
'2007-02-07'
,
'Kathy'
,
'Lois'
),
(
'2007-02-07'
,
'Eric'
,
'Francis'
),
(
'2007-02-06'
,
'Shawn'
,
'Theron'
),
(
'2007-02-06'
,
'U'
,
'Vincent'
),
(
'2007-02-06'
,
'Francis'
,
'George'
),
(
'2007-02-06'
,
'George'
,
'Hector'
),
(
'2007-02-06'
,
'Vincent'
,
'Walter'
),
(
'2007-02-06'
,
'Walter'
,
'X'
),
(
'2007-02-07'
,
'Lois'
,
'Mark'
),
(
'2007-02-07'
,
'Yuri'
,
'Zack'
),
(
'2007-02-07'
,
'Isaac'
,
'Jack'
),
(
'2007-02-07'
,
'Sharon'
,
'Mark'
),
(
'2007-02-07'
,
'Michael'
,
'Michelle'
),
(
'2007-02-07'
,
'Derick'
,
'Nathan'
),
(
'2007-02-07'
,
'Peter'
,
'Xavier'
),
(
'2007-02-07'
,
'Fred'
,
'Harold'
),
(
'2007-02-07'
,
'Katherine'
,
'Lisa'
),
(
'2007-02-07'
,
'Tom'
,
'Rina'
),
(
'2007-02-07'
,
'Jerry'
,
'Victor'
),
(
'2007-02-07'
,
'Alexander'
,
'Terry'
),
(
'2007-02-07'
,
'Justin'
,
'John'
),
(
'2007-02-07'
,
'Greg'
,
'Ernest'
),
(
'2007-02-07'
,
'Robert'
,
'Q'
),
(
'2007-02-07'
,
'Nate'
,
'Mark'
),
(
'2007-02-07'
,
'Oscar'
,
'Nate'
),
(
'2007-02-07'
,
'Alice'
,
'Zack'
),
(
'2007-02-07'
,
'Kathy'
,
'Jack'
),
(
'2007-02-06'
,
'Alice'
,
'Alice'
),
(
'2007-02-06'
,
'Charles'
,
'Brian'
),
(
'2007-02-06'
,
'David'
,
'Charles'
),
(
'2007-02-06'
,
'Eric'
,
'David'
),
(
'2007-02-07'
,
'Isaac'
,
'Hector'
),
(
'2007-02-07'
,
'Patricia'
,
'Oscar'
),
(
'2007-02-07'
,
'Q'
,
'Patricia'
),
(
'2007-02-07'
,
'Yuri'
,
'X'
),
(
'2007-02-07'
,
'Shawn'
,
'Robert'
),
(
'2007-02-07'
,
'Lois'
,
'Kathy'
),
(
'2007-02-07'
,
'Francis'
,
'Eric'
),
(
'2007-02-06'
,
'Theron'
,
'Shawn'
),
(
'2007-02-06'
,
'Vincent'
,
'U'
),
(
'2007-02-06'
,
'George'
,
'Francis'
),
(
'2007-02-06'
,
'Hector'
,
'George'
),
(
'2007-02-06'
,
'Walter'
,
'Vincent'
),
(
'2007-02-06'
,
'X'
,
'Walter'
),
(
'2007-02-07'
,
'Mark'
,
'Lois'
),
(
'2007-02-07'
,
'Zack'
,
'Yuri'
),
(
'2007-02-07'
,
'Jack'
,
'Isaac'
),
(
'2007-02-07'
,
'Mark'
,
'Sharon'
),
(
'2007-02-07'
,
'Michelle'
,
'Michael'
),
(
'2007-02-07'
,
'Nathan'
,
'Derick'
),
(
'2007-02-07'
,
'Xavier'
,
'Peter'
),
(
'2007-02-07'
,
'Harold'
,
'Fred'
),
(
'2007-02-07'
,
'Lisa'
,
'Katherine'
),
(
'2007-02-07'
,
'Rina'
,
'Tom'
),
(
'2007-02-07'
,
'Victor'
,
'Jerry'
),
(
'2007-02-07'
,
'Terry'
,
'Alexander'
),
(
'2007-02-07'
,
'John'
,
'Justin'
),
(
'2007-02-07'
,
'Ernest'
,
'Greg'
);
SELECT
*
FROM
t1
WHERE
first_name
=
'Andy'
OR
last_name
=
'Jake'
;
drop
table
t1
;
sql/ha_partition.cc
View file @
c3970e73
...
...
@@ -158,7 +158,7 @@ static uint alter_table_flags(uint flags __attribute__((unused)))
ha_partition
::
ha_partition
(
handlerton
*
hton
,
TABLE_SHARE
*
share
)
:
handler
(
hton
,
share
),
m_part_info
(
NULL
),
m_create_handler
(
FALSE
),
m_is_sub_partitioned
(
0
)
m_is_sub_partitioned
(
0
)
,
is_clone
(
FALSE
)
{
DBUG_ENTER
(
"ha_partition::ha_partition(table)"
);
init_handler_variables
();
...
...
@@ -180,8 +180,7 @@ ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share)
ha_partition
::
ha_partition
(
handlerton
*
hton
,
partition_info
*
part_info
)
:
handler
(
hton
,
NULL
),
m_part_info
(
part_info
),
m_create_handler
(
TRUE
),
m_is_sub_partitioned
(
m_part_info
->
is_sub_partitioned
())
m_is_sub_partitioned
(
m_part_info
->
is_sub_partitioned
()),
is_clone
(
FALSE
)
{
DBUG_ENTER
(
"ha_partition::ha_partition(part_info)"
);
init_handler_variables
();
...
...
@@ -2320,6 +2319,19 @@ err_handler:
DBUG_RETURN
(
error
);
}
handler
*
ha_partition
::
clone
(
MEM_ROOT
*
mem_root
)
{
handler
*
new_handler
=
get_new_handler
(
table
->
s
,
mem_root
,
table
->
s
->
db_type
);
((
ha_partition
*
)
new_handler
)
->
m_part_info
=
m_part_info
;
((
ha_partition
*
)
new_handler
)
->
is_clone
=
TRUE
;
if
(
new_handler
&&
!
new_handler
->
ha_open
(
table
,
table
->
s
->
normalized_path
.
str
,
table
->
db_stat
,
HA_OPEN_IGNORE_IF_LOCKED
))
return
new_handler
;
return
NULL
;
}
/*
Close handler object
...
...
@@ -2346,6 +2358,7 @@ int ha_partition::close(void)
DBUG_ENTER
(
"ha_partition::close"
);
delete_queue
(
&
m_queue
);
if
(
!
is_clone
)
bitmap_free
(
&
(
m_part_info
->
used_partitions
));
file
=
m_file
;
...
...
sql/ha_partition.h
View file @
c3970e73
...
...
@@ -132,7 +132,13 @@ private:
THR_LOCK_DATA
lock
;
/* MySQL lock */
PARTITION_SHARE
*
share
;
/* Shared lock info */
/*
TRUE <=> this object was created with ha_partition::clone and doesn't
"own" the m_part_info structure.
*/
bool
is_clone
;
public:
handler
*
clone
(
MEM_ROOT
*
mem_root
);
virtual
void
set_part_info
(
partition_info
*
part_info
)
{
m_part_info
=
part_info
;
...
...
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