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
03b54a6b
Commit
03b54a6b
authored
Dec 06, 2017
by
Eugene Kosov
Committed by
Aleksey Midenkov
Dec 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: table with duplicate ROW START/END columns [fixes #369]
parent
84b718ae
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
12 deletions
+35
-12
mysql-test/suite/versioning/r/create.result
mysql-test/suite/versioning/r/create.result
+12
-7
mysql-test/suite/versioning/t/create.test
mysql-test/suite/versioning/t/create.test
+11
-5
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+2
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+10
-0
No files found.
mysql-test/suite/versioning/r/create.result
View file @
03b54a6b
...
@@ -37,11 +37,10 @@ t1 CREATE TABLE `t1` (
...
@@ -37,11 +37,10 @@ t1 CREATE TABLE `t1` (
create or replace table t1 (
create or replace table t1 (
x3 int unsigned,
x3 int unsigned,
Sys_start SYS_TRX_TYPE generated always as row start,
Sys_start SYS_TRX_TYPE generated always as row start,
Sys_start2 SYS_TRX_TYPE generated always as row start,
Sys_end SYS_TRX_TYPE generated always as row end,
Sys_end SYS_TRX_TYPE generated always as row end,
period for system_time (
Sys_start
, Sys_end)
period for system_time (
x
, Sys_end)
) with system versioning;
) with system versioning;
ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start
2
` and `Sys_end`
ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end`
create or replace table t1 (
create or replace table t1 (
x4 int unsigned,
x4 int unsigned,
Sys_start SYS_TRX_TYPE generated always as row start,
Sys_start SYS_TRX_TYPE generated always as row start,
...
@@ -53,10 +52,9 @@ create or replace table t1 (
...
@@ -53,10 +52,9 @@ create or replace table t1 (
x5 int unsigned,
x5 int unsigned,
Sys_start SYS_TRX_TYPE generated always as row start,
Sys_start SYS_TRX_TYPE generated always as row start,
Sys_end SYS_TRX_TYPE generated always as row end,
Sys_end SYS_TRX_TYPE generated always as row end,
Sys_end2 SYS_TRX_TYPE generated always as row end,
period for system_time (Sys_start, x)
period for system_time (Sys_start, Sys_end)
) with system versioning;
) with system versioning;
ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end
2
`
ERROR HY000: PERIOD FOR SYSTEM_TIME must use columns `Sys_start` and `Sys_end`
create or replace table t1 (
create or replace table t1 (
x6 int unsigned,
x6 int unsigned,
period for system_time (Sys_start, Sys_end)
period for system_time (Sys_start, Sys_end)
...
@@ -66,7 +64,6 @@ create or replace table t1 (
...
@@ -66,7 +64,6 @@ create or replace table t1 (
x7 int unsigned,
x7 int unsigned,
Sys_start SYS_TRX_TYPE generated always as row start,
Sys_start SYS_TRX_TYPE generated always as row start,
Sys_end SYS_TRX_TYPE generated always as row end,
Sys_end SYS_TRX_TYPE generated always as row end,
Sys_end2 SYS_TRX_TYPE generated always as row end,
period for system_time (Sys_start, Sys_end)
period for system_time (Sys_start, Sys_end)
);
);
ERROR HY000: Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'
ERROR HY000: Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'
...
@@ -302,5 +299,13 @@ alter table t with system versioning;
...
@@ -302,5 +299,13 @@ alter table t with system versioning;
ERROR 42S21: Duplicate column name 'sys_trx_end'
ERROR 42S21: Duplicate column name 'sys_trx_end'
create or replace temporary table t (x int) with system versioning;
create or replace temporary table t (x int) with system versioning;
ERROR HY000: Incorrect usage of TEMPORARY and WITH SYSTEM VERSIONING
ERROR HY000: Incorrect usage of TEMPORARY and WITH SYSTEM VERSIONING
create or replace table t1 (
x11 int unsigned,
Sys_start0 timestamp(6) generated always as row start,
Sys_start timestamp(6) generated always as row start,
Sys_end timestamp(6) generated always as row end,
period for system_time (Sys_start, Sys_end)
) with system versioning;
ERROR HY000: Duplicate ROW START column `Sys_start`
drop database test;
drop database test;
create database test;
create database test;
mysql-test/suite/versioning/t/create.test
View file @
03b54a6b
...
@@ -43,9 +43,8 @@ show create table t1;
...
@@ -43,9 +43,8 @@ show create table t1;
eval
create
or
replace
table
t1
(
eval
create
or
replace
table
t1
(
x3
int
unsigned
,
x3
int
unsigned
,
Sys_start
$sys_datatype
generated
always
as
row
start
,
Sys_start
$sys_datatype
generated
always
as
row
start
,
Sys_start2
$sys_datatype
generated
always
as
row
start
,
Sys_end
$sys_datatype
generated
always
as
row
end
,
Sys_end
$sys_datatype
generated
always
as
row
end
,
period
for
system_time
(
Sys_start
,
Sys_end
)
period
for
system_time
(
x
,
Sys_end
)
)
with
system
versioning
;
)
with
system
versioning
;
--
replace_result
"bigint unsigned"
SYS_TRX_TYPE
timestamp
(
6
)
SYS_TRX_TYPE
--
replace_result
"bigint unsigned"
SYS_TRX_TYPE
timestamp
(
6
)
SYS_TRX_TYPE
...
@@ -63,8 +62,7 @@ eval create or replace table t1 (
...
@@ -63,8 +62,7 @@ eval create or replace table t1 (
x5
int
unsigned
,
x5
int
unsigned
,
Sys_start
$sys_datatype
generated
always
as
row
start
,
Sys_start
$sys_datatype
generated
always
as
row
start
,
Sys_end
$sys_datatype
generated
always
as
row
end
,
Sys_end
$sys_datatype
generated
always
as
row
end
,
Sys_end2
$sys_datatype
generated
always
as
row
end
,
period
for
system_time
(
Sys_start
,
x
)
period
for
system_time
(
Sys_start
,
Sys_end
)
)
with
system
versioning
;
)
with
system
versioning
;
--
error
ER_MISSING
--
error
ER_MISSING
...
@@ -79,7 +77,6 @@ eval create or replace table t1 (
...
@@ -79,7 +77,6 @@ eval create or replace table t1 (
x7
int
unsigned
,
x7
int
unsigned
,
Sys_start
$sys_datatype
generated
always
as
row
start
,
Sys_start
$sys_datatype
generated
always
as
row
start
,
Sys_end
$sys_datatype
generated
always
as
row
end
,
Sys_end
$sys_datatype
generated
always
as
row
end
,
Sys_end2
$sys_datatype
generated
always
as
row
end
,
period
for
system_time
(
Sys_start
,
Sys_end
)
period
for
system_time
(
Sys_start
,
Sys_end
)
);
);
...
@@ -289,5 +286,14 @@ alter table t with system versioning;
...
@@ -289,5 +286,14 @@ alter table t with system versioning;
--
error
ER_WRONG_USAGE
--
error
ER_WRONG_USAGE
create
or
replace
temporary
table
t
(
x
int
)
with
system
versioning
;
create
or
replace
temporary
table
t
(
x
int
)
with
system
versioning
;
--
error
ER_VERS_DUPLICATE_ROW_START_END
create
or
replace
table
t1
(
x11
int
unsigned
,
Sys_start0
timestamp
(
6
)
generated
always
as
row
start
,
Sys_start
timestamp
(
6
)
generated
always
as
row
start
,
Sys_end
timestamp
(
6
)
generated
always
as
row
end
,
period
for
system_time
(
Sys_start
,
Sys_end
)
)
with
system
versioning
;
drop
database
test
;
drop
database
test
;
create
database
test
;
create
database
test
;
sql/share/errmsg-utf8.txt
View file @
03b54a6b
...
@@ -7914,3 +7914,5 @@ ER_VERS_GENERATED_ALWAYS_NOT_EMPTY
...
@@ -7914,3 +7914,5 @@ ER_VERS_GENERATED_ALWAYS_NOT_EMPTY
ER_VERS_TRT_IS_DISABLED
ER_VERS_TRT_IS_DISABLED
eng "Some versioned DML requires `transaction_registry` to be set to ON."
eng "Some versioned DML requires `transaction_registry` to be set to ON."
ER_VERS_DUPLICATE_ROW_START_END
eng "Duplicate ROW %s column %`s"
sql/sql_yacc.yy
View file @
03b54a6b
...
@@ -6404,10 +6404,20 @@ field_def:
...
@@ -6404,10 +6404,20 @@ field_def:
{
{
case 1:
case 1:
p= &info.as_row.start;
p= &info.as_row.start;
if (*p)
{
my_yyabort_error((ER_VERS_DUPLICATE_ROW_START_END, MYF(0),
"START", field_name.str));
}
lex->last_field->flags|= VERS_SYS_START_FLAG;
lex->last_field->flags|= VERS_SYS_START_FLAG;
break;
break;
case 0:
case 0:
p= &info.as_row.end;
p= &info.as_row.end;
if (*p)
{
my_yyabort_error((ER_VERS_DUPLICATE_ROW_START_END, MYF(0),
"END", field_name.str));
}
lex->last_field->flags|= VERS_SYS_END_FLAG;
lex->last_field->flags|= VERS_SYS_END_FLAG;
break;
break;
default:
default:
...
...
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