1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.2 into bb-10.2-ext

This commit is contained in:
Marko Mäkelä
2017-09-20 17:47:49 +03:00
230 changed files with 3599 additions and 2155 deletions

View File

@@ -2911,16 +2911,31 @@ drop table t1;
set sql_warnings = 0;
# TIME_FORMAT()
set sql_warnings = 1;
create table t1 (a datetime, b varchar(10) as (time_format(a,"%d.%m.%Y")));
create table t1 (a datetime, b varchar(10) as (time_format(a,"%H.%i.%S")));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
`b` varchar(10) GENERATED ALWAYS AS (time_format(`a`,'%d.%m.%Y')) VIRTUAL
`b` varchar(10) GENERATED ALWAYS AS (time_format(`a`,'%H.%i.%S')) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('2001-01-01 02:02:02',default);
insert into t1 values ('2001-01-01 02:03:04',default);
select * from t1;
a b
2001-01-01 02:02:02 01.01.2001
2001-01-01 02:03:04 02.03.04
drop table t1;
set sql_warnings = 0;
# TIME_FORMAT() STORED
set sql_warnings = 1;
create table t1 (a datetime, b varchar(10) as (time_format(a,"%H.%i.%S")) STORED);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
`b` varchar(10) GENERATED ALWAYS AS (time_format(`a`,'%H.%i.%S')) STORED
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('2001-01-01 02:03:04',default);
select * from t1;
a b
2001-01-01 02:03:04 02.03.04
drop table t1;
set sql_warnings = 0;