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
689f83d0
Commit
689f83d0
authored
Mar 29, 2018
by
Aleksey Midenkov
Committed by
Sergei Golubchik
Apr 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14790 System versioning for system tables does not work as expected
disallow system versioning for tables in mysql database
parent
dba43f4b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
6 deletions
+31
-6
mysql-test/suite/versioning/r/alter.result
mysql-test/suite/versioning/r/alter.result
+9
-0
mysql-test/suite/versioning/t/alter.test
mysql-test/suite/versioning/t/alter.test
+10
-0
sql/handler.cc
sql/handler.cc
+9
-3
sql/handler.h
sql/handler.h
+1
-1
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+2
-2
No files found.
mysql-test/suite/versioning/r/alter.result
View file @
689f83d0
...
...
@@ -517,5 +517,14 @@ alter table t drop column sys_trx_end, drop period for system_time;
ERROR HY000: Wrong parameters for `t`: missing 'DROP COLUMN `row_start`, DROP COLUMN `row_end`'
alter table t add period for system_time(sys_trx_start, sys_trx_end);
ERROR HY000: Table `t` is already system-versioned
#
# MDEV-14790 System versioning for system tables does not work as expected
#
use mysql;
create or replace table t (x int) with system versioning;
ERROR HY000: System versioning tables in the `mysql` database are not suported
alter table user add system versioning;
ERROR HY000: System versioning tables in the `mysql` database are not suported
use test;
drop database test;
create database test;
mysql-test/suite/versioning/t/alter.test
View file @
689f83d0
...
...
@@ -439,5 +439,15 @@ alter table t drop column sys_trx_end, drop period for system_time;
--
error
ER_VERS_ALREADY_VERSIONED
alter
table
t
add
period
for
system_time
(
sys_trx_start
,
sys_trx_end
);
--
echo
#
--
echo
# MDEV-14790 System versioning for system tables does not work as expected
--
echo
#
use
mysql
;
--
error
ER_VERS_DB_NOT_SUPPORTED
create
or
replace
table
t
(
x
int
)
with
system
versioning
;
--
error
ER_VERS_DB_NOT_SUPPORTED
alter
table
user
add
system
versioning
;
use
test
;
drop
database
test
;
create
database
test
;
sql/handler.cc
View file @
689f83d0
...
...
@@ -7108,7 +7108,7 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields(
return
true
;
}
if
(
vers_info
.
check_
with_conditions
(
create_table
.
table_name
.
str
))
if
(
vers_info
.
check_
conditions
(
create_table
.
table_name
.
str
,
create_table
.
db
))
return
true
;
bool
native
=
vers_native
(
thd
);
...
...
@@ -7221,7 +7221,7 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info,
if
(
alter_info
->
flags
&
ALTER_ADD_SYSTEM_VERSIONING
)
{
if
(
check_
with_conditions
(
table_name
))
if
(
check_
conditions
(
table_name
,
share
->
db
))
return
true
;
bool
native
=
create_info
->
vers_native
(
thd
);
if
(
check_sys_fields
(
table_name
,
alter_info
,
native
))
...
...
@@ -7298,7 +7298,8 @@ bool Vers_parse_info::need_check(const Alter_info *alter_info) const
alter_info
->
flags
&
ALTER_DROP_SYSTEM_VERSIONING
||
*
this
;
}
bool
Vers_parse_info
::
check_with_conditions
(
const
char
*
table_name
)
const
bool
Vers_parse_info
::
check_conditions
(
const
char
*
table_name
,
const
LString
&
db
)
const
{
if
(
!
as_row
.
start
||
!
as_row
.
end
)
{
...
...
@@ -7320,6 +7321,11 @@ bool Vers_parse_info::check_with_conditions(const char *table_name) const
return
true
;
}
if
(
db
.
streq
(
MYSQL_SCHEMA_NAME
))
{
my_error
(
ER_VERS_DB_NOT_SUPPORTED
,
MYF
(
0
),
MYSQL_SCHEMA_NAME
.
str
);
return
true
;
}
return
false
;
}
...
...
sql/handler.h
View file @
689f83d0
...
...
@@ -1955,7 +1955,7 @@ struct Vers_parse_info
return
as_row
.
start
||
as_row
.
end
||
system_time
.
start
||
system_time
.
end
;
}
bool
need_check
(
const
Alter_info
*
alter_info
)
const
;
bool
check_
with_conditions
(
const
char
*
table_name
)
const
;
bool
check_
conditions
(
const
char
*
table_name
,
const
LString
&
db
)
const
;
bool
check_sys_fields
(
const
char
*
table_name
,
Alter_info
*
alter_info
,
bool
native
);
...
...
sql/share/errmsg-utf8.txt
View file @
689f83d0
...
...
@@ -7889,8 +7889,8 @@ ER_VERS_ALTER_SYSTEM_FIELD
ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION
eng "Can not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIME"
ER_
UNUSED_27
eng "You should never see it
"
ER_
VERS_DB_NOT_SUPPORTED
eng "System versioning tables in the %`s database are not suported
"
ER_VERS_TRT_IS_DISABLED
eng "Transaction registry is disabled"
...
...
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