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
2a0f7a34
Commit
2a0f7a34
authored
Nov 08, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: non-deterministic vcols in partitioning
parent
d1f37633
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
0 deletions
+34
-0
mysql-test/suite/vcol/inc/vcol_partition.inc
mysql-test/suite/vcol/inc/vcol_partition.inc
+11
-0
mysql-test/suite/vcol/r/vcol_partition_innodb.result
mysql-test/suite/vcol/r/vcol_partition_innodb.result
+6
-0
mysql-test/suite/vcol/r/vcol_partition_myisam.result
mysql-test/suite/vcol/r/vcol_partition_myisam.result
+6
-0
sql/item.cc
sql/item.cc
+8
-0
sql/item.h
sql/item.h
+1
-0
sql/table.cc
sql/table.cc
+2
-0
No files found.
mysql-test/suite/vcol/inc/vcol_partition.inc
View file @
2a0f7a34
...
...
@@ -126,3 +126,14 @@ select * from t1;
select
partition_name
,
table_rows
,
data_length
from
information_schema
.
partitions
where
table_name
=
't1'
;
drop
table
t1
;
#
# Restrictions when partitioned
#
--
error
ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
create
table
t1
(
a
int
,
b
datetime
as
(
now
()))
partition
by
hash
(
b
+
1
)
partitions
3
;
--
error
ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
create
table
t1
(
a
int
,
b
varchar
(
100
)
as
(
user
()))
partition
by
hash
(
b
+
1
)
partitions
3
;
--
error
ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
create
table
t1
(
a
int
,
b
double
as
(
rand
()))
partition
by
hash
(
b
+
1
)
partitions
3
;
mysql-test/suite/vcol/r/vcol_partition_innodb.result
View file @
2a0f7a34
...
...
@@ -81,3 +81,9 @@ p0 1 16384
p1 1 16384
p2 0 16384
drop table t1;
create table t1 (a int, b datetime as (now())) partition by hash(b+1) partitions 3;
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
create table t1 (a int, b varchar(100) as (user())) partition by hash(b+1) partitions 3;
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
create table t1 (a int, b double as (rand())) partition by hash(b+1) partitions 3;
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
mysql-test/suite/vcol/r/vcol_partition_myisam.result
View file @
2a0f7a34
...
...
@@ -81,3 +81,9 @@ p0 1 7
p1 1 7
p2 0 0
drop table t1;
create table t1 (a int, b datetime as (now())) partition by hash(b+1) partitions 3;
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
create table t1 (a int, b varchar(100) as (user())) partition by hash(b+1) partitions 3;
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
create table t1 (a int, b double as (rand())) partition by hash(b+1) partitions 3;
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
sql/item.cc
View file @
2a0f7a34
...
...
@@ -5576,6 +5576,14 @@ bool Item_field::vcol_in_partition_func_processor(void *int_arg)
return
FALSE
;
}
bool
Item_field
::
check_valid_arguments_processor
(
void
*
bool_arg
)
{
Virtual_column_info
*
vcol
=
field
->
vcol_info
;
if
(
!
vcol
)
return
FALSE
;
return
vcol
->
expr
->
walk
(
&
Item
::
check_partition_func_processor
,
0
,
NULL
)
||
vcol
->
expr
->
walk
(
&
Item
::
check_valid_arguments_processor
,
0
,
NULL
);
}
void
Item_field
::
cleanup
()
{
...
...
sql/item.h
View file @
2a0f7a34
...
...
@@ -2576,6 +2576,7 @@ class Item_field :public Item_ident
bool
register_field_in_bitmap
(
void
*
arg
);
bool
check_partition_func_processor
(
void
*
int_arg
)
{
return
FALSE
;}
bool
vcol_in_partition_func_processor
(
void
*
bool_arg
);
bool
check_valid_arguments_processor
(
void
*
bool_arg
);
bool
check_field_expression_processor
(
void
*
arg
);
bool
enumerate_field_refs_processor
(
void
*
arg
);
bool
update_table_bitmaps_processor
(
void
*
arg
);
...
...
sql/table.cc
View file @
2a0f7a34
...
...
@@ -3339,6 +3339,8 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share,
outparam
->
file
=
0
;
// For easier error checking
outparam
->
db_stat
=
0
;
thd
->
lex
->
context_analysis_only
=
save_context_analysis_only
;
if
(
outparam
->
expr_arena
)
outparam
->
expr_arena
->
free_items
();
free_root
(
&
outparam
->
mem_root
,
MYF
(
0
));
// Safe to call on bzero'd root
outparam
->
alias
.
free
();
DBUG_RETURN
(
error
);
...
...
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