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
dbf21ff3
Commit
dbf21ff3
authored
Jan 03, 2018
by
Eugene Kosov
Committed by
GitHub
Jan 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14787 CREATE does not allow tables with versioning columns only, but ALTER does
parent
b8b5d8d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
mysql-test/suite/versioning/r/alter.result
mysql-test/suite/versioning/r/alter.result
+5
-0
mysql-test/suite/versioning/t/alter.test
mysql-test/suite/versioning/t/alter.test
+6
-0
sql/sql_table.cc
sql/sql_table.cc
+7
-0
No files found.
mysql-test/suite/versioning/r/alter.result
View file @
dbf21ff3
...
...
@@ -445,5 +445,10 @@ t CREATE TABLE `t` (
alter table t add fulltext key (c);
Warnings:
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
create or replace table t (a int) with system versioning;
alter table t drop column a;
ERROR HY000: Table `t` must have at least one temporal column
alter table t drop column a, drop column a;
ERROR 42000: Can't DROP COLUMN `a`; check that it exists
drop database test;
create database test;
mysql-test/suite/versioning/t/alter.test
View file @
dbf21ff3
...
...
@@ -377,6 +377,12 @@ create or replace table t (c text) engine=innodb with system versioning;
show
create
table
t
;
alter
table
t
add
fulltext
key
(
c
);
create
or
replace
table
t
(
a
int
)
with
system
versioning
;
--
error
ER_VERS_TABLE_MUST_HAVE_COLUMNS
alter
table
t
drop
column
a
;
--
error
ER_CANT_DROP_FIELD_OR_KEY
alter
table
t
drop
column
a
,
drop
column
a
;
drop
database
test
;
create
database
test
;
sql/sql_table.cc
View file @
dbf21ff3
...
...
@@ -8363,6 +8363,13 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
}
}
if
(
table
->
versioned
()
&&
!
(
alter_info
->
flags
&
Alter_info
::
ALTER_DROP_SYSTEM_VERSIONING
)
&&
new_create_list
.
elements
==
VERSIONING_FIELDS
)
{
my_error
(
ER_VERS_TABLE_MUST_HAVE_COLUMNS
,
MYF
(
0
),
table
->
s
->
table_name
.
str
);
goto
err
;
}
if
(
!
create_info
->
comment
.
str
)
{
create_info
->
comment
.
str
=
table
->
s
->
comment
.
str
;
...
...
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