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
8c9c3020
Commit
8c9c3020
authored
Dec 06, 2017
by
Eugene Kosov
Committed by
Aleksey Midenkov
Dec 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: fix implicit sys fields for implicit engine of partitioned table [#366]
parent
03b54a6b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
9 deletions
+44
-9
mysql-test/suite/versioning/r/partition.result
mysql-test/suite/versioning/r/partition.result
+6
-0
mysql-test/suite/versioning/t/partition.test
mysql-test/suite/versioning/t/partition.test
+7
-0
sql/handler.cc
sql/handler.cc
+21
-3
sql/sql_table.cc
sql/sql_table.cc
+10
-6
No files found.
mysql-test/suite/versioning/r/partition.result
View file @
8c9c3020
...
@@ -287,4 +287,10 @@ x
...
@@ -287,4 +287,10 @@ x
select * from t1 partition (p1sp1) for system_time all;
select * from t1 partition (p1sp1) for system_time all;
x
x
2
2
create or replace table t1 (a bigint)
with system versioning
partition by range (a)
(partition p0 values less than (20) engine innodb,
partition p1 values less than maxvalue engine innodb);
insert into t1 values (1);
drop table t1;
drop table t1;
mysql-test/suite/versioning/t/partition.test
View file @
8c9c3020
...
@@ -229,6 +229,13 @@ select * from t1 partition (p0sp1) for system_time all;
...
@@ -229,6 +229,13 @@ select * from t1 partition (p0sp1) for system_time all;
select
*
from
t1
partition
(
p1sp0
)
for
system_time
all
;
select
*
from
t1
partition
(
p1sp0
)
for
system_time
all
;
select
*
from
t1
partition
(
p1sp1
)
for
system_time
all
;
select
*
from
t1
partition
(
p1sp1
)
for
system_time
all
;
create
or
replace
table
t1
(
a
bigint
)
with
system
versioning
partition
by
range
(
a
)
(
partition
p0
values
less
than
(
20
)
engine
innodb
,
partition
p1
values
less
than
maxvalue
engine
innodb
);
insert
into
t1
values
(
1
);
drop
table
t1
;
drop
table
t1
;
--
source
suite
/
versioning
/
common_finish
.
inc
--
source
suite
/
versioning
/
common_finish
.
inc
sql/handler.cc
View file @
8c9c3020
...
@@ -6872,7 +6872,25 @@ bool Vers_parse_info::check_and_fix_implicit(
...
@@ -6872,7 +6872,25 @@ bool Vers_parse_info::check_and_fix_implicit(
}
}
}
}
bool
integer_fields
=
create_info
->
db_type
->
flags
&
HTON_NATIVE_SYS_VERSIONING
;
bool
integer_fields
=
ha_check_storage_engine_flag
(
create_info
->
db_type
,
HTON_NATIVE_SYS_VERSIONING
);
#ifdef WITH_PARTITION_STORAGE_ENGINE
if
(
partition_info
*
info
=
thd
->
work_part_info
)
{
if
(
!
(
create_info
->
used_fields
&
HA_CREATE_USED_ENGINE
)
&&
info
->
partitions
.
elements
)
{
partition_element
*
element
=
static_cast
<
partition_element
*>
(
info
->
partitions
.
elem
(
0
));
handlerton
*
hton
=
element
->
engine_type
;
if
(
hton
&&
ha_check_storage_engine_flag
(
hton
,
HTON_NATIVE_SYS_VERSIONING
))
{
integer_fields
=
true
;
}
}
}
#endif
if
(
fix_implicit
(
thd
,
alter_info
,
integer_fields
))
if
(
fix_implicit
(
thd
,
alter_info
,
integer_fields
))
return
true
;
return
true
;
...
@@ -6947,8 +6965,8 @@ bool Vers_parse_info::check_and_fix_alter(THD *thd, Alter_info *alter_info,
...
@@ -6947,8 +6965,8 @@ bool Vers_parse_info::check_and_fix_alter(THD *thd, Alter_info *alter_info,
TABLE
*
table
)
TABLE
*
table
)
{
{
TABLE_SHARE
*
share
=
table
->
s
;
TABLE_SHARE
*
share
=
table
->
s
;
bool
integer_fields
=
bool
integer_fields
=
ha_check_storage_engine_flag
(
create_info
->
db_type
,
create_info
->
db_type
->
flags
&
HTON_NATIVE_SYS_VERSIONING
;
HTON_NATIVE_SYS_VERSIONING
)
;
const
char
*
table_name
=
share
->
table_name
.
str
;
const
char
*
table_name
=
share
->
table_name
.
str
;
if
(
!
need_check
()
&&
!
share
->
versioned
)
if
(
!
need_check
()
&&
!
share
->
versioned
)
...
...
sql/sql_table.cc
View file @
8c9c3020
...
@@ -8854,13 +8854,17 @@ bool mysql_alter_table(THD *thd, const char *new_db, const char *new_name,
...
@@ -8854,13 +8854,17 @@ bool mysql_alter_table(THD *thd, const char *new_db, const char *new_name,
if
(
versioned
)
if
(
versioned
)
{
{
if
(
create_info
->
db_type
&&
if
(
handlerton
*
hton1
=
create_info
->
db_type
)
table
->
s
->
db_type
()
!=
create_info
->
db_type
&&
(
table
->
file
->
native_versioned
()
||
create_info
->
db_type
->
flags
&
HTON_NATIVE_SYS_VERSIONING
))
{
{
my_error
(
ER_VERS_ALTER_ENGINE_PROHIBITED
,
MYF
(
0
),
table_list
->
db
,
table_list
->
table_name
);
handlerton
*
hton2
=
table
->
file
->
ht
;
DBUG_RETURN
(
true
);
if
(
hton1
!=
hton2
&&
(
ha_check_storage_engine_flag
(
hton1
,
HTON_NATIVE_SYS_VERSIONING
)
||
ha_check_storage_engine_flag
(
hton2
,
HTON_NATIVE_SYS_VERSIONING
)))
{
my_error
(
ER_VERS_ALTER_ENGINE_PROHIBITED
,
MYF
(
0
),
table_list
->
db
,
table_list
->
table_name
);
DBUG_RETURN
(
true
);
}
}
}
bool
vers_data_mod
=
alter_info
->
data_modifying
();
bool
vers_data_mod
=
alter_info
->
data_modifying
();
if
(
thd
->
variables
.
vers_alter_history
==
VERS_ALTER_HISTORY_SURVIVE
)
if
(
thd
->
variables
.
vers_alter_history
==
VERS_ALTER_HISTORY_SURVIVE
)
...
...
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