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
f9d875d2
Commit
f9d875d2
authored
Nov 27, 2017
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: disable engine change [fixes #358]
parent
ababd6a9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
2 deletions
+18
-2
mysql-test/suite/versioning/r/alter.result
mysql-test/suite/versioning/r/alter.result
+2
-0
mysql-test/suite/versioning/t/alter.test
mysql-test/suite/versioning/t/alter.test
+2
-0
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+3
-0
sql/sql_table.cc
sql/sql_table.cc
+11
-2
No files found.
mysql-test/suite/versioning/r/alter.result
View file @
f9d875d2
...
...
@@ -22,6 +22,8 @@ t CREATE TABLE `t` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
alter table t add column y int;
ERROR HY000: Not allowed for versioned `test.t`. Change `versioning_alter_history` to proceed with ALTER.
alter table t engine innodb;
ERROR HY000: Not allowed for versioned `test.t`. Change to/from native versioning engine is prohibited.
alter table t drop system versioning;
show create table t;
Table Create Table
...
...
mysql-test/suite/versioning/t/alter.test
View file @
f9d875d2
...
...
@@ -12,6 +12,8 @@ show create table t;
--
error
ER_VERS_ALTER_NOT_ALLOWED
alter
table
t
add
column
y
int
;
--
error
ER_VERS_ALTER_ENGINE_PROHIBITED
alter
table
t
engine
innodb
;
alter
table
t
drop
system
versioning
;
show
create
table
t
;
...
...
sql/share/errmsg-utf8.txt
View file @
f9d875d2
...
...
@@ -7848,6 +7848,9 @@ WARN_VERS_PART_NON_HISTORICAL
ER_VERS_ALTER_NOT_ALLOWED
eng "Not allowed for versioned `%s.%s`. Change `versioning_alter_history` to proceed with ALTER."
ER_VERS_ALTER_ENGINE_PROHIBITED
eng "Not allowed for versioned `%s.%s`. Change to/from native versioning engine is prohibited."
ER_VERS_RANGE_PROHIBITED
eng "SYSTEM_TIME range selector is prohibited"
...
...
sql/sql_table.cc
View file @
f9d875d2
...
...
@@ -8842,11 +8842,21 @@ bool mysql_alter_table(THD *thd, const char *new_db, const char *new_name,
bool
error
=
open_tables
(
thd
,
&
table_list
,
&
tables_opened
,
0
,
&
alter_prelocking_strategy
);
thd
->
open_options
&=
~
HA_OPEN_FOR_ALTER
;
bool
versioned
=
table_list
->
table
&&
table_list
->
table
->
versioned
();
TABLE
*
table
=
table_list
->
table
;
bool
versioned
=
table
&&
table
->
versioned
();
bool
vers_survival_mod
=
false
;
if
(
versioned
)
{
if
(
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
);
DBUG_RETURN
(
true
);
}
bool
vers_data_mod
=
alter_info
->
data_modifying
();
if
(
thd
->
variables
.
vers_alter_history
==
VERS_ALTER_HISTORY_SURVIVE
)
{
...
...
@@ -8895,7 +8905,6 @@ bool mysql_alter_table(THD *thd, const char *new_db, const char *new_name,
if
(
error
)
DBUG_RETURN
(
true
);
TABLE
*
table
=
table_list
->
table
;
table
->
use_all_columns
();
MDL_ticket
*
mdl_ticket
=
table
->
mdl_ticket
;
...
...
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