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
2e73561c
Commit
2e73561c
authored
May 20, 2019
by
Aleksey Midenkov
Committed by
Sergei Golubchik
Jun 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-16804 SYSTEM VERSIONING columns not showing as GENERATED
Closes #830
parent
4a3d51c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
156 additions
and
2 deletions
+156
-2
mysql-test/suite/versioning/r/create.result
mysql-test/suite/versioning/r/create.result
+2
-2
mysql-test/suite/versioning/r/simple.result
mysql-test/suite/versioning/r/simple.result
+132
-0
mysql-test/suite/versioning/t/simple.test
mysql-test/suite/versioning/t/simple.test
+16
-0
sql/sql_show.cc
sql/sql_show.cc
+6
-0
No files found.
mysql-test/suite/versioning/r/create.result
View file @
2e73561c
...
...
@@ -54,7 +54,7 @@ character_octet_length NULL
character_set_name NULL
collation_name NULL
column_key
extra INVISIBLE
extra
STORED GENERATED,
INVISIBLE
column_comment start
is_generated ALWAYS
generation_expression ROW START
...
...
@@ -69,7 +69,7 @@ character_octet_length NULL
character_set_name NULL
collation_name NULL
column_key
extra INVISIBLE
extra
STORED GENERATED,
INVISIBLE
column_comment end
is_generated ALWAYS
generation_expression ROW END
...
...
mysql-test/suite/versioning/r/simple.result
View file @
2e73561c
...
...
@@ -71,3 +71,135 @@ and d.dept_id = e.dept_id;
emp_id dept_id name salary dept_id name
1 10 bill 2000 10 accounting
drop table emp, dept;
create table t1 (
a timestamp(6),
b timestamp(6) generated always as (a + interval 1 day),
c timestamp(6) generated always as (a + interval 1 month) stored,
d timestamp(6) generated always as row start,
e timestamp(6) generated always as row end,
period for system_time(d,e)
) with system versioning;
show columns from t1;
Field Type Null Key Default Extra
a timestamp(6) NO current_timestamp(6) on update current_timestamp(6)
b timestamp(6) YES NULL VIRTUAL GENERATED
c timestamp(6) YES NULL STORED GENERATED
d timestamp(6) NO NULL STORED GENERATED
e timestamp(6) NO NULL STORED GENERATED
select *,'---' from information_schema.columns where table_name='t1';
TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1
COLUMN_NAME a
ORDINAL_POSITION 1
COLUMN_DEFAULT current_timestamp(6)
IS_NULLABLE NO
DATA_TYPE timestamp
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION NULL
NUMERIC_SCALE NULL
DATETIME_PRECISION 6
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
COLUMN_TYPE timestamp(6)
COLUMN_KEY
EXTRA on update current_timestamp(6)
PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
--- ---
TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1
COLUMN_NAME b
ORDINAL_POSITION 2
COLUMN_DEFAULT NULL
IS_NULLABLE YES
DATA_TYPE timestamp
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION NULL
NUMERIC_SCALE NULL
DATETIME_PRECISION 6
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
COLUMN_TYPE timestamp(6)
COLUMN_KEY
EXTRA VIRTUAL GENERATED
PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED ALWAYS
GENERATION_EXPRESSION `a` + interval 1 day
--- ---
TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1
COLUMN_NAME c
ORDINAL_POSITION 3
COLUMN_DEFAULT NULL
IS_NULLABLE YES
DATA_TYPE timestamp
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION NULL
NUMERIC_SCALE NULL
DATETIME_PRECISION 6
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
COLUMN_TYPE timestamp(6)
COLUMN_KEY
EXTRA STORED GENERATED
PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED ALWAYS
GENERATION_EXPRESSION `a` + interval 1 month
--- ---
TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1
COLUMN_NAME d
ORDINAL_POSITION 4
COLUMN_DEFAULT NULL
IS_NULLABLE NO
DATA_TYPE timestamp
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION NULL
NUMERIC_SCALE NULL
DATETIME_PRECISION 6
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
COLUMN_TYPE timestamp(6)
COLUMN_KEY
EXTRA STORED GENERATED
PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED ALWAYS
GENERATION_EXPRESSION ROW START
--- ---
TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1
COLUMN_NAME e
ORDINAL_POSITION 5
COLUMN_DEFAULT NULL
IS_NULLABLE NO
DATA_TYPE timestamp
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION NULL
NUMERIC_SCALE NULL
DATETIME_PRECISION 6
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
COLUMN_TYPE timestamp(6)
COLUMN_KEY
EXTRA STORED GENERATED
PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED ALWAYS
GENERATION_EXPRESSION ROW END
--- ---
drop table t1;
mysql-test/suite/versioning/t/simple.test
View file @
2e73561c
...
...
@@ -71,3 +71,19 @@ where d.dept_id = 10
and
d
.
dept_id
=
e
.
dept_id
;
drop
table
emp
,
dept
;
#
# MDEV-16804 SYSTEM VERSIONING columns not showing as GENERATED
#
create
table
t1
(
a
timestamp
(
6
),
b
timestamp
(
6
)
generated
always
as
(
a
+
interval
1
day
),
c
timestamp
(
6
)
generated
always
as
(
a
+
interval
1
month
)
stored
,
d
timestamp
(
6
)
generated
always
as
row
start
,
e
timestamp
(
6
)
generated
always
as
row
end
,
period
for
system_time
(
d
,
e
)
)
with
system
versioning
;
show
columns
from
t1
;
query_vertical
select
*
,
'---'
from
information_schema
.
columns
where
table_name
=
't1'
;
drop
table
t1
;
sql/sql_show.cc
View file @
2e73561c
...
...
@@ -6001,9 +6001,15 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
else
if
(
field
->
flags
&
VERS_SYSTEM_FIELD
)
{
if
(
field
->
flags
&
VERS_SYS_START_FLAG
)
{
table
->
field
[
21
]
->
store
(
STRING_WITH_LEN
(
"ROW START"
),
cs
);
buf
.
set
(
STRING_WITH_LEN
(
"STORED GENERATED"
),
cs
);
}
else
{
table
->
field
[
21
]
->
store
(
STRING_WITH_LEN
(
"ROW END"
),
cs
);
buf
.
set
(
STRING_WITH_LEN
(
"STORED GENERATED"
),
cs
);
}
table
->
field
[
21
]
->
set_notnull
();
table
->
field
[
20
]
->
store
(
STRING_WITH_LEN
(
"ALWAYS"
),
cs
);
}
...
...
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