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
d8aabb44
Commit
d8aabb44
authored
Dec 25, 2017
by
Eugene Kosov
Committed by
GitHub
Dec 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: prohibit ALTER ... AS ROW START|END [fixes #429]
parent
ea49441c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
32 deletions
+12
-32
mysql-test/suite/versioning/r/alter.result
mysql-test/suite/versioning/r/alter.result
+2
-2
mysql-test/suite/versioning/r/insert.result
mysql-test/suite/versioning/r/insert.result
+1
-1
mysql-test/suite/versioning/r/online.result
mysql-test/suite/versioning/r/online.result
+1
-1
mysql-test/suite/versioning/r/trx_id.result
mysql-test/suite/versioning/r/trx_id.result
+2
-2
mysql-test/suite/versioning/t/alter.test
mysql-test/suite/versioning/t/alter.test
+4
-4
sql/handler.cc
sql/handler.cc
+2
-19
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+0
-3
No files found.
mysql-test/suite/versioning/r/alter.result
View file @
d8aabb44
...
...
@@ -429,8 +429,8 @@ alter table t1 engine=myisam;
# MDEV-14692 crash in MDL_context::upgrade_shared_lock()
create or replace temporary table t (a int);
alter table t change column if exists b c bigint unsigned generated always as row start;
ERROR HY000:
GENERATED AS ROW START prohibited for TEMPORARY table
s
ERROR HY000:
This is not yet supported for generated column
s
alter table t change column if exists b c bigint unsigned generated always as row end;
ERROR HY000:
GENERATED AS ROW END prohibited for TEMPORARY table
s
ERROR HY000:
This is not yet supported for generated column
s
drop database test;
create database test;
mysql-test/suite/versioning/r/insert.result
View file @
d8aabb44
...
...
@@ -290,7 +290,7 @@ insert into t1(x) values (1);
ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry).
set global system_versioning_transaction_registry= on;
Warnings:
Warning 414
4
Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
Warning 414
3
Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
create or replace table t1 (
x int,
y int as (x) virtual,
...
...
mysql-test/suite/versioning/r/online.result
View file @
d8aabb44
...
...
@@ -14,7 +14,7 @@ alter table t drop system versioning, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Not implemented for system-versioned tables. Try ALGORITHM=COPY
set global system_versioning_transaction_registry=on;
Warnings:
Warning 414
4
Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
Warning 414
3
Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
create or replace table t (a int, b int) engine=innodb;
alter table t
add s bigint unsigned as row start,
...
...
mysql-test/suite/versioning/r/trx_id.result
View file @
d8aabb44
...
...
@@ -10,7 +10,7 @@ period for system_time (sys_trx_start, sys_trx_end)
ERROR HY000: Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry).
set global system_versioning_transaction_registry= 1;
Warnings:
Warning 414
4
Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
Warning 414
3
Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
create or replace table t1 (
x int,
sys_trx_start bigint(20) unsigned as row start invisible,
...
...
@@ -32,7 +32,7 @@ return if(cond = 1, '[CORRECT]', '[INCORRECT]');
set @@system_versioning_alter_history=keep;
set global system_versioning_transaction_registry=on;
Warnings:
Warning 414
4
Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
Warning 414
3
Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
create or replace table t1 (x int) engine innodb;
insert into t1 values (1);
alter table t1
...
...
mysql-test/suite/versioning/t/alter.test
View file @
d8aabb44
...
...
@@ -316,10 +316,10 @@ create or replace table non_empty (
)
engine
innodb
;
insert
into
non_empty
values
(
1
,
100
,
200
);
--
error
ER_
VERS_GENERATED_ALWAYS_NOT_EMPTY
--
error
ER_
UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
alter
table
non_empty
change
column
sys_trx_start
sys_trx_start
bigint
(
20
)
unsigned
as
row
start
invisible
;
--
error
ER_
VERS_GENERATED_ALWAYS_NOT_EMPTY
--
error
ER_
UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
alter
table
non_empty
change
column
sys_trx_end
sys_trx_end
bigint
(
20
)
unsigned
as
row
end
invisible
;
drop
table
non_empty
;
...
...
@@ -364,9 +364,9 @@ alter table t1 engine=myisam;
--
echo
# MDEV-14692 crash in MDL_context::upgrade_shared_lock()
create
or
replace
temporary
table
t
(
a
int
);
--
error
ER_
VERS_TEMPORARY
--
error
ER_
UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
alter
table
t
change
column
if
exists
b
c
bigint
unsigned
generated
always
as
row
start
;
--
error
ER_
VERS_TEMPORARY
--
error
ER_
UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
alter
table
t
change
column
if
exists
b
c
bigint
unsigned
generated
always
as
row
end
;
...
...
sql/handler.cc
View file @
d8aabb44
...
...
@@ -7295,31 +7295,14 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info,
return
false
;
}
if
(
!
share
->
versioned
)
{
List_iterator_fast
<
Create_field
>
it
(
alter_info
->
create_list
);
while
(
Create_field
*
f
=
it
++
)
{
if
(
f
->
change
.
length
&&
f
->
flags
&
VERS_SYSTEM_FIELD
)
{
if
(
share
->
table_category
==
TABLE_CATEGORY_TEMPORARY
)
{
my_error
(
ER_VERS_TEMPORARY
,
MYF
(
0
),
f
->
flags
&
VERS_SYS_START_FLAG
?
"GENERATED AS ROW START"
:
"GENERATED AS ROW END"
);
return
true
;
}
if
(
thd
->
mdl_context
.
upgrade_shared_lock
(
table
->
mdl_ticket
,
MDL_EXCLUSIVE
,
thd
->
variables
.
lock_wait_timeout
))
return
true
;
if
(
table
->
file
->
info
(
HA_STATUS_VARIABLE
|
HA_STATUS_TIME
))
return
true
;
if
(
0
<
table
->
file
->
records
())
{
my_error
(
ER_VERS_GENERATED_ALWAYS_NOT_EMPTY
,
MYF
(
0
),
f
->
change
.
str
);
return
true
;
}
break
;
my_error
(
ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
,
MYF
(
0
));
return
true
;
}
}
}
...
...
sql/share/errmsg-utf8.txt
View file @
d8aabb44
...
...
@@ -7915,9 +7915,6 @@ ER_VERS_SYS_FIELD_NOT_HIDDEN
ER_NOT_LOG_TABLE
eng "Table %`s.%`s is not a log table"
ER_VERS_GENERATED_ALWAYS_NOT_EMPTY
eng "Can not modify column %`s to GENERATED ALWAYS AS ROW START/END for non-empty table"
ER_VERS_TRT_IS_DISABLED
eng "Temporal operation requires `mysql.transaction_registry` (@@system_versioning_transaction_registry)."
...
...
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