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
20ca1bcf
Commit
20ca1bcf
authored
Jan 12, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11527 Virtual columns do not get along well with NO_ZERO_DATE
don't check defaults for vcols
parent
0d1d0d77
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
mysql-test/suite/vcol/r/vcol_misc.result
mysql-test/suite/vcol/r/vcol_misc.result
+7
-0
mysql-test/suite/vcol/t/vcol_misc.test
mysql-test/suite/vcol/t/vcol_misc.test
+11
-0
sql/sql_table.cc
sql/sql_table.cc
+1
-1
No files found.
mysql-test/suite/vcol/r/vcol_misc.result
View file @
20ca1bcf
...
...
@@ -330,3 +330,10 @@ t1 CREATE TABLE `t1` (
`c1` varchar(50) COLLATE latin1_general_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
drop table t1;
set sql_mode='no_zero_date';
create table t1 (
ts timestamp not null default current_timestamp,
tsv timestamp as (adddate(ts, interval 1 day)) virtual
);
drop table t1;
set sql_mode=default;
mysql-test/suite/vcol/t/vcol_misc.test
View file @
20ca1bcf
...
...
@@ -290,3 +290,14 @@ create table t1 (a int, b int as (b is null) virtual);
create
table
t1
(
v1
varchar
(
255
)
as
(
c1
)
persistent
,
c1
varchar
(
50
))
collate
=
latin1_general_ci
;
show
create
table
t1
;
drop
table
t1
;
#
# MDEV-11527 Virtual columns do not get along well with NO_ZERO_DATE
#
set
sql_mode
=
'no_zero_date'
;
create
table
t1
(
ts
timestamp
not
null
default
current_timestamp
,
tsv
timestamp
as
(
adddate
(
ts
,
interval
1
day
))
virtual
);
drop
table
t1
;
set
sql_mode
=
default
;
sql/sql_table.cc
View file @
20ca1bcf
...
...
@@ -3826,7 +3826,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
Field
::
utype
type
=
(
Field
::
utype
)
MTYP_TYPENR
(
sql_field
->
unireg_check
);
if
(
thd
->
variables
.
sql_mode
&
MODE_NO_ZERO_DATE
&&
!
sql_field
->
def
&&
!
sql_field
->
def
&&
!
sql_field
->
vcol_info
&&
sql_field
->
sql_type
==
MYSQL_TYPE_TIMESTAMP
&&
(
sql_field
->
flags
&
NOT_NULL_FLAG
)
&&
(
type
==
Field
::
NONE
||
type
==
Field
::
TIMESTAMP_UN_FIELD
))
...
...
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