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
8a5f3b53
Commit
8a5f3b53
authored
Mar 10, 2006
by
mikron@mikael-ronstr-ms-dator.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge mikael@gorf.tangent.org:/home/mikael/bug17127
into mikael-ronstr-ms-dator.local:/Users/mikron/bug17127
parents
0d54bc88
0a48cd76
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
0 deletions
+92
-0
mysql-test/r/partition.result
mysql-test/r/partition.result
+22
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+36
-0
sql/sql_partition.cc
sql/sql_partition.cc
+28
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+6
-0
No files found.
mysql-test/r/partition.result
View file @
8a5f3b53
...
...
@@ -423,6 +423,28 @@ x123 11,12 1
x234 NULL,1 1
drop table t1;
create table t1 (a int)
partition by range (a)
(partition p0 values less than (1));
alter table t1 add partition (partition p1 values in (2));
ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
alter table t1 add partition (partition p1);
ERROR HY000: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
drop table t1;
create table t1 (a int)
partition by list (a)
(partition p0 values in (1));
alter table t1 add partition (partition p1 values less than (2));
ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
alter table t1 add partition (partition p1);
ERROR HY000: LIST PARTITIONING requires definition of VALUES IN for each partition
drop table t1;
create table t1 (a int)
partition by hash (a)
(partition p0);
alter table t1 add partition (partition p1 values less than (2));
ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
alter table t1 add partition (partition p1 values in (2));
ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
partition by list (a)
(partition p0 values in (1));
alter table t1 rebuild partition;
...
...
mysql-test/t/partition.test
View file @
8a5f3b53
...
...
@@ -540,6 +540,42 @@ select partition_name, partition_description, table_rows
from
information_schema
.
partitions
where
table_schema
=
'test'
;
drop
table
t1
;
#
# Bug 17127
#
create
table
t1
(
a
int
)
partition
by
range
(
a
)
(
partition
p0
values
less
than
(
1
));
--
error
ER_PARTITION_WRONG_VALUES_ERROR
alter
table
t1
add
partition
(
partition
p1
values
in
(
2
));
--
error
ER_PARTITION_REQUIRES_VALUES_ERROR
alter
table
t1
add
partition
(
partition
p1
);
drop
table
t1
;
create
table
t1
(
a
int
)
partition
by
list
(
a
)
(
partition
p0
values
in
(
1
));
--
error
ER_PARTITION_WRONG_VALUES_ERROR
alter
table
t1
add
partition
(
partition
p1
values
less
than
(
2
));
--
error
ER_PARTITION_REQUIRES_VALUES_ERROR
alter
table
t1
add
partition
(
partition
p1
);
drop
table
t1
;
create
table
t1
(
a
int
)
partition
by
hash
(
a
)
(
partition
p0
);
--
error
ER_PARTITION_WRONG_VALUES_ERROR
alter
table
t1
add
partition
(
partition
p1
values
less
than
(
2
));
--
error
ER_PARTITION_WRONG_VALUES_ERROR
alter
table
t1
add
partition
(
partition
p1
values
in
(
2
));
drop
table
t1
;
#
# BUG 17947 Crash with REBUILD PARTITION
#
...
...
sql/sql_partition.cc
View file @
8a5f3b53
...
...
@@ -4133,6 +4133,34 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
((
flags
&
(
HA_FAST_CHANGE_PARTITION
|
HA_PARTITION_ONE_PHASE
))
!=
0
);
DBUG_PRINT
(
"info"
,
(
"*fast_alter_partition: %d flags: 0x%x"
,
*
fast_alter_partition
,
flags
));
if
(((
alter_info
->
flags
&
ALTER_ADD_PARTITION
)
||
(
alter_info
->
flags
&
ALTER_REORGANIZE_PARTITION
))
&&
(
thd
->
lex
->
part_info
->
part_type
!=
tab_part_info
->
part_type
))
{
if
(
thd
->
lex
->
part_info
->
part_type
==
RANGE_PARTITION
)
{
my_error
(
ER_PARTITION_WRONG_VALUES_ERROR
,
MYF
(
0
),
"RANGE"
,
"LESS THAN"
);
}
else
if
(
thd
->
lex
->
part_info
->
part_type
==
LIST_PARTITION
)
{
DBUG_ASSERT
(
thd
->
lex
->
part_info
->
part_type
==
LIST_PARTITION
);
my_error
(
ER_PARTITION_WRONG_VALUES_ERROR
,
MYF
(
0
),
"LIST"
,
"IN"
);
}
else
if
(
tab_part_info
->
part_type
==
RANGE_PARTITION
)
{
my_error
(
ER_PARTITION_REQUIRES_VALUES_ERROR
,
MYF
(
0
),
"RANGE"
,
"LESS THAN"
);
}
else
{
DBUG_ASSERT
(
tab_part_info
->
part_type
==
LIST_PARTITION
);
my_error
(
ER_PARTITION_REQUIRES_VALUES_ERROR
,
MYF
(
0
),
"LIST"
,
"IN"
);
}
DBUG_RETURN
(
TRUE
);
}
if
(
alter_info
->
flags
&
ALTER_ADD_PARTITION
)
{
/*
...
...
sql/sql_yacc.yy
View file @
8a5f3b53
...
...
@@ -3663,6 +3663,8 @@ opt_part_values:
YYABORT;
}
}
else
lex->part_info->part_type= HASH_PARTITION;
}
| VALUES LESS_SYM THAN_SYM part_func_max
{
...
...
@@ -3676,6 +3678,8 @@ opt_part_values:
YYABORT;
}
}
else
lex->part_info->part_type= RANGE_PARTITION;
}
| VALUES IN_SYM '(' part_list_func ')'
{
...
...
@@ -3689,6 +3693,8 @@ opt_part_values:
YYABORT;
}
}
else
lex->part_info->part_type= LIST_PARTITION;
}
;
...
...
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