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
cf48e4cd
Commit
cf48e4cd
authored
Mar 13, 2006
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jimw/my/mysql-5.1-17097
into mysql.com:/home/jimw/my/mysql-5.1-clean
parents
d7762d4e
ed453f07
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
8 deletions
+32
-8
mysql-test/r/partition.result
mysql-test/r/partition.result
+11
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+11
-0
sql/sql_partition.cc
sql/sql_partition.cc
+10
-8
No files found.
mysql-test/r/partition.result
View file @
cf48e4cd
...
@@ -453,4 +453,15 @@ s1
...
@@ -453,4 +453,15 @@ s1
drop table t2;
drop table t2;
create temporary table t1 (a int) partition by hash(a);
create temporary table t1 (a int) partition by hash(a);
ERROR HY000: Cannot create temporary table with partitions
ERROR HY000: Cannot create temporary table with partitions
create table t1 (a int, b int) partition by list (a)
(partition p1 values in (1), partition p2 values in (2));
alter table t1 add primary key (b);
ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p1 VALUES IN (1) ENGINE = MyISAM, PARTITION p2 VALUES IN (2) ENGINE = MyISAM)
drop table t1;
End of 5.1 tests
End of 5.1 tests
mysql-test/t/partition.test
View file @
cf48e4cd
...
@@ -577,4 +577,15 @@ drop table t2;
...
@@ -577,4 +577,15 @@ drop table t2;
--
error
ER_PARTITION_NO_TEMPORARY
--
error
ER_PARTITION_NO_TEMPORARY
create
temporary
table
t1
(
a
int
)
partition
by
hash
(
a
);
create
temporary
table
t1
(
a
int
)
partition
by
hash
(
a
);
#
# Bug #17097: Partitions: failing ADD PRIMARY KEY leads to temporary rotten
# metadata,crash
#
create
table
t1
(
a
int
,
b
int
)
partition
by
list
(
a
)
(
partition
p1
values
in
(
1
),
partition
p2
values
in
(
2
));
--
error
ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
alter
table
t1
add
primary
key
(
b
);
show
create
table
t1
;
drop
table
t1
;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
sql/sql_partition.cc
View file @
cf48e4cd
...
@@ -4061,6 +4061,15 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
...
@@ -4061,6 +4061,15 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
{
{
DBUG_ENTER
(
"prep_alter_part_table"
);
DBUG_ENTER
(
"prep_alter_part_table"
);
/*
We are going to manipulate the partition info on the table object
so we need to ensure that the data structure of the table object
is freed by setting version to 0. table->s->version= 0 forces a
flush of the table object in close_thread_tables().
*/
if
(
table
->
part_info
)
table
->
s
->
version
=
0L
;
if
(
alter_info
->
flags
&
if
(
alter_info
->
flags
&
(
ALTER_ADD_PARTITION
|
ALTER_DROP_PARTITION
|
(
ALTER_ADD_PARTITION
|
ALTER_DROP_PARTITION
|
ALTER_COALESCE_PARTITION
|
ALTER_REORGANIZE_PARTITION
|
ALTER_COALESCE_PARTITION
|
ALTER_REORGANIZE_PARTITION
|
...
@@ -4069,19 +4078,12 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
...
@@ -4069,19 +4078,12 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
ALTER_REPAIR_PARTITION
|
ALTER_REBUILD_PARTITION
))
ALTER_REPAIR_PARTITION
|
ALTER_REBUILD_PARTITION
))
{
{
partition_info
*
tab_part_info
=
table
->
part_info
;
partition_info
*
tab_part_info
=
table
->
part_info
;
uint
flags
=
0
;
if
(
!
tab_part_info
)
if
(
!
tab_part_info
)
{
{
my_error
(
ER_PARTITION_MGMT_ON_NONPARTITIONED
,
MYF
(
0
));
my_error
(
ER_PARTITION_MGMT_ON_NONPARTITIONED
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
/*
We are going to manipulate the partition info on the table object
so we need to ensure that the data structure of the table object
is freed by setting version to 0. table->s->version= 0 forces a
flush of the table object in close_thread_tables().
*/
uint
flags
=
0
;
table
->
s
->
version
=
0L
;
if
(
alter_info
->
flags
==
ALTER_TABLE_REORG
)
if
(
alter_info
->
flags
==
ALTER_TABLE_REORG
)
{
{
uint
new_part_no
,
curr_part_no
;
uint
new_part_no
,
curr_part_no
;
...
...
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