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
9b55cc73
Commit
9b55cc73
authored
Dec 15, 2017
by
Eugene Kosov
Committed by
GitHub
Dec 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL, IB: unversioned fields with ALTER TABLE [fixes #401]
parent
4624e565
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
1 deletion
+20
-1
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/handler.h
sql/handler.h
+2
-0
sql/sql_alter.h
sql/sql_alter.h
+2
-1
sql/sql_table.cc
sql/sql_table.cc
+2
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-0
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+1
-0
No files found.
mysql-test/suite/versioning/r/alter.result
View file @
9b55cc73
...
...
@@ -512,5 +512,10 @@ alter table t add system versioning;
ERROR HY000: Table `t` is already system-versioned table
alter table t add system versioning, drop system versioning;
ERROR HY000: Table `t` is already system-versioned table
set @@versioning_alter_history=keep;
create or replace table t(x int, y int) with system versioning engine=innodb;
alter table t modify y int without system versioning;
insert into t values(1, 1);
update t set y=2;
drop database test;
create database test;
mysql-test/suite/versioning/t/alter.test
View file @
9b55cc73
...
...
@@ -349,5 +349,11 @@ alter table t add system versioning;
--
error
ER_VERS_ALREADY_VERSIONED
alter
table
t
add
system
versioning
,
drop
system
versioning
;
set
@@
versioning_alter_history
=
keep
;
create
or
replace
table
t
(
x
int
,
y
int
)
with
system
versioning
engine
=
innodb
;
alter
table
t
modify
y
int
without
system
versioning
;
insert
into
t
values
(
1
,
1
);
update
t
set
y
=
2
;
drop
database
test
;
create
database
test
;
sql/handler.h
View file @
9b55cc73
...
...
@@ -2168,6 +2168,8 @@ class Alter_inplace_info
static
const
HA_ALTER_FLAGS
ALTER_DROP_HISTORICAL
=
1ULL
<<
41
;
static
const
HA_ALTER_FLAGS
ALTER_COLUMN_UNVERSIONED
=
1ULL
<<
42
;
/**
Create options (like MAX_ROWS) for the new version of table.
...
...
sql/sql_alter.h
View file @
9b55cc73
...
...
@@ -95,7 +95,8 @@ class Alter_info
// Set for ADD [COLUMN] FIRST | AFTER
ALTER_COLUMN_ORDER
=
1L
<<
25
,
ALTER_ADD_CHECK_CONSTRAINT
=
1L
<<
27
,
ALTER_DROP_CHECK_CONSTRAINT
=
1L
<<
28
ALTER_DROP_CHECK_CONSTRAINT
=
1L
<<
28
,
ALTER_COLUMN_UNVERSIONED
=
1L
<<
29
,
};
enum
enum_enable_or_disable
{
LEAVE_AS_IS
,
ENABLE
,
DISABLE
};
...
...
sql/sql_table.cc
View file @
9b55cc73
...
...
@@ -6562,6 +6562,8 @@ static bool fill_alter_inplace_info(THD *thd,
ha_alter_info
->
handler_flags
|=
Alter_inplace_info
::
ALTER_DROP_CHECK_CONSTRAINT
;
if
(
thd
->
variables
.
vers_alter_history
==
VERS_ALTER_HISTORY_DROP
)
ha_alter_info
->
handler_flags
|=
Alter_inplace_info
::
ALTER_DROP_HISTORICAL
;
if
(
alter_info
->
flags
&
Alter_info
::
ALTER_COLUMN_UNVERSIONED
)
ha_alter_info
->
handler_flags
|=
Alter_inplace_info
::
ALTER_COLUMN_UNVERSIONED
;
/*
If we altering table with old VARCHAR fields we will be automatically
...
...
sql/sql_yacc.yy
View file @
9b55cc73
...
...
@@ -7112,11 +7112,13 @@ serial_attribute:
with_or_without_system:
WITH_SYSTEM_SYM
{
Lex->alter_info.flags|= Alter_info::ALTER_COLUMN_UNVERSIONED;
Lex->create_info.vers_info.versioned_fields= true;
$$= Column_definition::WITH_VERSIONING;
}
| WITHOUT SYSTEM
{
Lex->alter_info.flags|= Alter_info::ALTER_COLUMN_UNVERSIONED;
Lex->create_info.vers_info.unversioned_fields= true;
$$= Column_definition::WITHOUT_VERSIONING;
}
...
...
storage/innobase/handler/handler0alter.cc
View file @
9b55cc73
...
...
@@ -87,6 +87,7 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_REBUILD
/*
| Alter_inplace_info::ALTER_STORED_COLUMN_TYPE
*/
|
Alter_inplace_info
::
ALTER_COLUMN_UNVERSIONED
;
/** Operations that require changes to data */
...
...
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