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
d35c7f2f
Commit
d35c7f2f
authored
Jun 20, 2006
by
mikael@dator5.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#18198: Too flexible partition functions
parent
c0850425
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
2 deletions
+48
-2
mysql-test/r/partition_error.result
mysql-test/r/partition_error.result
+17
-0
mysql-test/t/partition_error.test
mysql-test/t/partition_error.test
+22
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+9
-2
No files found.
mysql-test/r/partition_error.result
View file @
d35c7f2f
drop table if exists t1;
create table t1 (a int)
partition by range (a)
(partition p0 values less than ((select count(*) from t1)));
ERROR HY000: This partition function is not allowed
create table t1 (a int)
partition by range (a)
(partition p0 values less than (a);
ERROR 42S22: Unknown column 'a' in 'partition function'
create table t1 (a int)
partition by range (a)
(partition p0 values less than (1));
alter table t1 add partition (partition p1 values less than (a));
ERROR 42S22: Unknown column 'a' in 'partition function'
alter table t1 add partition
(partition p1 values less than ((select count(*) from t1)));
ERROR HY000: This partition function is not allowed
drop table t1;
create table t1 (a int)
engine = x
partition by key (a);
Warnings:
...
...
mysql-test/t/partition_error.test
View file @
d35c7f2f
...
...
@@ -8,6 +8,28 @@
drop
table
if
exists
t1
;
--
enable_warnings
#
# Bug 18198: Partitions: Too flexible functions
#
--
error
ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create
table
t1
(
a
int
)
partition
by
range
(
a
)
(
partition
p0
values
less
than
((
select
count
(
*
)
from
t1
)));
--
error
1054
create
table
t1
(
a
int
)
partition
by
range
(
a
)
(
partition
p0
values
less
than
(
a
);
create
table
t1
(
a
int
)
partition
by
range
(
a
)
(
partition
p0
values
less
than
(
1
));
--
error
1054
alter
table
t1
add
partition
(
partition
p1
values
less
than
(
a
));
--
error
ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
alter
table
t1
add
partition
(
partition
p1
values
less
than
((
select
count
(
*
)
from
t1
)));
drop
table
t1
;
#
# Bug 20397: Partitions: Crash when using non-existing engine
#
...
...
sql/sql_yacc.yy
View file @
d35c7f2f
...
...
@@ -3616,6 +3616,7 @@ part_bit_expr:
{
Item *part_expr= $1;
bool not_corr_func;
bool part_expression_ok= TRUE;
LEX *lex= Lex;
THD *thd= YYTHD;
longlong item_value;
...
...
@@ -3633,13 +3634,19 @@ part_bit_expr:
mem_alloc_error(sizeof(part_elem_value));
YYABORT;
}
part_expr->walk(&Item::check_partition_func_processor, 0,
(byte*)(&part_expression_ok));
if (!part_expression_ok)
{
my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
YYABORT;
}
if (part_expr->fix_fields(YYTHD, (Item**)0) ||
((context->table_list= save_list), FALSE) ||
(!part_expr->const_item()) ||
(!lex->safe_to_cache_query))
{
yyerror(ER(ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR
));
my_error(ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR, MYF(0
));
YYABORT;
}
thd->where= save_where;
...
...
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