store/show vcols as item->print()

otherwise we'd need to store sql_mode *per vcol*
(consider CREATE INDEX...) and how SHOW CREATE TABLE would
support that?

Additionally, get rid of vcol::expr_str, just to make sure
the string is always generated and never leaked in the
original form.
This commit is contained in:
Sergei Golubchik 2016-11-07 17:17:40 +01:00
parent 8b3b6dc377
commit a411d7f4f6
132 changed files with 2091 additions and 2192 deletions
mysql-test
r
suite
t
sql

View file

@ -2073,8 +2073,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `min` CHECK (a+b > 100),
CONSTRAINT `mini` CHECK (a+b > 100)
CONSTRAINT `min` CHECK (((`a` + `b`) > 100)),
CONSTRAINT `mini` CHECK (((`a` + `b`) > 100))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(a INT, b INT, CONSTRAINT min check (a>5),

View file

@ -804,7 +804,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(5) AS (cast("a" as char(10) binary) + a) VIRTUAL
`b` char(5) AS ((cast('a' as char(10) charset latin1) + `a`)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select collation(cast("a" as char(10) binary));

View file

@ -3,10 +3,10 @@ create table t1 (a int check(a>10), b int check (b > 20), constraint `min` check
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL CHECK (a>10),
`b` int(11) DEFAULT NULL CHECK (b > 20),
CONSTRAINT `min` CHECK (a+b > 100),
CONSTRAINT `max` CHECK (a+b <500)
`a` int(11) DEFAULT NULL CHECK ((`a` > 10)),
`b` int(11) DEFAULT NULL CHECK ((`b` > 20)),
CONSTRAINT `min` CHECK (((`a` + `b`) > 100)),
CONSTRAINT `max` CHECK (((`a` + `b`) < 500))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (100,100);
insert into t1 values (1,1);
@ -52,12 +52,12 @@ set check_constraint_checks=@save_check_constraint;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL CHECK (a>10),
`b` int(11) DEFAULT NULL CHECK (b > 20),
`c` int(11) DEFAULT 0 CHECK (c < 10),
CONSTRAINT `min` CHECK (a+b > 100),
CONSTRAINT `max` CHECK (a+b <500),
CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500)
`a` int(11) DEFAULT NULL CHECK ((`a` > 10)),
`b` int(11) DEFAULT NULL CHECK ((`b` > 20)),
`c` int(11) DEFAULT 0 CHECK ((`c` < 10)),
CONSTRAINT `min` CHECK (((`a` + `b`) > 100)),
CONSTRAINT `max` CHECK (((`a` + `b`) < 500)),
CONSTRAINT `CONSTRAINT_1` CHECK ((((`a` + `b`) + `c`) < 500))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values(105,105,105);
ERROR 23000: CONSTRAINT `c` failed for `test`.`t1`
@ -75,12 +75,12 @@ create table t2 like t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL CHECK (a>10),
`b` int(11) DEFAULT NULL CHECK (b > 20),
`c` int(11) DEFAULT 0 CHECK (c < 10),
CONSTRAINT `min` CHECK (a+b > 100),
CONSTRAINT `max` CHECK (a+b <500),
CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500)
`a` int(11) DEFAULT NULL CHECK ((`a` > 10)),
`b` int(11) DEFAULT NULL CHECK ((`b` > 20)),
`c` int(11) DEFAULT 0 CHECK ((`c` < 10)),
CONSTRAINT `min` CHECK (((`a` + `b`) > 100)),
CONSTRAINT `max` CHECK (((`a` + `b`) < 500)),
CONSTRAINT `CONSTRAINT_1` CHECK ((((`a` + `b`) + `c`) < 500))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t2 drop constraint c;
ERROR 42000: Can't DROP CONSTRAINT `c`; check that it exists
@ -91,11 +91,11 @@ alter table t2 drop constraint min;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL CHECK (a>10),
`b` int(11) DEFAULT NULL CHECK (b > 20),
`c` int(11) DEFAULT 0 CHECK (c < 10),
CONSTRAINT `max` CHECK (a+b <500),
CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500)
`a` int(11) DEFAULT NULL CHECK ((`a` > 10)),
`b` int(11) DEFAULT NULL CHECK ((`b` > 20)),
`c` int(11) DEFAULT 0 CHECK ((`c` < 10)),
CONSTRAINT `max` CHECK (((`a` + `b`) < 500)),
CONSTRAINT `CONSTRAINT_1` CHECK ((((`a` + `b`) + `c`) < 500))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2;
create or replace table t1 (a int, b int, constraint check (a>b));
@ -104,7 +104,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `CONSTRAINT_1` CHECK (a>b)
CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > `b`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a int, b int,
constraint CONSTRAINT_1 check (a>1),
@ -114,8 +114,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `CONSTRAINT_1` CHECK (a>1),
CONSTRAINT `CONSTRAINT_2` CHECK (b>1)
CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > 1)),
CONSTRAINT `CONSTRAINT_2` CHECK ((`b` > 1))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a int, b int,
constraint CONSTRAINT_1 check (a>1),
@ -126,8 +126,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `CONSTRAINT_1` CHECK (a>1),
CONSTRAINT `CONSTRAINT_3` CHECK (b>1),
CONSTRAINT `CONSTRAINT_2` CHECK (a>b)
CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > 1)),
CONSTRAINT `CONSTRAINT_3` CHECK ((`b` > 1)),
CONSTRAINT `CONSTRAINT_2` CHECK ((`a` > `b`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;

View file

@ -3,7 +3,7 @@ create table t1 (a int check (a>0));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL CHECK (a>0)
`a` int(11) DEFAULT NULL CHECK ((`a` > 0))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (1);
insert into t1 values (0);
@ -15,7 +15,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `CONSTRAINT_1` CHECK (a>b)
CONSTRAINT `CONSTRAINT_1` CHECK ((`a` > `b`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (1,0);
insert into t1 values (0,1);
@ -27,7 +27,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `abc` CHECK (a>b)
CONSTRAINT `abc` CHECK ((`a` > `b`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (1,0);
insert into t1 values (0,1);

View file

@ -1866,8 +1866,8 @@ Thinkpad Laptop black ttt
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`color` char(32) AS (COLUMN_GET(dynamic_cols, 1 as char)) PERSISTENT,
`cl` char(32) AS (COLUMN_GET(COLUMN_ADD(COLUMN_CREATE(1 , 'blue' as char), 2, 'ttt'), i as char)) PERSISTENT,
`color` char(32) AS (column_get(`dynamic_cols`,1 as char charset latin1)) PERSISTENT,
`cl` char(32) AS (column_get(column_add(column_create(1,'blue' AS char charset latin1 ),2,'ttt'),`i` as char charset latin1)) PERSISTENT,
`item_name` varchar(32) NOT NULL,
`i` int(11) DEFAULT NULL,
`dynamic_cols` blob DEFAULT NULL,
@ -1888,7 +1888,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`n` int(11) DEFAULT NULL,
`c` char(32) AS (convert(cast(n as char), char)) PERSISTENT
`c` char(32) AS (cast(cast(`n` as char charset latin1) as char charset latin1)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set @@session.collation_server=filename;

View file

@ -2869,11 +2869,11 @@ NULL
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()`
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select concat(v_LastPaymentDate@0,now()) AS `CONCAT(v_LastPaymentDate, NOW())`
Note 1003 select concat(v_LastPaymentDate@0,current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion

View file

@ -3278,11 +3278,11 @@ NULL
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()`
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select concat(convert(v_LastPaymentDate@0 using cp1251),now()) AS `CONCAT(v_LastPaymentDate, NOW())`
Note 1003 select concat(convert(v_LastPaymentDate@0 using cp1251),current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion

View file

@ -3575,11 +3575,11 @@ NULL
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()`
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select concat(v_LastPaymentDate@0,now()) AS `CONCAT(v_LastPaymentDate, NOW())`
Note 1003 select concat(v_LastPaymentDate@0,current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion

View file

@ -4419,8 +4419,8 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
`mn` varchar(10) DEFAULT LIKE_RANGE_MIN(a,10),
`mx` varchar(10) DEFAULT LIKE_RANGE_MAX(a,10)
`mn` varchar(10) DEFAULT like_range_min(`a`,10),
`mx` varchar(10) DEFAULT like_range_max(`a`,10)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('a'),('a_'),('a%');
SELECT a, HEX(mn), HEX(mx) FROM t1;

View file

@ -4478,11 +4478,11 @@ NULL
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()`
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select concat(convert(v_LastPaymentDate@0 using ucs2),convert(now() using ucs2)) AS `CONCAT(v_LastPaymentDate, NOW())`
Note 1003 select concat(convert(v_LastPaymentDate@0 using ucs2),convert(current_timestamp() using ucs2)) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion

View file

@ -5320,11 +5320,11 @@ NULL
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Level Code Message
Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
Note 1003 select (v_LastPaymentDate@0 < current_timestamp()) AS `v_LastPaymentDate < NOW()`
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select concat(convert(v_LastPaymentDate@0 using utf8),now()) AS `CONCAT(v_LastPaymentDate, NOW())`
Note 1003 select concat(convert(v_LastPaymentDate@0 using utf8),current_timestamp()) AS `CONCAT(v_LastPaymentDate, NOW())`
DROP PROCEDURE p1;
#
# Bug#52159 returning time type from function and empty left join causes debug assertion
@ -10515,7 +10515,7 @@ SET NAMES utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT CONCAT('ß')
`a` varchar(30) DEFAULT concat('ß')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (DEFAULT);
SELECT HEX(a),a FROM t1;
@ -10528,9 +10528,9 @@ ALTER TABLE t1 ADD c VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT CONCAT('ß'),
`b` varchar(30) DEFAULT CONCAT('ß'),
`c` varchar(30) DEFAULT CONCAT('ß')
`a` varchar(30) DEFAULT concat('ß'),
`b` varchar(30) DEFAULT concat('ß'),
`c` varchar(30) DEFAULT concat('ß')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DELETE FROM t1;
INSERT INTO t1 VALUES();
@ -10551,7 +10551,7 @@ SET NAMES utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) CHARACTER SET utf8 DEFAULT CONCAT('ß')
`a` varchar(30) CHARACTER SET utf8 DEFAULT concat('ß')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (DEFAULT);
SELECT HEX(a), a FROM t1;
@ -10563,7 +10563,7 @@ CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET latin1 DEFAULT CONCAT('ß'));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT CONCAT('ß')
`a` varchar(30) DEFAULT concat('ß')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (DEFAULT);
SELECT HEX(a) FROM t1;
@ -10575,7 +10575,7 @@ CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 DEFAULT CONCAT('ß'));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) CHARACTER SET utf8 DEFAULT CONCAT('ß')
`a` varchar(30) CHARACTER SET utf8 DEFAULT concat('ß')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (DEFAULT);
SELECT HEX(a) FROM t1;

File diff suppressed because it is too large Load diff

View file

@ -1908,16 +1908,16 @@ Table Create Table
t1 CREATE TABLE `t1` (
`name` varchar(10) DEFAULT NULL,
`value` varchar(10) DEFAULT NULL,
`dyncol0` blob DEFAULT COLUMN_CREATE(name, value),
`value_dyncol0_name0` varchar(10) DEFAULT (COLUMN_GET(dyncol0, 'name0' AS CHAR)),
`dyncol1` blob DEFAULT COLUMN_ADD(dyncol0, 'name1', 'value1'),
`value_dyncol1_name1` varchar(10) DEFAULT (COLUMN_GET(dyncol1, 'name1' AS CHAR)),
`dyncol2` blob DEFAULT COLUMN_DELETE(dyncol1, 'name1'),
`dyncol2_exists_name0` int(11) DEFAULT COLUMN_EXISTS(dyncol2, 'name0'),
`dyncol2_exists_name1` int(11) DEFAULT COLUMN_EXISTS(dyncol2, 'name1'),
`dyncol2_check` int(11) DEFAULT COLUMN_CHECK(dyncol2),
`dyncol1_list` text DEFAULT COLUMN_LIST(dyncol1),
`dyncol1_json` text DEFAULT COLUMN_JSON(dyncol1)
`dyncol0` blob DEFAULT column_create(`name`,`value`),
`value_dyncol0_name0` varchar(10) DEFAULT (column_get(`dyncol0`,'name0' as char charset utf8)),
`dyncol1` blob DEFAULT column_add(`dyncol0`,'name1','value1'),
`value_dyncol1_name1` varchar(10) DEFAULT (column_get(`dyncol1`,'name1' as char charset utf8)),
`dyncol2` blob DEFAULT column_add(`dyncol1`,'name1',NULL AS int),
`dyncol2_exists_name0` int(11) DEFAULT column_exists(`dyncol2`,'name0'),
`dyncol2_exists_name1` int(11) DEFAULT column_exists(`dyncol2`,'name1'),
`dyncol2_check` int(11) DEFAULT column_check(`dyncol2`),
`dyncol1_list` text DEFAULT column_list(`dyncol1`),
`dyncol1_json` text DEFAULT column_json(`dyncol1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (name,value) VALUES ('name0', 'value0');
SELECT value_dyncol0_name0, value_dyncol1_name1 FROM t1;

View file

@ -178,9 +178,9 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text DEFAULT NULL,
`b` blob DEFAULT COMPRESS(a),
`bl` int(11) DEFAULT UNCOMPRESSED_LENGTH(b),
`a1` text DEFAULT UNCOMPRESS(b)
`b` blob DEFAULT compress(`a`),
`bl` int(11) DEFAULT uncompressed_length(`b`),
`a1` text DEFAULT uncompress(`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (REPEAT('a',100));
SELECT bl, a1 FROM t1;

View file

@ -112,7 +112,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
`b` varchar(30) DEFAULT ENCRYPT(a,123)
`b` varchar(30) DEFAULT encrypt(`a`,123)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('hello');
SELECT * FROM t1;

View file

@ -1441,8 +1441,8 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT NULL,
`b` text DEFAULT SHA(a),
`c` text DEFAULT SHA2(a,224)
`b` text DEFAULT sha(`a`),
`c` text DEFAULT sha2(`a`,224)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('abc');
SELECT * FROM t1;

View file

@ -223,8 +223,8 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT NULL,
`b` blob DEFAULT DES_ENCRYPT(a, 'passwd'),
`c` text DEFAULT DES_DECRYPT(b, 'passwd')
`b` blob DEFAULT des_encrypt(`a`,'passwd'),
`c` text DEFAULT des_decrypt(`b`,'passwd')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('test');
SELECT c FROM t1;

View file

@ -2397,7 +2397,7 @@ FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`___________a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`___________a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`case_______a` timestamp NULL DEFAULT NULL,
`case_____a_a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`coalesce___a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',

View file

@ -1457,10 +1457,10 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT NULL,
`b` bigint(20) DEFAULT INET_ATON(a),
`a1` varchar(30) DEFAULT INET_NTOA(b),
`c` int(11) DEFAULT IS_IPV4(a),
`d` int(11) DEFAULT IS_IPV6(a)
`b` bigint(20) DEFAULT inet_aton(`a`),
`a1` varchar(30) DEFAULT inet_ntoa(`b`),
`c` int(11) DEFAULT is_ipv4(`a`),
`d` int(11) DEFAULT is_ipv6(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('192.168.001.001'),('::1'),('xxx');
SELECT * FROM t1;
@ -1480,10 +1480,10 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`str` varchar(128) DEFAULT NULL,
`addr` varbinary(16) DEFAULT INET6_ATON(str),
`str1` varchar(128) DEFAULT INET6_NTOA(addr),
`b` int(11) DEFAULT IS_IPV4_COMPAT(addr),
`c` int(11) DEFAULT IS_IPV4_MAPPED(addr)
`addr` varbinary(16) DEFAULT inet6_aton(`str`),
`str1` varchar(128) DEFAULT inet6_ntoa(`addr`),
`b` int(11) DEFAULT is_ipv4_compat(`addr`),
`c` int(11) DEFAULT is_ipv4_mapped(`addr`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (str) VALUES ('::FFFF:192.168.0.1'),('::10.0.5.9');
SELECT str, str1, b,c FROM t1;

View file

@ -874,7 +874,7 @@ explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_d
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select period_add('9602',-12) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03') AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(now())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)`
Note 1003 select period_add('9602',-12) AS `period_add("9602",-12)`,period_diff(199505,'9404') AS `period_diff(199505,"9404")`,from_days(to_days('960101')) AS `from_days(to_days("960101"))`,dayofmonth('1997-01-02') AS `dayofmonth("1997-01-02")`,month('1997-01-02') AS `month("1997-01-02")`,monthname('1972-03-04') AS `monthname("1972-03-04")`,dayofyear('0000-00-00') AS `dayofyear("0000-00-00")`,hour('1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute('23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week('1998-03-03') AS `WEEK("1998-03-03")`,yearweek('2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year('98-02-03') AS `year("98-02-03")`,(weekday(curdate()) - weekday(current_timestamp())) AS `weekday(curdate())-weekday(now())`,dayname('1962-03-03') AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec('0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format('1997-01-02 03:04:05','%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp('1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,('1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,('1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,('1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from '1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,('1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)`
SET @TMP='2007-08-01 12:22:49';
CREATE TABLE t1 (d DATETIME);
INSERT INTO t1 VALUES ('2007-08-01 12:22:59');
@ -1976,7 +1976,7 @@ select microsecond('12:00:00.123456'), microsecond('2009-12-31 23:59:59.000010')
microsecond('12:00:00.123456') microsecond('2009-12-31 23:59:59.000010')
123456 10
select now(258);
ERROR 42000: Too big precision 258 specified for 'now'. Maximum is 6
ERROR 42000: Too big precision 258 specified for 'current_timestamp'. Maximum is 6
SELECT 1 FROM DUAL WHERE YEAR(TIMEDIFF(NULL, '12:12:12'));
1
SELECT 1 FROM DUAL WHERE MONTH(TIMEDIFF(NULL, '12:12:12'));

View file

@ -24,7 +24,7 @@ select time_to_sec(sec_to_time(11111)), time_to_sec(sec_to_time(11111.22222));
time_to_sec(sec_to_time(11111)) 11111
time_to_sec(sec_to_time(11111.22222)) 11111.22222
select current_timestamp(7);
ERROR 42000: Too big precision 7 specified for 'now'. Maximum is 6
ERROR 42000: Too big precision 7 specified for 'current_timestamp'. Maximum is 6
select curtime(7);
ERROR 42000: Too big precision 7 specified for 'curtime'. Maximum is 6
drop table if exists t1;

View file

@ -483,7 +483,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 ( a INT, b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c TIMESTAMP NULL );
@ -491,7 +491,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE C
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`a` int(11) DEFAULT NULL,
`c` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@ -501,7 +501,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE C
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -527,7 +527,7 @@ CREATE TABLE t1 ( a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE N
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
`b` int(11) DEFAULT NULL,
`c` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@ -536,7 +536,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`c` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -546,7 +546,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` timestamp NULL DEFAULT NULL,
`a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -554,7 +554,7 @@ CREATE TABLE t1 ( a TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE CURRENT_TIMESTAMP
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` int(11) DEFAULT NULL,
`c` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@ -563,7 +563,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`c` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -573,7 +573,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` timestamp NULL DEFAULT NULL,
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -586,7 +586,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
@ -650,7 +650,7 @@ CREATE TABLE t2 SELECT a FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
@ -659,7 +659,7 @@ CREATE TABLE t3 SELECT b FROM t1;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`b` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t3;
b
@ -668,7 +668,7 @@ CREATE TABLE t4 SELECT c FROM t1;
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
`c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t4;
c
@ -695,7 +695,7 @@ CREATE TABLE t7 SELECT f FROM t1;
SHOW CREATE TABLE t7;
Table Create Table
t7 CREATE TABLE `t7` (
`f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`f` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t7;
f
@ -704,7 +704,7 @@ CREATE TABLE t8 SELECT g FROM t1;
SHOW CREATE TABLE t8;
Table Create Table
t8 CREATE TABLE `t8` (
`g` datetime DEFAULT CURRENT_TIMESTAMP
`g` datetime DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t8;
g
@ -713,7 +713,7 @@ CREATE TABLE t9 SELECT h FROM t1;
SHOW CREATE TABLE t9;
Table Create Table
t9 CREATE TABLE `t9` (
`h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
`h` datetime DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t9;
h
@ -753,25 +753,25 @@ SELECT * FROM t1;
SHOW CREATE TABLE t12;
Table Create Table
t12 CREATE TABLE `t12` (
`k` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`l` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`m` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`n` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`k` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`l` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`m` timestamp NOT NULL DEFAULT current_timestamp(),
`n` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
`o` timestamp NOT NULL DEFAULT '1986-09-27 03:00:00',
`p` timestamp NULL DEFAULT NULL,
`q` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`r` datetime DEFAULT CURRENT_TIMESTAMP,
`s` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`q` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`r` datetime DEFAULT current_timestamp(),
`s` datetime DEFAULT NULL ON UPDATE current_timestamp(),
`t` datetime DEFAULT NULL,
`u` datetime DEFAULT '1986-09-27 03:00:00',
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NOT NULL DEFAULT current_timestamp(),
`c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
`d` timestamp NOT NULL DEFAULT '1986-09-27 03:00:00',
`e` timestamp NULL DEFAULT NULL,
`f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`g` datetime DEFAULT CURRENT_TIMESTAMP,
`h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`f` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`g` datetime DEFAULT current_timestamp(),
`h` datetime DEFAULT NULL ON UPDATE current_timestamp(),
`i` datetime DEFAULT NULL,
`j` datetime DEFAULT '1986-09-27 03:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@ -792,7 +792,7 @@ CREATE TABLE t2 SELECT a FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`a` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
@ -801,7 +801,7 @@ CREATE TABLE t3 SELECT b FROM t1;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`b` datetime DEFAULT CURRENT_TIMESTAMP
`b` datetime DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t3;
b
@ -810,7 +810,7 @@ CREATE TABLE t4 SELECT c FROM t1;
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
`c` datetime DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t4;
c
@ -847,7 +847,7 @@ CREATE TABLE t2 ( b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRE
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SET TIMESTAMP = 2000.876543;
@ -1224,12 +1224,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime DEFAULT NULL,
`b` datetime DEFAULT '2011-11-18 00:00:00',
`like_b` datetime DEFAULT CURRENT_TIMESTAMP,
`like_b` datetime DEFAULT current_timestamp(),
`c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00',
`like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`like_c` datetime NOT NULL DEFAULT current_timestamp(),
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(),
`e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00',
`f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NOT NULL DEFAULT current_timestamp(),
`g` timestamp NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -1276,12 +1276,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime DEFAULT NULL,
`b` datetime DEFAULT '2011-11-18 00:00:00',
`like_b` datetime DEFAULT CURRENT_TIMESTAMP,
`like_b` datetime DEFAULT current_timestamp(),
`c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00',
`like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`like_c` datetime NOT NULL DEFAULT current_timestamp(),
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(),
`e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00',
`f` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NULL DEFAULT current_timestamp(),
`g` timestamp NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -1343,12 +1343,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime DEFAULT NULL,
`b` datetime DEFAULT '2011-11-18 00:00:00',
`like_b` datetime DEFAULT CURRENT_TIMESTAMP,
`like_b` datetime DEFAULT current_timestamp(),
`c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00',
`like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`like_c` datetime NOT NULL DEFAULT current_timestamp(),
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(),
`e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00',
`f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NOT NULL DEFAULT current_timestamp(),
`g` timestamp NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -1381,12 +1381,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime DEFAULT NULL,
`b` datetime DEFAULT '2011-11-18 00:00:00',
`like_b` datetime DEFAULT CURRENT_TIMESTAMP,
`like_b` datetime DEFAULT current_timestamp(),
`c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00',
`like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`like_c` datetime NOT NULL DEFAULT current_timestamp(),
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(),
`e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00',
`f` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NULL DEFAULT current_timestamp(),
`g` timestamp NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -1429,7 +1429,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 ( a ) VALUES ( 1 );
SELECT * FROM t1;
@ -2029,7 +2029,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 ( a INT, b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), c TIMESTAMP(6) NULL );
@ -2037,7 +2037,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UP
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`a` int(11) DEFAULT NULL,
`c` timestamp(6) NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@ -2047,7 +2047,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UP
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -2073,7 +2073,7 @@ CREATE TABLE t1 ( a TIMESTAMP(6) NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDAT
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6),
`b` int(11) DEFAULT NULL,
`c` timestamp(6) NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@ -2082,7 +2082,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`c` timestamp(6) NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -2092,7 +2092,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` timestamp(6) NULL DEFAULT NULL,
`a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6),
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -2100,7 +2100,7 @@ CREATE TABLE t1 ( a TIMESTAMP(6) NOT NULL DEFAULT NOW(6) ON UPDATE CURRENT_TIMES
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`b` int(11) DEFAULT NULL,
`c` timestamp(6) NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@ -2109,7 +2109,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`c` timestamp(6) NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -2119,7 +2119,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` timestamp(6) NULL DEFAULT NULL,
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -2132,7 +2132,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
@ -2196,7 +2196,7 @@ CREATE TABLE t2 SELECT a FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
@ -2205,7 +2205,7 @@ CREATE TABLE t3 SELECT b FROM t1;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t3;
b
@ -2214,7 +2214,7 @@ CREATE TABLE t4 SELECT c FROM t1;
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6)
`c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t4;
c
@ -2241,7 +2241,7 @@ CREATE TABLE t7 SELECT f FROM t1;
SHOW CREATE TABLE t7;
Table Create Table
t7 CREATE TABLE `t7` (
`f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`f` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t7;
f
@ -2250,7 +2250,7 @@ CREATE TABLE t8 SELECT g FROM t1;
SHOW CREATE TABLE t8;
Table Create Table
t8 CREATE TABLE `t8` (
`g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6)
`g` datetime(6) DEFAULT current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t8;
g
@ -2259,7 +2259,7 @@ CREATE TABLE t9 SELECT h FROM t1;
SHOW CREATE TABLE t9;
Table Create Table
t9 CREATE TABLE `t9` (
`h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6)
`h` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t9;
h
@ -2299,25 +2299,25 @@ SELECT * FROM t1;
SHOW CREATE TABLE t12;
Table Create Table
t12 CREATE TABLE `t12` (
`k` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`l` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`m` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`n` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`k` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`l` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`m` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
`n` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6),
`o` timestamp(6) NOT NULL DEFAULT '1986-09-27 03:00:00.098765',
`p` timestamp(6) NULL DEFAULT NULL,
`q` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`r` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`s` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6),
`q` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`r` datetime(6) DEFAULT current_timestamp(6),
`s` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6),
`t` datetime(6) DEFAULT NULL,
`u` datetime(6) DEFAULT '1986-09-27 03:00:00.098765',
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
`c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6),
`d` timestamp(6) NOT NULL DEFAULT '1986-09-27 03:00:00.098765',
`e` timestamp(6) NULL DEFAULT NULL,
`f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6),
`f` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`g` datetime(6) DEFAULT current_timestamp(6),
`h` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6),
`i` datetime(6) DEFAULT NULL,
`j` datetime(6) DEFAULT '1986-09-27 03:00:00.098765'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
@ -2338,7 +2338,7 @@ CREATE TABLE t2 SELECT a FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`a` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
@ -2347,7 +2347,7 @@ CREATE TABLE t3 SELECT b FROM t1;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6)
`b` datetime(6) DEFAULT current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t3;
b
@ -2356,7 +2356,7 @@ CREATE TABLE t4 SELECT c FROM t1;
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6)
`c` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t4;
c
@ -2393,7 +2393,7 @@ CREATE TABLE t2 ( b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SET TIMESTAMP = 2000.876543;
@ -2770,12 +2770,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime(6) DEFAULT NULL,
`b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000',
`like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`like_b` datetime(6) DEFAULT current_timestamp(6),
`c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000',
`like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6),
`e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000',
`f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`f` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
`g` timestamp(6) NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -2822,12 +2822,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime(6) DEFAULT NULL,
`b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000',
`like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`like_b` datetime(6) DEFAULT current_timestamp(6),
`c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000',
`like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6),
`e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000',
`f` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NULL DEFAULT current_timestamp(),
`g` timestamp(6) NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -2889,12 +2889,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime(6) DEFAULT NULL,
`b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000',
`like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`like_b` datetime(6) DEFAULT current_timestamp(6),
`c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000',
`like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6),
`e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000',
`f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`f` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
`g` timestamp(6) NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -2927,12 +2927,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime(6) DEFAULT NULL,
`b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000',
`like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`like_b` datetime(6) DEFAULT current_timestamp(6),
`c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000',
`like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6),
`e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000',
`f` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NULL DEFAULT current_timestamp(),
`g` timestamp(6) NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -2975,7 +2975,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 ( a ) VALUES ( 1 );
SELECT * FROM t1;

View file

@ -484,7 +484,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 ( a INT, b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, c TIMESTAMP NULL );
@ -492,7 +492,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE C
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`a` int(11) DEFAULT NULL,
`c` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -502,7 +502,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE C
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -528,7 +528,7 @@ CREATE TABLE t1 ( a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE N
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
`b` int(11) DEFAULT NULL,
`c` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -537,7 +537,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`c` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -547,7 +547,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` timestamp NULL DEFAULT NULL,
`a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -555,7 +555,7 @@ CREATE TABLE t1 ( a TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE CURRENT_TIMESTAMP
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` int(11) DEFAULT NULL,
`c` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -564,7 +564,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`c` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -574,7 +574,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` timestamp NULL DEFAULT NULL,
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -587,7 +587,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
@ -651,7 +651,7 @@ CREATE TABLE t2 SELECT a FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
@ -660,7 +660,7 @@ CREATE TABLE t3 SELECT b FROM t1;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`b` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t3;
b
@ -669,7 +669,7 @@ CREATE TABLE t4 SELECT c FROM t1;
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
`c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t4;
c
@ -696,7 +696,7 @@ CREATE TABLE t7 SELECT f FROM t1;
SHOW CREATE TABLE t7;
Table Create Table
t7 CREATE TABLE `t7` (
`f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`f` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t7;
f
@ -705,7 +705,7 @@ CREATE TABLE t8 SELECT g FROM t1;
SHOW CREATE TABLE t8;
Table Create Table
t8 CREATE TABLE `t8` (
`g` datetime DEFAULT CURRENT_TIMESTAMP
`g` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t8;
g
@ -714,7 +714,7 @@ CREATE TABLE t9 SELECT h FROM t1;
SHOW CREATE TABLE t9;
Table Create Table
t9 CREATE TABLE `t9` (
`h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
`h` datetime DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t9;
h
@ -754,25 +754,25 @@ SELECT * FROM t1;
SHOW CREATE TABLE t12;
Table Create Table
t12 CREATE TABLE `t12` (
`k` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`l` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`m` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`n` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`k` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`l` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`m` timestamp NOT NULL DEFAULT current_timestamp(),
`n` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
`o` timestamp NOT NULL DEFAULT '1986-09-27 03:00:00',
`p` timestamp NULL DEFAULT NULL,
`q` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`r` datetime DEFAULT CURRENT_TIMESTAMP,
`s` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`q` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`r` datetime DEFAULT current_timestamp(),
`s` datetime DEFAULT NULL ON UPDATE current_timestamp(),
`t` datetime DEFAULT NULL,
`u` datetime DEFAULT '1986-09-27 03:00:00',
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NOT NULL DEFAULT current_timestamp(),
`c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
`d` timestamp NOT NULL DEFAULT '1986-09-27 03:00:00',
`e` timestamp NULL DEFAULT NULL,
`f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`g` datetime DEFAULT CURRENT_TIMESTAMP,
`h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`f` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`g` datetime DEFAULT current_timestamp(),
`h` datetime DEFAULT NULL ON UPDATE current_timestamp(),
`i` datetime DEFAULT NULL,
`j` datetime DEFAULT '1986-09-27 03:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -793,7 +793,7 @@ CREATE TABLE t2 SELECT a FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`a` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
@ -802,7 +802,7 @@ CREATE TABLE t3 SELECT b FROM t1;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`b` datetime DEFAULT CURRENT_TIMESTAMP
`b` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t3;
b
@ -811,7 +811,7 @@ CREATE TABLE t4 SELECT c FROM t1;
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
`c` datetime DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t4;
c
@ -848,7 +848,7 @@ CREATE TABLE t2 ( b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRE
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SET TIMESTAMP = 2000.876543;
@ -1225,12 +1225,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime DEFAULT NULL,
`b` datetime DEFAULT '2011-11-18 00:00:00',
`like_b` datetime DEFAULT CURRENT_TIMESTAMP,
`like_b` datetime DEFAULT current_timestamp(),
`c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00',
`like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`like_c` datetime NOT NULL DEFAULT current_timestamp(),
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(),
`e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00',
`f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NOT NULL DEFAULT current_timestamp(),
`g` timestamp NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -1277,12 +1277,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime DEFAULT NULL,
`b` datetime DEFAULT '2011-11-18 00:00:00',
`like_b` datetime DEFAULT CURRENT_TIMESTAMP,
`like_b` datetime DEFAULT current_timestamp(),
`c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00',
`like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`like_c` datetime NOT NULL DEFAULT current_timestamp(),
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(),
`e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00',
`f` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NULL DEFAULT current_timestamp(),
`g` timestamp NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -1344,12 +1344,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime DEFAULT NULL,
`b` datetime DEFAULT '2011-11-18 00:00:00',
`like_b` datetime DEFAULT CURRENT_TIMESTAMP,
`like_b` datetime DEFAULT current_timestamp(),
`c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00',
`like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`like_c` datetime NOT NULL DEFAULT current_timestamp(),
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(),
`e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00',
`f` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NOT NULL DEFAULT current_timestamp(),
`g` timestamp NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -1382,12 +1382,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime DEFAULT NULL,
`b` datetime DEFAULT '2011-11-18 00:00:00',
`like_b` datetime DEFAULT CURRENT_TIMESTAMP,
`like_b` datetime DEFAULT current_timestamp(),
`c` datetime NOT NULL DEFAULT '2011-11-18 00:00:00',
`like_c` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`like_c` datetime NOT NULL DEFAULT current_timestamp(),
`d` timestamp NULL DEFAULT '2011-05-03 00:00:00' ON UPDATE current_timestamp(),
`e` timestamp NOT NULL DEFAULT '2011-05-03 00:00:00',
`f` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NULL DEFAULT current_timestamp(),
`g` timestamp NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -1430,7 +1430,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1
INSERT INTO t1 ( a ) VALUES ( 1 );
SELECT * FROM t1;
@ -2030,7 +2030,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 ( a INT, b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), c TIMESTAMP(6) NULL );
@ -2038,7 +2038,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UP
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`a` int(11) DEFAULT NULL,
`c` timestamp(6) NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -2048,7 +2048,7 @@ ALTER TABLE t1 MODIFY b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UP
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -2074,7 +2074,7 @@ CREATE TABLE t1 ( a TIMESTAMP(6) NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDAT
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6),
`b` int(11) DEFAULT NULL,
`c` timestamp(6) NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -2083,7 +2083,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`c` timestamp(6) NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -2093,7 +2093,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` timestamp(6) NULL DEFAULT NULL,
`a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6),
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -2101,7 +2101,7 @@ CREATE TABLE t1 ( a TIMESTAMP(6) NOT NULL DEFAULT NOW(6) ON UPDATE CURRENT_TIMES
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`b` int(11) DEFAULT NULL,
`c` timestamp(6) NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -2110,7 +2110,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`c` timestamp(6) NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -2120,7 +2120,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` timestamp(6) NULL DEFAULT NULL,
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -2133,7 +2133,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
@ -2197,7 +2197,7 @@ CREATE TABLE t2 SELECT a FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
@ -2206,7 +2206,7 @@ CREATE TABLE t3 SELECT b FROM t1;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t3;
b
@ -2215,7 +2215,7 @@ CREATE TABLE t4 SELECT c FROM t1;
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6)
`c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t4;
c
@ -2242,7 +2242,7 @@ CREATE TABLE t7 SELECT f FROM t1;
SHOW CREATE TABLE t7;
Table Create Table
t7 CREATE TABLE `t7` (
`f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`f` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t7;
f
@ -2251,7 +2251,7 @@ CREATE TABLE t8 SELECT g FROM t1;
SHOW CREATE TABLE t8;
Table Create Table
t8 CREATE TABLE `t8` (
`g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6)
`g` datetime(6) DEFAULT current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t8;
g
@ -2260,7 +2260,7 @@ CREATE TABLE t9 SELECT h FROM t1;
SHOW CREATE TABLE t9;
Table Create Table
t9 CREATE TABLE `t9` (
`h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6)
`h` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t9;
h
@ -2300,25 +2300,25 @@ SELECT * FROM t1;
SHOW CREATE TABLE t12;
Table Create Table
t12 CREATE TABLE `t12` (
`k` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`l` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`m` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`n` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`k` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`l` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`m` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
`n` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6),
`o` timestamp(6) NOT NULL DEFAULT '1986-09-27 03:00:00.098765',
`p` timestamp(6) NULL DEFAULT NULL,
`q` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`r` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`s` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6),
`q` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`r` datetime(6) DEFAULT current_timestamp(6),
`s` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6),
`t` datetime(6) DEFAULT NULL,
`u` datetime(6) DEFAULT '1986-09-27 03:00:00.098765',
`a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`a` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
`c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE current_timestamp(6),
`d` timestamp(6) NOT NULL DEFAULT '1986-09-27 03:00:00.098765',
`e` timestamp(6) NULL DEFAULT NULL,
`f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6),
`f` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`g` datetime(6) DEFAULT current_timestamp(6),
`h` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6),
`i` datetime(6) DEFAULT NULL,
`j` datetime(6) DEFAULT '1986-09-27 03:00:00.098765'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -2339,7 +2339,7 @@ CREATE TABLE t2 SELECT a FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`a` datetime(6) DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t2;
a
@ -2348,7 +2348,7 @@ CREATE TABLE t3 SELECT b FROM t1;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
`b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6)
`b` datetime(6) DEFAULT current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t3;
b
@ -2357,7 +2357,7 @@ CREATE TABLE t4 SELECT c FROM t1;
SHOW CREATE TABLE t4;
Table Create Table
t4 CREATE TABLE `t4` (
`c` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6)
`c` datetime(6) DEFAULT NULL ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t4;
c
@ -2394,7 +2394,7 @@ CREATE TABLE t2 ( b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SET TIMESTAMP = 2000.876543;
@ -2771,12 +2771,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime(6) DEFAULT NULL,
`b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000',
`like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`like_b` datetime(6) DEFAULT current_timestamp(6),
`c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000',
`like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6),
`e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000',
`f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`f` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
`g` timestamp(6) NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -2823,12 +2823,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime(6) DEFAULT NULL,
`b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000',
`like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`like_b` datetime(6) DEFAULT current_timestamp(6),
`c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000',
`like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6),
`e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000',
`f` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NULL DEFAULT current_timestamp(),
`g` timestamp(6) NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -2890,12 +2890,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime(6) DEFAULT NULL,
`b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000',
`like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`like_b` datetime(6) DEFAULT current_timestamp(6),
`c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000',
`like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6),
`e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000',
`f` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`f` timestamp(6) NOT NULL DEFAULT current_timestamp(6),
`g` timestamp(6) NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -2928,12 +2928,12 @@ t1 CREATE TABLE `t1` (
`dummy` int(11) DEFAULT NULL,
`a` datetime(6) DEFAULT NULL,
`b` datetime(6) DEFAULT '2011-11-18 00:00:00.000000',
`like_b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
`like_b` datetime(6) DEFAULT current_timestamp(6),
`c` datetime(6) NOT NULL DEFAULT '2011-11-18 00:00:00.000000',
`like_c` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6),
`like_c` datetime(6) NOT NULL DEFAULT current_timestamp(6),
`d` timestamp(6) NULL DEFAULT '2011-05-03 00:00:00.000000' ON UPDATE current_timestamp(6),
`e` timestamp(6) NOT NULL DEFAULT '2011-05-03 00:00:00.000000',
`f` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`f` timestamp NULL DEFAULT current_timestamp(),
`g` timestamp(6) NULL DEFAULT NULL,
`h` int(11) DEFAULT NULL,
`i` int(11) NOT NULL DEFAULT 42
@ -2976,7 +2976,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
`b` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
INSERT INTO t1 ( a ) VALUES ( 1 );
SELECT * FROM t1;

View file

@ -1848,8 +1848,8 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` point DEFAULT NULL,
`x` double DEFAULT x(a),
`y` double DEFAULT y(a)
`x` double DEFAULT st_x(`a`),
`y` double DEFAULT st_y(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (Point(1,2));
SELECT x,y FROM t1;
@ -1861,7 +1861,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` geometry DEFAULT NULL,
`area` double DEFAULT ST_AREA(g)
`area` double DEFAULT st_area(`g`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (g) VALUES (GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))'));
SELECT area FROM t1;
@ -1873,7 +1873,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` geometry DEFAULT NULL,
`length` double DEFAULT ST_LENGTH(g)
`length` double DEFAULT st_length(`g`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (g) VALUES (GeomFromText('LINESTRING(0 0,20 0,20 20,0 20,0 0)'));
SELECT length FROM t1;
@ -1885,7 +1885,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`g` point DEFAULT NULL,
`distance` double DEFAULT ST_DISTANCE(g, POINT(0,0))
`distance` double DEFAULT st_distance(`g`,point(0,0))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (g) VALUES (Point(1,0));
SELECT distance FROM t1;
@ -1897,7 +1897,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text DEFAULT NULL,
`g` geometry DEFAULT GeomFromText(a)
`g` geometry DEFAULT st_geometryfromtext(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('point(1 1)');
SELECT AsText(g) FROM t1;
@ -1910,7 +1910,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`x` int(11) DEFAULT NULL,
`y` int(11) DEFAULT NULL,
`g` geometry DEFAULT POINT(x,y)
`g` geometry DEFAULT point(`x`,`y`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (x,y) VALUES (10,20);
SELECT AsText(g) FROM t1;
@ -1922,7 +1922,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT PointN(a,2)
`b` geometry DEFAULT st_pointn(`a`,2)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)'));
SELECT AsText(b) FROM t1;
@ -1934,7 +1934,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT StartPoint(a)
`b` geometry DEFAULT st_startpoint(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)'));
SELECT AsText(b) FROM t1;
@ -1947,7 +1947,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT NULL,
`c` geometry DEFAULT GeometryCollection(a,b)
`c` geometry DEFAULT geometrycollection(`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a,b) VALUES (Point(1,1), Point(2,2));
SELECT AsText(c) FROM t1;
@ -1959,7 +1959,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT GeomFromWKB(AsBinary(a),20)
`b` geometry DEFAULT st_geometryfromwkb(st_aswkb(`a`),20)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('POINT(1 1)', 10));
SELECT AsText(a), SRID(a), AsText(b), SRID(b) FROM t1;
@ -1971,7 +1971,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT BOUNDARY(a)
`b` geometry DEFAULT st_boundary(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT AsText(b) FROM t1;
@ -1983,7 +1983,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT BUFFER(a,10)
`b` geometry DEFAULT st_buffer(`a`,10)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT GeometryType(b) FROM t1;
@ -1995,7 +1995,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT CENTROID(a)
`b` geometry DEFAULT st_centroid(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT AsText(b) FROM t1;
@ -2007,7 +2007,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT ENVELOPE(a)
`b` geometry DEFAULT st_envelope(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,4 4)'));
SELECT AsText(b) FROM t1;
@ -2019,7 +2019,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT PointOnSurface(a)
`b` geometry DEFAULT st_pointonsurface(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT GeometryType(b) FROM t1;
@ -2031,8 +2031,8 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT Point(1,1),
`c` geometry DEFAULT ST_UNION(a,b)
`b` geometry DEFAULT point(1,1),
`c` geometry DEFAULT st_union(`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (Point(0,0));
SELECT AsText(c) FROM t1;
@ -2044,7 +2044,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` varchar(20) DEFAULT GeometryType(a)
`b` varchar(20) DEFAULT st_geometrytype(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (Point(0, 0));
SELECT b FROM t1;
@ -2056,7 +2056,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` int(11) DEFAULT IsSimple(a)
`b` int(11) DEFAULT st_issimple(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (Point(0, 0));
SELECT b FROM t1;
@ -2068,7 +2068,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` int(11) DEFAULT IsEmpty(a)
`b` int(11) DEFAULT st_isempty(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (Point(0, 0));
SELECT b FROM t1;
@ -2080,7 +2080,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` int(11) DEFAULT IsRing(a)
`b` int(11) DEFAULT st_isring(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)'));
SELECT b FROM t1;
@ -2092,7 +2092,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` int(11) DEFAULT IsClosed(a)
`b` int(11) DEFAULT st_isclosed(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)'));
SELECT b FROM t1;
@ -2104,7 +2104,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` int(11) DEFAULT Dimension(a)
`b` int(11) DEFAULT st_dimension(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (Buffer(Point(1,1),1));
SELECT b FROM t1;
@ -2116,7 +2116,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` int(11) DEFAULT NumGeometries(a)
`b` int(11) DEFAULT st_numgeometries(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (ST_UNION(Point(1,1),Point(0,0)));
SELECT b FROM t1;
@ -2128,7 +2128,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` int(11) DEFAULT NumInteriorRings(a)
`b` int(11) DEFAULT st_numinteriorrings(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))'));
SELECT b FROM t1;
@ -2140,7 +2140,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` int(11) DEFAULT NumPoints(a)
`b` int(11) DEFAULT st_numpoints(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (LineString(Point(1,1),Point(0,0)));
SELECT b FROM t1;
@ -2152,7 +2152,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` int(11) DEFAULT SRID(a)
`b` int(11) DEFAULT srid(`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (GeomFromText('Point(1 1)', 100));
SELECT b FROM t1;
@ -2165,7 +2165,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT NULL,
`c` int(11) DEFAULT MBRDisjoint(a,b)
`c` int(11) DEFAULT mbrdisjoint(`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1));
SELECT c FROM t1;
@ -2178,7 +2178,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT NULL,
`c` int(11) DEFAULT ST_Disjoint(a,b)
`c` int(11) DEFAULT st_disjoint(`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1));
SELECT c FROM t1;
@ -2191,7 +2191,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` geometry DEFAULT NULL,
`b` geometry DEFAULT NULL,
`c` int(11) DEFAULT ST_Relate(a,b,'T*F**FFF*')
`c` int(11) DEFAULT st_relate(`a`,`b`,'T*F**FFF*')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1));
SELECT c FROM t1;

View file

@ -685,7 +685,7 @@ Db char(64) NO PRI
User char(80) NO PRI
Table_name char(64) NO PRI
Grantor char(141) NO MUL
Timestamp timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
Timestamp timestamp NO current_timestamp() on update current_timestamp()
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') NO
Column_priv set('Select','Insert','Update','References') NO
use test;
@ -2675,7 +2675,7 @@ CREATE TABLE t1 (a VARCHAR(30) DEFAULT USER());
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT USER()
`a` varchar(30) DEFAULT user()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ();
GRANT ALL PRIVILEGES ON test.* TO dummy@localhost IDENTIFIED BY 'pwd';

View file

@ -435,7 +435,7 @@ t1 CREATE TABLE `t1` (
`c1` int(11) DEFAULT NULL,
`c2` char(12) NOT NULL,
`c3` varchar(123) NOT NULL,
`c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`c2`,`c3`),
UNIQUE KEY `i4` (`c4`),
KEY `c1` (`c1`),
@ -474,7 +474,7 @@ t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL,
`c2` char(12) NOT NULL,
`c3` varchar(123) NOT NULL,
`c4` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`c4` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
KEY `i1` (`c1`),
KEY `i5` (`c1`,`c2`,`c3`,`c4`),
KEY `c1` (`c1`),

View file

@ -46,7 +46,7 @@ select @@log_slow_verbosity;
innodb
show fields from mysql.slow_log;
Field Type Null Key Default Extra
start_time timestamp(6) NO CURRENT_TIMESTAMP(6) on update CURRENT_TIMESTAMP
start_time timestamp(6) NO current_timestamp(6) on update current_timestamp(6)
user_host mediumtext NO NULL
query_time time(6) NO NULL
lock_time time(6) NO NULL

View file

@ -54,7 +54,7 @@ ERROR HY000: You can't use locks with log tables
show create table mysql.general_log;
Table Create Table
general_log CREATE TABLE `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
@ -63,7 +63,7 @@ general_log CREATE TABLE `general_log` (
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
show fields from mysql.general_log;
Field Type Null Key Default Extra
event_time timestamp(6) NO CURRENT_TIMESTAMP(6) on update CURRENT_TIMESTAMP
event_time timestamp(6) NO current_timestamp(6) on update current_timestamp(6)
user_host mediumtext NO NULL
thread_id bigint(21) unsigned NO NULL
server_id int(10) unsigned NO NULL
@ -72,7 +72,7 @@ argument mediumtext NO NULL
show create table mysql.slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,
@ -88,7 +88,7 @@ slow_log CREATE TABLE `slow_log` (
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show fields from mysql.slow_log;
Field Type Null Key Default Extra
start_time timestamp(6) NO CURRENT_TIMESTAMP(6) on update CURRENT_TIMESTAMP
start_time timestamp(6) NO current_timestamp(6) on update current_timestamp(6)
user_host mediumtext NO NULL
query_time time(6) NO NULL
lock_time time(6) NO NULL
@ -169,7 +169,7 @@ set global slow_query_log='OFF';
show create table mysql.general_log;
Table Create Table
general_log CREATE TABLE `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
@ -179,7 +179,7 @@ general_log CREATE TABLE `general_log` (
show create table mysql.slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,
@ -198,7 +198,7 @@ alter table mysql.slow_log engine=myisam;
show create table mysql.general_log;
Table Create Table
general_log CREATE TABLE `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
@ -208,7 +208,7 @@ general_log CREATE TABLE `general_log` (
show create table mysql.slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,

View file

@ -10,7 +10,7 @@ columns_priv CREATE TABLE `columns_priv` (
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
@ -58,7 +58,7 @@ event CREATE TABLE `event` (
`execute_at` datetime DEFAULT NULL,
`interval_value` int(11) DEFAULT NULL,
`interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`last_executed` datetime DEFAULT NULL,
`starts` datetime DEFAULT NULL,
@ -115,7 +115,7 @@ proc CREATE TABLE `proc` (
`returns` longblob NOT NULL DEFAULT '',
`body` longblob NOT NULL,
`definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
@ -138,7 +138,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
`Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
`Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
@ -154,7 +154,7 @@ proxies_priv CREATE TABLE `proxies_priv` (
`Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
`With_grant` tinyint(1) NOT NULL DEFAULT 0,
`Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges'
@ -186,7 +186,7 @@ tables_priv CREATE TABLE `tables_priv` (
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),

View file

@ -32,7 +32,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a+1) PERSISTENT,
`c` int(11) AS (a+2) VIRTUAL
`b` int(11) AS ((`a` + 1)) PERSISTENT,
`c` int(11) AS ((`a` + 2)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;

View file

@ -2923,7 +2923,7 @@ DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
`d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
UNIQUE KEY `d` (`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
@ -2960,7 +2960,7 @@ DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
`d` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`d` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
UNIQUE KEY `d` (`d`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
@ -5260,7 +5260,7 @@ Error 1146 Table 'mysql.event' doesn't exist
SHOW CREATE TABLE mysql.general_log;
Table Create Table
general_log CREATE TABLE `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
@ -5270,7 +5270,7 @@ general_log CREATE TABLE `general_log` (
SHOW CREATE TABLE mysql.slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,

View file

@ -260,7 +260,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp(),
`b` varchar(10) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

View file

@ -130,8 +130,7 @@ ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitio
create table t1 (col1 datetime)
partition by range(week(col1))
(partition p0 values less than (10), partition p1 values less than (30));
ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')
(partition p0 values less than (10), partition p1 values less than (30))' at line 2
ERROR HY000: This partition function is not allowed
create table t1 (col1 varchar(25))
partition by range(cast(col1 as signed))
(partition p0 values less than (10), partition p1 values less than (30));

View file

@ -27,7 +27,7 @@ proxies_priv CREATE TABLE `proxies_priv` (
`Proxied_user` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
`With_grant` tinyint(1) NOT NULL DEFAULT 0,
`Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges'

View file

@ -342,7 +342,7 @@ t1 CREATE TABLE `t1` (
`empty_char` char(0) DEFAULT NULL,
`type_char` char(2) DEFAULT NULL,
`type_varchar` varchar(10) DEFAULT NULL,
`type_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`type_timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`type_date` date NOT NULL DEFAULT '0000-00-00',
`type_time` time NOT NULL DEFAULT '00:00:00',
`type_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@ -742,17 +742,17 @@ DROP VIEW v1;
CREATE VIEW v1 AS SELECT NOW();
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select now() AS `NOW()` binary binary
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select current_timestamp() AS `NOW()` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_CACHE NOW();
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache now() AS `NOW()` binary binary
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache current_timestamp() AS `NOW()` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_NO_CACHE NOW();
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache current_timestamp() AS `NOW()` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_CACHE SQL_NO_CACHE NOW();
ERROR HY000: Incorrect usage of SQL_CACHE and SQL_NO_CACHE
@ -979,7 +979,7 @@ def information_schema COLUMNS COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253
def information_schema COLUMNS COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33
def information_schema COLUMNS COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33
def information_schema COLUMNS COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33
def information_schema COLUMNS COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33
def information_schema COLUMNS COLUMNS EXTRA EXTRA 253 90 0 N 1 0 33
def information_schema COLUMNS COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33
def information_schema COLUMNS COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 3072 0 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
@ -998,7 +998,7 @@ def information_schema COLUMNS COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33
def information_schema COLUMNS COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33
def information_schema COLUMNS COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33
def information_schema COLUMNS COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33
def information_schema COLUMNS COLUMNS EXTRA Extra 253 81 0 N 1 0 33
def information_schema COLUMNS COLUMNS EXTRA Extra 253 90 0 N 1 0 33
Field Type Null Key Default Extra
c int(11) NO PRI NULL
----------------------------------------------------------------

View file

@ -149,7 +149,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
"f1" int(11) NOT NULL AUTO_INCREMENT,
"f2" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
"f2" timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY ("f1")
)
set session sql_mode=no_field_options;
@ -157,7 +157,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`f2` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`f1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;

View file

@ -1688,7 +1688,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` blob DEFAULT NULL,
`b` text DEFAULT DECODE_HISTOGRAM('SINGLE_PREC_HB',a)
`b` text DEFAULT decode_histogram('SINGLE_PREC_HB',`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (0x0000000000000000000000000101010101010101010202020303030304040404050505050606070707080809090A0A0B0C0D0D0E0E0F10111213131415161718191B1C1E202224292A2E33373B4850575F6A76818C9AA7B9C4CFDADFE5EBF0F4F8FAFCFF);
SELECT b FROM t1;

View file

@ -1273,7 +1273,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;

View file

@ -151,7 +151,7 @@ tables_priv CREATE TABLE `tables_priv` (
`User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
@ -165,7 +165,7 @@ columns_priv CREATE TABLE `columns_priv` (
`User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
@ -179,7 +179,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
`Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
`Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
@ -212,7 +212,7 @@ proc CREATE TABLE `proc` (
`returns` longblob NOT NULL,
`body` longblob NOT NULL,
`definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
@ -232,7 +232,7 @@ event CREATE TABLE `event` (
`execute_at` datetime DEFAULT NULL,
`interval_value` int(11) DEFAULT NULL,
`interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`last_executed` datetime DEFAULT NULL,
`starts` datetime DEFAULT NULL,
@ -252,7 +252,7 @@ event CREATE TABLE `event` (
show create table general_log;
Table Create Table
general_log CREATE TABLE `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
@ -262,7 +262,7 @@ general_log CREATE TABLE `general_log` (
show create table slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,

View file

@ -151,7 +151,7 @@ tables_priv CREATE TABLE `tables_priv` (
`User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
@ -165,7 +165,7 @@ columns_priv CREATE TABLE `columns_priv` (
`User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
@ -179,7 +179,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
`Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
`Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
@ -212,7 +212,7 @@ proc CREATE TABLE `proc` (
`returns` longblob NOT NULL,
`body` longblob NOT NULL,
`definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
@ -232,7 +232,7 @@ event CREATE TABLE `event` (
`execute_at` datetime DEFAULT NULL,
`interval_value` int(11) DEFAULT NULL,
`interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`last_executed` datetime DEFAULT NULL,
`starts` datetime DEFAULT NULL,
@ -252,7 +252,7 @@ event CREATE TABLE `event` (
show create table general_log;
Table Create Table
general_log CREATE TABLE `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
@ -262,7 +262,7 @@ general_log CREATE TABLE `general_log` (
show create table slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,

View file

@ -151,7 +151,7 @@ tables_priv CREATE TABLE `tables_priv` (
`User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
@ -165,7 +165,7 @@ columns_priv CREATE TABLE `columns_priv` (
`User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
@ -179,7 +179,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
`Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
`Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
@ -212,7 +212,7 @@ proc CREATE TABLE `proc` (
`returns` longblob NOT NULL,
`body` longblob NOT NULL,
`definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
@ -232,7 +232,7 @@ event CREATE TABLE `event` (
`execute_at` datetime DEFAULT NULL,
`interval_value` int(11) DEFAULT NULL,
`interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`last_executed` datetime DEFAULT NULL,
`starts` datetime DEFAULT NULL,
@ -252,7 +252,7 @@ event CREATE TABLE `event` (
show create table general_log;
Table Create Table
general_log CREATE TABLE `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
@ -262,7 +262,7 @@ general_log CREATE TABLE `general_log` (
show create table slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,

View file

@ -151,7 +151,7 @@ tables_priv CREATE TABLE `tables_priv` (
`User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
@ -165,7 +165,7 @@ columns_priv CREATE TABLE `columns_priv` (
`User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
`Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
@ -179,7 +179,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
`Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
`Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
@ -212,7 +212,7 @@ proc CREATE TABLE `proc` (
`returns` longblob NOT NULL,
`body` longblob NOT NULL,
`definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
@ -232,7 +232,7 @@ event CREATE TABLE `event` (
`execute_at` datetime DEFAULT NULL,
`interval_value` int(11) DEFAULT NULL,
`interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`last_executed` datetime DEFAULT NULL,
`starts` datetime DEFAULT NULL,
@ -252,7 +252,7 @@ event CREATE TABLE `event` (
show create table general_log;
Table Create Table
general_log CREATE TABLE `general_log` (
`event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`server_id` int(10) unsigned NOT NULL,
@ -262,7 +262,7 @@ general_log CREATE TABLE `general_log` (
show create table slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,

View file

@ -42,13 +42,13 @@ Note 1246 Converting column 'a' from VARCHAR to TEXT
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` mediumtext DEFAULT "hello"
`a` mediumtext DEFAULT 'hello'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 (a blob default "hello");
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` blob DEFAULT "hello"
`a` blob DEFAULT 'hello'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2;
create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr));

View file

@ -54,7 +54,7 @@ ushort smallint(5) unsigned zerofill NULL NO MUL 00000 #
umedium mediumint(8) unsigned NULL NO MUL 0 #
ulong int(11) unsigned NULL NO MUL 0 #
ulonglong bigint(13) unsigned NULL NO MUL 0 #
time_stamp timestamp NULL NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP #
time_stamp timestamp NULL NO current_timestamp() on update current_timestamp() #
date_field date NULL YES NULL #
time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
@ -226,7 +226,7 @@ ushort smallint(5) unsigned zerofill NULL NO 00000 #
umedium mediumint(8) unsigned NULL NO MUL 0 #
ulong int(11) unsigned NULL NO MUL 0 #
ulonglong bigint(13) unsigned NULL NO MUL 0 #
time_stamp timestamp NULL NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP #
time_stamp timestamp NULL NO current_timestamp() on update current_timestamp() #
date_field char(10) latin1_swedish_ci YES NULL #
time_field time NULL YES NULL #
date_time datetime NULL YES NULL #
@ -252,7 +252,7 @@ ushort smallint(5) unsigned zerofill NULL NO 00000 #
umedium mediumint(8) unsigned NULL NO 0 #
ulong int(11) unsigned NULL NO 0 #
ulonglong bigint(13) unsigned NULL NO 0 #
time_stamp timestamp NULL NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP #
time_stamp timestamp NULL NO current_timestamp() on update current_timestamp() #
date_field char(10) latin1_swedish_ci YES NULL #
time_field time NULL YES NULL #
date_time datetime NULL YES NULL #

View file

@ -63,7 +63,7 @@ SET TIME_ZONE='+00:00';
SHOW CREATE TABLE mysql56timestamp;
Table Create Table
mysql56timestamp CREATE TABLE `mysql56timestamp` (
`ts0` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`ts0` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`ts1` timestamp(1) NOT NULL DEFAULT '0000-00-00 00:00:00.0',
`ts2` timestamp(2) NOT NULL DEFAULT '0000-00-00 00:00:00.00',
`ts3` timestamp(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000',

View file

@ -195,13 +195,13 @@ t1 t2 t3
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`t1` timestamp NOT NULL DEFAULT current_timestamp(),
`t2` datetime DEFAULT NULL,
`t3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp NO CURRENT_TIMESTAMP
t1 timestamp NO current_timestamp()
t2 datetime YES NULL
t3 timestamp NO 0000-00-00 00:00:00
drop table t1;
@ -222,12 +222,12 @@ t1 t2
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t1` timestamp NOT NULL DEFAULT '2003-01-01 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`t1` timestamp NOT NULL DEFAULT '2003-01-01 00:00:00' ON UPDATE current_timestamp(),
`t2` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp NO 2003-01-01 00:00:00 on update CURRENT_TIMESTAMP
t1 timestamp NO 2003-01-01 00:00:00 on update current_timestamp()
t2 datetime YES NULL
drop table t1;
create table t1 (t1 timestamp not null default now() on update now(), t2 datetime);
@ -247,12 +247,12 @@ t1 t2
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`t2` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
t1 timestamp NO current_timestamp() on update current_timestamp()
t2 datetime YES NULL
drop table t1;
create table t1 (t1 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, t2 datetime, t3 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00');
@ -272,13 +272,13 @@ t1 t2 t3
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`t2` datetime DEFAULT NULL,
`t3` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
t1 timestamp NO current_timestamp() on update current_timestamp()
t2 datetime YES NULL
t3 timestamp NO 0000-00-00 00:00:00
drop table t1;
@ -299,12 +299,12 @@ t1 t2
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t1` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`t2` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
t1 timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
t1 timestamp NO current_timestamp() on update current_timestamp()
t2 datetime YES NULL
truncate table t1;
insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00');
@ -369,7 +369,7 @@ create table t1 (a timestamp null default current_timestamp on update current_ti
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (NULL, NULL);
@ -710,12 +710,12 @@ CREATE TABLE t2 AS SELECT * from t1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`ts` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`ts` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
SET sql_mode=DEFAULT;
@ -731,13 +731,13 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`vc` varchar(10) NOT NULL DEFAULT 'test',
`ts` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
`ts` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`vc` varchar(10) NOT NULL DEFAULT 'test',
`ts` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
`ts` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
End of 10.0 tests

View file

@ -64,15 +64,15 @@ a
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4)
`a` timestamp(4) NOT NULL DEFAULT current_timestamp(4) ON UPDATE current_timestamp(4)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
a timestamp(4) NO CURRENT_TIMESTAMP(4) on update CURRENT_TIMESTAMP
a timestamp(4) NO current_timestamp(4) on update current_timestamp(4)
select table_name, column_name, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, datetime_precision, character_set_name, collation_name, column_type, column_key, extra from information_schema.columns where table_name='t1';
table_name t1
column_name a
column_default CURRENT_TIMESTAMP(4)
column_default current_timestamp(4)
is_nullable NO
data_type timestamp
character_maximum_length NULL
@ -84,7 +84,7 @@ character_set_name NULL
collation_name NULL
column_type timestamp(4)
column_key
extra on update CURRENT_TIMESTAMP
extra on update current_timestamp(4)
select a, a+interval 9876543 microsecond from t1;
a a+interval 9876543 microsecond
2010-12-11 01:02:03.4567 2010-12-11 01:02:13.333243
@ -109,12 +109,12 @@ create table t3 like t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4)
`a` timestamp(4) NOT NULL DEFAULT current_timestamp(4) ON UPDATE current_timestamp(4)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show create table t3;
Table Create Table
t3 CREATE TABLE `t3` (
`a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4)
`a` timestamp(4) NOT NULL DEFAULT current_timestamp(4) ON UPDATE current_timestamp(4)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2, t3;
insert t1 values ('2010-12-13 14:15:16.222222');
@ -130,7 +130,7 @@ create table t3 select max(a), min(a), sum(a), avg(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4),
`a` timestamp(4) NOT NULL DEFAULT current_timestamp(4) ON UPDATE current_timestamp(4),
`a+0` decimal(25,4) NOT NULL,
`a-1` decimal(25,4) NOT NULL,
`a*1` decimal(25,4) NOT NULL,
@ -276,13 +276,13 @@ create or replace table t1 (a timestamp(5) default current_timestamp);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5)
`a` timestamp(5) NOT NULL DEFAULT current_timestamp(5)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a timestamp(5) default current_timestamp());
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5)
`a` timestamp(5) NOT NULL DEFAULT current_timestamp(5)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a timestamp(5) default current_timestamp(2));
show create table t1;
@ -298,25 +298,25 @@ create or replace table t1 (a timestamp(5) default current_timestamp(5));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5)
`a` timestamp(5) NOT NULL DEFAULT current_timestamp(5)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a timestamp(5) default current_timestamp(6));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(5) NOT NULL DEFAULT CURRENT_TIMESTAMP(5)
`a` timestamp(5) NOT NULL DEFAULT current_timestamp(5)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a timestamp(5) on update current_timestamp);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5)
`a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE current_timestamp(5)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a timestamp(5) on update current_timestamp());
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5)
`a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE current_timestamp(5)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a timestamp(5) on update current_timestamp(3));
ERROR HY000: Invalid ON UPDATE clause for 'a' column
@ -324,12 +324,12 @@ create or replace table t1 (a timestamp(5) on update current_timestamp(5));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5)
`a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE current_timestamp(5)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a timestamp(5) on update current_timestamp(6));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE CURRENT_TIMESTAMP(5)
`a` timestamp(5) NOT NULL DEFAULT '0000-00-00 00:00:00.00000' ON UPDATE current_timestamp(5)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;

View file

@ -457,7 +457,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
`b` varchar(10) DEFAULT METAPHON(a)
`b` varchar(10) DEFAULT metaphon(`a` AS `a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('Hello');
SELECT * FROM t1;

View file

@ -1920,7 +1920,7 @@ create table t2 (b timestamp default now());
create view v1 as select a,b,t1.a < now() from t1,t2 where t1.a < now();
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,(`t1`.`a` < now()) AS `t1.a < now()` from (`t1` join `t2`) where (`t1`.`a` < now()) latin1 latin1_swedish_ci
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t2`.`b` AS `b`,(`t1`.`a` < current_timestamp()) AS `t1.a < now()` from (`t1` join `t2`) where (`t1`.`a` < current_timestamp()) latin1 latin1_swedish_ci
drop view v1;
drop table t1, t2;
CREATE TABLE t1 ( a varchar(50) );
@ -2948,7 +2948,7 @@ create table t1 (f1 datetime);
create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between now() and (now() + interval 1 minute)) latin1 latin1_swedish_ci
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between current_timestamp() and (current_timestamp() + interval 1 minute)) latin1 latin1_swedish_ci
drop view v1;
drop table t1;
DROP TABLE IF EXISTS t1;

View file

@ -45,7 +45,7 @@ CHARACTER_SET_NAME varchar(32) YES NULL
COLLATION_NAME varchar(32) YES NULL
COLUMN_TYPE longtext NO
COLUMN_KEY varchar(3) NO
EXTRA varchar(27) NO
EXTRA varchar(30) NO
PRIVILEGES varchar(80) NO
COLUMN_COMMENT varchar(1024) NO
SHOW CREATE TABLE information_schema.COLUMNS;
@ -68,7 +68,7 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` (
`COLLATION_NAME` varchar(32) DEFAULT NULL,
`COLUMN_TYPE` longtext NOT NULL DEFAULT '',
`COLUMN_KEY` varchar(3) NOT NULL DEFAULT '',
`EXTRA` varchar(27) NOT NULL DEFAULT '',
`EXTRA` varchar(30) NOT NULL DEFAULT '',
`PRIVILEGES` varchar(80) NOT NULL DEFAULT '',
`COLUMN_COMMENT` varchar(1024) NOT NULL DEFAULT ''
) DEFAULT CHARSET=utf8
@ -91,7 +91,7 @@ CHARACTER_SET_NAME varchar(32) YES NULL
COLLATION_NAME varchar(32) YES NULL
COLUMN_TYPE longtext NO
COLUMN_KEY varchar(3) NO
EXTRA varchar(27) NO
EXTRA varchar(30) NO
PRIVILEGES varchar(80) NO
COLUMN_COMMENT varchar(1024) NO
SELECT table_catalog, table_schema, table_name, column_name

View file

@ -645,7 +645,7 @@ def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double uns
def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references
def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references
def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references
def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references
def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references

View file

@ -68,7 +68,7 @@ def information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL NULL u
def information_schema COLUMNS COLUMN_TYPE 16 NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext
def information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def information_schema COLUMNS DATETIME_PRECISION 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema COLUMNS EXTRA 18 NO varchar 27 81 NULL NULL NULL utf8 utf8_general_ci varchar(27)
def information_schema COLUMNS EXTRA 18 NO varchar 30 90 NULL NULL NULL utf8 utf8_general_ci varchar(30)
def information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL NULL utf8 utf8_general_ci varchar(3)
def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
@ -602,7 +602,7 @@ NULL information_schema COLUMNS DATETIME_PRECISION bigint NULL NULL NULL NULL bi
3.0000 information_schema COLUMNS COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32)
1.0000 information_schema COLUMNS COLUMN_TYPE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema COLUMNS COLUMN_KEY varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema COLUMNS EXTRA varchar 27 81 utf8 utf8_general_ci varchar(27)
3.0000 information_schema COLUMNS EXTRA varchar 30 90 utf8 utf8_general_ci varchar(30)
3.0000 information_schema COLUMNS PRIVILEGES varchar 80 240 utf8 utf8_general_ci varchar(80)
3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema COLUMN_PRIVILEGES GRANTEE varchar 190 570 utf8 utf8_general_ci varchar(190)

View file

@ -620,7 +620,7 @@ def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double uns
def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references
def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references
def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references
def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references
def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references

View file

@ -682,7 +682,7 @@ def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double uns
def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references
def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references
def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references
def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references
def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references

View file

@ -682,7 +682,7 @@ def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double uns
def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date
def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time
def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime
def test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP
def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp()
def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4)
def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4)
def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4)

View file

@ -7,7 +7,7 @@ def mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL NULL utf8 utf8_gene
def mysql columns_priv Db 2 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
def mysql columns_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
def mysql columns_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
def mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def mysql columns_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references
def mysql columns_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references
def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references
def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references
@ -47,7 +47,7 @@ def mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL N
def mysql event character_set_client 19 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references
def mysql event collation_connection 20 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references
def mysql event comment 16 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) select,insert,update,references
def mysql event created 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def mysql event created 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references
def mysql event db 1 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
def mysql event db_collation 21 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references
def mysql event definer 4 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) select,insert,update,references
@ -70,7 +70,7 @@ def mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) sele
def mysql func type 4 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('function','aggregate') select,insert,update,references
def mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
def mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select,insert,update,references
def mysql general_log event_time 1 CURRENT_TIMESTAMP(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update CURRENT_TIMESTAMP select,insert,update,references
def mysql general_log event_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) select,insert,update,references
def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
def mysql general_log thread_id 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references
def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
@ -124,7 +124,7 @@ def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NU
def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references
def mysql proc collation_connection 18 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references
def mysql proc comment 16 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_bin text select,insert,update,references
def mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def mysql proc created 13 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references
def mysql proc db 1 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
def mysql proc db_collation 19 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references
def mysql proc definer 12 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) select,insert,update,references
@ -145,13 +145,13 @@ def mysql procs_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60
def mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') select,insert,update,references
def mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def mysql procs_priv Timestamp 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references
def mysql procs_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references
def mysql proxies_priv Grantor 6 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) MUL select,insert,update,references
def mysql proxies_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
def mysql proxies_priv Proxied_host 3 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
def mysql proxies_priv Proxied_user 4 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references
def mysql proxies_priv Timestamp 7 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def mysql proxies_priv Timestamp 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references
def mysql proxies_priv User 2 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references
def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select,insert,update,references
def mysql roles_mapping Admin_option 4 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
@ -177,7 +177,7 @@ def mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int
def mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references
def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references
def mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
def mysql slow_log start_time 1 CURRENT_TIMESTAMP(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update CURRENT_TIMESTAMP select,insert,update,references
def mysql slow_log start_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) select,insert,update,references
def mysql slow_log thread_id 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references
def mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext select,insert,update,references
def mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') select,insert,update,references
@ -186,7 +186,7 @@ def mysql tables_priv Grantor 5 NO char 141 423 NULL NULL NULL utf8 utf8_bin ch
def mysql tables_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
def mysql tables_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
def mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') select,insert,update,references
def mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def mysql tables_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references
def mysql tables_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI select,insert,update,references
def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references
def mysql table_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references

View file

@ -7,7 +7,7 @@ def mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL NULL utf8 utf8_gene
def mysql columns_priv Db 2 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI
def mysql columns_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI
def mysql columns_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI
def mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP
def mysql columns_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp()
def mysql columns_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI
def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4)
def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4)
@ -47,7 +47,7 @@ def mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL N
def mysql event character_set_client 19 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32)
def mysql event collation_connection 20 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32)
def mysql event comment 16 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64)
def mysql event created 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP
def mysql event created 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp()
def mysql event db 1 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI
def mysql event db_collation 21 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32)
def mysql event definer 4 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141)
@ -70,7 +70,7 @@ def mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1)
def mysql func type 4 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_general_ci enum('function','aggregate')
def mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext
def mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64)
def mysql general_log event_time 1 CURRENT_TIMESTAMP(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update CURRENT_TIMESTAMP
def mysql general_log event_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6)
def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned
def mysql general_log thread_id 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext
@ -124,7 +124,7 @@ def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NU
def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32)
def mysql proc collation_connection 18 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32)
def mysql proc comment 16 NULL NO text 65535 65535 NULL NULL NULL utf8 utf8_bin text
def mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP
def mysql proc created 13 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp()
def mysql proc db 1 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI
def mysql proc db_collation 19 NULL YES char 32 96 NULL NULL NULL utf8 utf8_bin char(32)
def mysql proc definer 12 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141)
@ -145,13 +145,13 @@ def mysql procs_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60
def mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
def mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) PRI
def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI
def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP
def mysql procs_priv Timestamp 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp()
def mysql procs_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI
def mysql proxies_priv Grantor 6 NO char 141 423 NULL NULL NULL utf8 utf8_bin char(141) MUL
def mysql proxies_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI
def mysql proxies_priv Proxied_host 3 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI
def mysql proxies_priv Proxied_user 4 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI
def mysql proxies_priv Timestamp 7 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP
def mysql proxies_priv Timestamp 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp()
def mysql proxies_priv User 2 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI
def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1)
def mysql roles_mapping Admin_option 4 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('N','Y')
@ -177,7 +177,7 @@ def mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int
def mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11)
def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned
def mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext
def mysql slow_log start_time 1 CURRENT_TIMESTAMP(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update CURRENT_TIMESTAMP
def mysql slow_log start_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6)
def mysql slow_log thread_id 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8 utf8_general_ci mediumtext
def mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References')
@ -186,7 +186,7 @@ def mysql tables_priv Grantor 5 NO char 141 423 NULL NULL NULL utf8 utf8_bin ch
def mysql tables_priv Host 1 NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) PRI
def mysql tables_priv Table_name 4 NO char 64 192 NULL NULL NULL utf8 utf8_bin char(64) PRI
def mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
def mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP
def mysql tables_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp()
def mysql tables_priv User 3 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI
def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
def mysql table_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI

View file

@ -486,7 +486,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` char(1) DEFAULT NULL,
`b` char(1) DEFAULT NULL,
`c` char(2) GENERATED ALWAYS AS ((`a` or `b`)) VIRTUAL
`c` char(2) AS (((`a` <> 0) or (`b` <> 0))) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a,b) VALUES('1','1');
SELECT * FROM t1;
@ -507,7 +507,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` char(1) DEFAULT NULL,
`b` char(1) DEFAULT NULL,
`c` char(2) GENERATED ALWAYS AS (concat(`a`,`b`)) VIRTUAL
`c` char(2) AS (concat(`a`,`b`)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a,b) VALUES('1','1');
SELECT * FROM t1;
@ -534,7 +534,6 @@ ALTER TABLE t ADD b INTEGER AS (SUBSTR('','a',1));
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'a'
Warning 1292 Truncated incorrect INTEGER value: 'a'
Warning 1292 Truncated incorrect INTEGER value: 'a'
DROP TABLE t;
set sql_mode= @save_old_sql_mode;
# Bug#21875520 Problems with virtual column indexes

View file

@ -81,7 +81,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -94,7 +94,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -114,7 +114,7 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t2;
Field Type Null Key Default Extra
@ -136,7 +136,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -158,7 +158,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int generated always as (a % 2) virtual);
@ -168,7 +168,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
drop table t2;
@ -191,7 +191,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -203,7 +203,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -216,7 +216,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -229,7 +229,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (5 * 2) VIRTUAL
`b` int(11) AS ((5 * 2)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -294,9 +294,9 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a + 1) VIRTUAL,
`c` varchar(12) AS ("aaaabb") PERSISTENT,
`d` blob AS (c) VIRTUAL
`b` int(11) AS ((`a` + 1)) VIRTUAL,
`c` varchar(12) AS ('aaaabb') PERSISTENT,
`d` blob AS (`c`) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t1 order by a;
a b c d
@ -307,9 +307,9 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a + 1) VIRTUAL,
`c` varchar(12) AS ("aaaabb") PERSISTENT,
`d` blob AS (c) VIRTUAL
`b` int(11) AS ((`a` + 1)) VIRTUAL,
`c` varchar(12) AS ('aaaabb') PERSISTENT,
`d` blob AS (`c`) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
CREATE TABLE t3 AS SELECT * FROM t1;
SHOW CREATE TABLE t3;
@ -604,7 +604,7 @@ Table Create Table
t1 CREATE TABLE "t1" (
"a" int(11) NOT NULL,
"b" varchar(10) DEFAULT NULL,
"c" char(3) AS (substr(b,1,3)) VIRTUAL,
"c" char(3) AS (substr("b",1,3)) VIRTUAL,
PRIMARY KEY ("a"),
KEY "c" ("c")
)
@ -619,7 +619,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(10) DEFAULT NULL,
`c` char(3) AS (substr(b,1,3)) VIRTUAL,
`c` char(3) AS (substr(`b`,1,3)) VIRTUAL,
PRIMARY KEY (`a`),
KEY `c` (`c`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1

View file

@ -81,7 +81,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -94,7 +94,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -114,7 +114,7 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t2;
Field Type Null Key Default Extra
@ -136,7 +136,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -158,7 +158,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int generated always as (a % 2) virtual);
@ -168,7 +168,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
drop table t2;
@ -191,7 +191,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -203,7 +203,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -216,7 +216,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -229,7 +229,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (5 * 2) VIRTUAL
`b` int(11) AS ((5 * 2)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -294,9 +294,9 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a + 1) VIRTUAL,
`c` varchar(12) AS ("aaaabb") PERSISTENT,
`d` blob AS (c) VIRTUAL
`b` int(11) AS ((`a` + 1)) VIRTUAL,
`c` varchar(12) AS ('aaaabb') PERSISTENT,
`d` blob AS (`c`) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t1 order by a;
a b c d
@ -307,9 +307,9 @@ SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a + 1) VIRTUAL,
`c` varchar(12) AS ("aaaabb") PERSISTENT,
`d` blob AS (c) VIRTUAL
`b` int(11) AS ((`a` + 1)) VIRTUAL,
`c` varchar(12) AS ('aaaabb') PERSISTENT,
`d` blob AS (`c`) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t3 AS SELECT * FROM t1;
SHOW CREATE TABLE t3;
@ -604,7 +604,7 @@ Table Create Table
t1 CREATE TABLE "t1" (
"a" int(11) NOT NULL,
"b" varchar(10) DEFAULT NULL,
"c" char(3) AS (substr(b,1,3)) VIRTUAL,
"c" char(3) AS (substr("b",1,3)) VIRTUAL,
PRIMARY KEY ("a"),
KEY "c" ("c")
)
@ -619,7 +619,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(10) DEFAULT NULL,
`c` char(3) AS (substr(b,1,3)) VIRTUAL,
`c` char(3) AS (substr(`b`,1,3)) VIRTUAL,
PRIMARY KEY (`a`),
KEY `c` (`c`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

View file

@ -11,7 +11,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
UNIQUE KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
@ -24,7 +24,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
UNIQUE KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
@ -46,7 +46,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
@ -59,7 +59,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
KEY `a` (`a`,`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;

View file

@ -11,7 +11,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) VIRTUAL,
`b` int(11) AS ((`a` * 2)) VIRTUAL,
UNIQUE KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
@ -24,7 +24,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
UNIQUE KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
@ -37,7 +37,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) VIRTUAL,
`b` int(11) AS ((`a` * 2)) VIRTUAL,
UNIQUE KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
@ -50,7 +50,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
UNIQUE KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
@ -75,7 +75,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) VIRTUAL,
`b` int(11) AS ((`a` * 2)) VIRTUAL,
KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
@ -90,7 +90,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
@ -103,7 +103,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
KEY `a` (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;

View file

@ -90,7 +90,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored
@ -101,7 +101,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 9. CREATE LIKE
@ -182,7 +182,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`c` int(11) AS (dayofyear(b)) VIRTUAL,
`c` int(11) AS (dayofyear(`b`)) VIRTUAL,
`b` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
@ -203,7 +203,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`c` int(11) AS (dayofyear(b)) PERSISTENT,
`c` int(11) AS (dayofyear(`b`)) PERSISTENT,
`b` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
@ -225,7 +225,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` int(11) AS (week(b,1)) VIRTUAL
`c` int(11) AS (week(`b`,1)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
DROP VIEW IF EXISTS v1,v2;

View file

@ -90,7 +90,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored
@ -101,7 +101,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 9. CREATE LIKE
@ -182,7 +182,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`c` int(11) AS (dayofyear(b)) VIRTUAL,
`c` int(11) AS (dayofyear(`b`)) VIRTUAL,
`b` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
@ -203,7 +203,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`c` int(11) AS (dayofyear(b)) PERSISTENT,
`c` int(11) AS (dayofyear(`b`)) PERSISTENT,
`b` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
@ -225,7 +225,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` int(11) AS (week(b,1)) VIRTUAL
`c` int(11) AS (week(`b`,1)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
DROP VIEW IF EXISTS v1,v2;

View file

@ -7,7 +7,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a+1) VIRTUAL
`b` int(11) AS ((`a` + 1)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (1,default);
insert into t1 values (2,default);

View file

@ -30,11 +30,7 @@ grad_degree CREATE TABLE `grad_degree` (
`plan` varchar(10) NOT NULL,
`admit_term` char(4) NOT NULL,
`wdraw_rsn` varchar(4) NOT NULL DEFAULT '',
`ofis_deg_status` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
ELSE 'Not Completed'
END) VIRTUAL,
`ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL,
`deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
`deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term',
PRIMARY KEY (`student_id`,`plan`,`admit_term`)
@ -140,46 +136,14 @@ grad_degree CREATE TABLE `grad_degree` (
`plan` varchar(10) NOT NULL,
`admit_term` char(4) NOT NULL,
`wdraw_rsn` varchar(4) NOT NULL DEFAULT '',
`ofis_deg_status` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
ELSE 'Not Completed'
END) VIRTUAL,
`ofis_deg_status2` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress2'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2'
ELSE 'Not Completed2'
END) VIRTUAL,
`ofis_deg_status3` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress3'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3'
ELSE 'Not Completed3'
END) VIRTUAL,
`ofis_deg_status4` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress4'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4'
ELSE 'Not Completed4'
END) VIRTUAL,
`ofis_deg_status5` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress5'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5'
ELSE 'Not Completed5'
END) VIRTUAL,
`ofis_deg_status6` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress6'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6'
ELSE 'Not Completed6'
END) VIRTUAL,
`ofis_deg_status7` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress7'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7'
ELSE 'Not Completed7'
END) VIRTUAL,
`ofis_deg_status8` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress8'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8'
ELSE 'Not Completed8'
END) VIRTUAL,
`ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL,
`ofis_deg_status2` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL,
`ofis_deg_status3` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL,
`ofis_deg_status4` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL,
`ofis_deg_status5` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL,
`ofis_deg_status6` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL,
`ofis_deg_status7` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL,
`ofis_deg_status8` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL,
`deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
`deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term',
PRIMARY KEY (`student_id`,`plan`,`admit_term`)
@ -229,46 +193,14 @@ grad_degree CREATE TABLE `grad_degree` (
`plan` varchar(10) NOT NULL,
`admit_term` char(4) NOT NULL,
`wdraw_rsn` varchar(4) NOT NULL DEFAULT '',
`ofis_deg_status` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
ELSE 'Not Completed'
END) VIRTUAL,
`ofis_deg_status2` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress2'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2'
ELSE 'Not Completed2'
END) VIRTUAL,
`ofis_deg_status3` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress3'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3'
ELSE 'Not Completed3'
END) VIRTUAL,
`ofis_deg_status4` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress4'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4'
ELSE 'Not Completed4'
END) VIRTUAL,
`ofis_deg_status5` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress5'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5'
ELSE 'Not Completed5'
END) VIRTUAL,
`ofis_deg_status6` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress6'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6'
ELSE 'Not Completed6'
END) VIRTUAL,
`ofis_deg_status7` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress7'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7'
ELSE 'Not Completed7'
END) VIRTUAL,
`ofis_deg_status8` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress8'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8'
ELSE 'Not Completed8'
END) VIRTUAL,
`ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL,
`ofis_deg_status2` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL,
`ofis_deg_status3` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL,
`ofis_deg_status4` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL,
`ofis_deg_status5` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL,
`ofis_deg_status6` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL,
`ofis_deg_status7` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL,
`ofis_deg_status8` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL,
`deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term',
PRIMARY KEY (`student_id`,`plan`,`admit_term`),
KEY `grad_degree_as_of_term_ndx` (`deg_as_of_term`)
@ -338,46 +270,14 @@ grad_degree CREATE TABLE `grad_degree` (
`plan` varchar(10) NOT NULL,
`admit_term` char(4) NOT NULL,
`wdraw_rsn` varchar(4) NOT NULL DEFAULT '',
`ofis_deg_status` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed'
ELSE 'Not Completed'
END) VIRTUAL,
`ofis_deg_status2` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress2'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2'
ELSE 'Not Completed2'
END) VIRTUAL,
`ofis_deg_status3` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress3'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3'
ELSE 'Not Completed3'
END) VIRTUAL,
`ofis_deg_status4` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress4'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4'
ELSE 'Not Completed4'
END) VIRTUAL,
`ofis_deg_status5` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress5'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5'
ELSE 'Not Completed5'
END) VIRTUAL,
`ofis_deg_status6` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress6'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6'
ELSE 'Not Completed6'
END) VIRTUAL,
`ofis_deg_status7` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress7'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7'
ELSE 'Not Completed7'
END) VIRTUAL,
`ofis_deg_status8` varchar(15) AS (CASE
WHEN wdraw_rsn = '' THEN 'In progress8'
WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8'
ELSE 'Not Completed8'
END) VIRTUAL,
`ofis_deg_status` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed' else 'Not Completed' end)) VIRTUAL,
`ofis_deg_status2` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress2' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed2' else 'Not Completed2' end)) VIRTUAL,
`ofis_deg_status3` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress3' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed3' else 'Not Completed3' end)) VIRTUAL,
`ofis_deg_status4` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress4' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed4' else 'Not Completed4' end)) VIRTUAL,
`ofis_deg_status5` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress5' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed5' else 'Not Completed5' end)) VIRTUAL,
`ofis_deg_status6` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress6' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed6' else 'Not Completed6' end)) VIRTUAL,
`ofis_deg_status7` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress7' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed7' else 'Not Completed7' end)) VIRTUAL,
`ofis_deg_status8` varchar(15) AS ((case when (`wdraw_rsn` = '') then 'In progress8' when ((`wdraw_rsn` = 'DCMP') or (`wdraw_rsn` = 'TRDC')) then 'Completed8' else 'Not Completed8' end)) VIRTUAL,
`deg_start_term` char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data',
`deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term',
PRIMARY KEY (`student_id`,`plan`,`admit_term`)

View file

@ -7,7 +7,7 @@ partition pa4 max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
PARTITION BY KEY (a)
@ -37,7 +37,7 @@ partition by key (a) partitions 12;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
PARTITION BY KEY (a)

View file

@ -7,7 +7,7 @@ partition pa4 max_rows=40 min_rows=2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY KEY (a)
@ -37,7 +37,7 @@ partition by key (a) partitions 12;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY KEY (a)

View file

@ -8,7 +8,7 @@ connection slave;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT (1+1),
`a` int(11) DEFAULT ((1 + 1)),
`b` bigint(20) DEFAULT uuid_short(),
`u` blob DEFAULT user()
) ENGINE=MyISAM DEFAULT CHARSET=latin1

View file

@ -675,7 +675,7 @@ t16 CREATE TABLE `t16` (
`c4` blob DEFAULT NULL,
`c5` char(5) DEFAULT NULL,
`c6` int(11) DEFAULT 1,
`c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`c7` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
PARTITION BY KEY (c1)

View file

@ -675,7 +675,7 @@ t16 CREATE TABLE `t16` (
`c4` blob DEFAULT NULL,
`c5` char(5) DEFAULT NULL,
`c6` int(11) DEFAULT 1,
`c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`c7` timestamp NULL DEFAULT current_timestamp(),
PRIMARY KEY (`c1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY KEY (c1)

View file

@ -21,7 +21,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
connection slave;
@ -38,7 +38,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
connection master;
@ -80,7 +80,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection master;
@ -122,7 +122,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
connection master;
@ -164,7 +164,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
connection slave;
@ -181,7 +181,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
connection master;
@ -223,7 +223,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection master;
@ -265,7 +265,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
connection master;
@ -307,7 +307,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection slave;
@ -324,7 +324,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
connection master;
@ -366,7 +366,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection master;
@ -408,7 +408,7 @@ t1 CREATE TABLE `t1` (
`f` float DEFAULT 0,
`total` bigint(20) unsigned DEFAULT NULL,
`y` year(4) DEFAULT NULL,
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`t` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
connection master;

View file

@ -55,7 +55,7 @@ show create table test.byrange_tbl;
Table Create Table
byrange_tbl CREATE TABLE `byrange_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,
@ -69,7 +69,7 @@ show create table test.regular_tbl;
Table Create Table
regular_tbl CREATE TABLE `regular_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,
@ -99,7 +99,7 @@ show create table test.byrange_tbl;
Table Create Table
byrange_tbl CREATE TABLE `byrange_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,
@ -113,7 +113,7 @@ show create table test.regular_tbl;
Table Create Table
regular_tbl CREATE TABLE `regular_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,

View file

@ -55,7 +55,7 @@ show create table test.byrange_tbl;
Table Create Table
byrange_tbl CREATE TABLE `byrange_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,
@ -69,7 +69,7 @@ show create table test.regular_tbl;
Table Create Table
regular_tbl CREATE TABLE `regular_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,
@ -99,7 +99,7 @@ show create table test.byrange_tbl;
Table Create Table
byrange_tbl CREATE TABLE `byrange_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,
@ -113,7 +113,7 @@ show create table test.regular_tbl;
Table Create Table
regular_tbl CREATE TABLE `regular_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,

View file

@ -55,7 +55,7 @@ show create table test.byrange_tbl;
Table Create Table
byrange_tbl CREATE TABLE `byrange_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,
@ -69,7 +69,7 @@ show create table test.regular_tbl;
Table Create Table
regular_tbl CREATE TABLE `regular_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,
@ -99,7 +99,7 @@ show create table test.byrange_tbl;
Table Create Table
byrange_tbl CREATE TABLE `byrange_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,
@ -113,7 +113,7 @@ show create table test.regular_tbl;
Table Create Table
regular_tbl CREATE TABLE `regular_tbl` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`dt` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`user` char(255) DEFAULT NULL,
`uuidf` varbinary(255) DEFAULT NULL,
`fkid` int(11) DEFAULT NULL,

View file

@ -12,14 +12,14 @@ Table Create Table
mysql050614_temporal0 CREATE TABLE `mysql050614_temporal0` (
`a` time DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`c` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE mysql050614_temporal1;
Table Create Table
mysql050614_temporal1 CREATE TABLE `mysql050614_temporal1` (
`a` time(1) DEFAULT NULL,
`b` datetime(1) DEFAULT NULL,
`c` timestamp(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1) ON UPDATE CURRENT_TIMESTAMP(1)
`c` timestamp(1) NOT NULL DEFAULT current_timestamp(1) ON UPDATE current_timestamp(1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
connection slave;
SELECT @@mysql56_temporal_format;

View file

@ -15,14 +15,14 @@ Table Create Table
mysql050614_temporal0 CREATE TABLE `mysql050614_temporal0` (
`a` time DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`c` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE mysql050614_temporal1;
Table Create Table
mysql050614_temporal1 CREATE TABLE `mysql050614_temporal1` (
`a` time(1) DEFAULT NULL,
`b` datetime(1) DEFAULT NULL,
`c` timestamp(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1) ON UPDATE CURRENT_TIMESTAMP(1)
`c` timestamp(1) NOT NULL DEFAULT current_timestamp(1) ON UPDATE current_timestamp(1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
connection slave;
SELECT @@mysql56_temporal_format;

View file

@ -2,7 +2,7 @@ CREATE TABLE t1 (a TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP NULL);
@ -32,7 +32,7 @@ CREATE TABLE t1 (a TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT NULL);
@ -60,7 +60,7 @@ CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NULL DEFAULT CURRENT_TIMESTAMP
`a` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
@ -81,14 +81,14 @@ CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -96,7 +96,7 @@ CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -104,7 +104,7 @@ CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP DEFAULT '0000-00-00 00:00:00');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -112,7 +112,7 @@ CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -120,7 +120,7 @@ CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00')
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -128,39 +128,39 @@ CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NULL DEFAULT CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`b` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP) AS SELECT 1 AS i;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`i` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
CREATE TABLE t2 (b TIMESTAMP) AS SELECT a FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP TABLE t1;
@ -170,6 +170,6 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`b` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;

View file

@ -37,7 +37,7 @@ CREATE TABLE t1 (a TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NULL DEFAULT CURRENT_TIMESTAMP
`a` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT NULL);
@ -65,7 +65,7 @@ CREATE TABLE t1 (a TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NULL DEFAULT CURRENT_TIMESTAMP
`a` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00');
@ -86,7 +86,7 @@ CREATE TABLE t1 (a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`a` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL);
@ -134,7 +134,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NULL DEFAULT NULL,
`b` timestamp NULL DEFAULT CURRENT_TIMESTAMP
`b` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
@ -142,7 +142,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NULL DEFAULT NULL,
`b` timestamp NULL DEFAULT CURRENT_TIMESTAMP
`b` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP,b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
@ -150,7 +150,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` timestamp NULL DEFAULT NULL,
`b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
`b` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP) AS SELECT 1 AS i;

View file

@ -0,0 +1,7 @@
create table t (a int primary key, b int, c int as (b), index (c));
insert t (a,b) values (10,1);
replace delayed t (a,b) values (10,5);
check table t;
Table Op Msg_type Msg_text
test.t check status OK
drop table t;

View file

@ -9,7 +9,7 @@ alter table t1 auto_increment = 3;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c2` int(11) AS (1+1) VIRTUAL,
`c2` int(11) AS ((1 + 1)) VIRTUAL,
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1

View file

@ -7,7 +7,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a+1) VIRTUAL
`b` int(11) AS ((`a` + 1)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (1,default);
insert into t1 values (2,default);

View file

@ -21,25 +21,25 @@ create or replace table t1 (a datetime as (current_time()) PERSISTENT);
ERROR HY000: Function or expression 'curtime()' cannot be used in the GENERATED ALWAYS AS clause of `a`
# CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP
create or replace table t1 (a datetime as (current_timestamp()) PERSISTENT);
ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `a`
ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `a`
create or replace table t1 (a datetime as (current_timestamp) PERSISTENT);
ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `a`
ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `a`
# CURTIME()
create or replace table t1 (a datetime as (curtime()) PERSISTENT);
ERROR HY000: Function or expression 'curtime()' cannot be used in the GENERATED ALWAYS AS clause of `a`
# LOCALTIME(), LOCALTIME
create or replace table t1 (a datetime, b varchar(10) as (localtime()) PERSISTENT);
ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b`
ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b`
create or replace table t1 (a datetime, b varchar(10) as (localtime) PERSISTENT);
ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b`
ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b`
# LOCALTIMESTAMP, LOCALTIMESTAMP()(v4.0.6)
create or replace table t1 (a datetime, b varchar(10) as (localtimestamp()) PERSISTENT);
ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b`
ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b`
create or replace table t1 (a datetime, b varchar(10) as (localtimestamp) PERSISTENT);
ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b`
ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b`
# NOW()
create or replace table t1 (a datetime, b varchar(10) as (now()) PERSISTENT);
ERROR HY000: Function or expression 'now()' cannot be used in the GENERATED ALWAYS AS clause of `b`
ERROR HY000: Function or expression 'current_timestamp()' cannot be used in the GENERATED ALWAYS AS clause of `b`
# SYSDATE()
create or replace table t1 (a int, b varchar(10) as (sysdate()) PERSISTENT);
ERROR HY000: Function or expression 'sysdate()' cannot be used in the GENERATED ALWAYS AS clause of `b`
@ -242,7 +242,7 @@ drop function sub1;
create or replace table t1 (a int, b varchar(300) as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')));
drop table t1;
create or replace table t1 (a int, b varchar(16384) as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')));
ERROR HY000: Table definition is too large
ERROR HY000: Expression in the GENERATED ALWAYS AS clause is too big
#
# Constant expression
create or replace table t1 (a int as (PI()) PERSISTENT);

View file

@ -54,7 +54,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -67,7 +67,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -87,7 +87,7 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t2;
Field Type Null Key Default Extra
@ -109,7 +109,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -131,7 +131,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int as (a % 2));
@ -141,6 +141,6 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;

View file

@ -54,7 +54,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -67,7 +67,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -87,7 +87,7 @@ show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL COMMENT 'my comment'
`b` int(11) AS ((`a` % 2)) VIRTUAL COMMENT 'my comment'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t2;
Field Type Null Key Default Extra
@ -109,7 +109,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
Field Type Null Key Default Extra
@ -131,7 +131,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int as (a % 2));
@ -141,6 +141,6 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;

View file

@ -13,7 +13,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
UNIQUE KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
@ -28,7 +28,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
UNIQUE KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
@ -57,7 +57,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;
@ -70,7 +70,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
KEY `a` (`a`,`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
describe t1;

View file

@ -129,7 +129,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
UNIQUE KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
@ -144,7 +144,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
UNIQUE KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
@ -173,7 +173,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;
@ -186,7 +186,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a*2) PERSISTENT,
`b` int(11) AS ((`a` * 2)) PERSISTENT,
KEY `a` (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
describe t1;

View file

@ -130,7 +130,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(32) DEFAULT NULL,
`v` char(32) CHARACTER SET ucs2 AS (a) VIRTUAL
`v` char(32) CHARACTER SET ucs2 AS (`a`) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a int, b int);
@ -155,7 +155,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` char(2) NOT NULL,
`c` enum('Y','N') AS (case when b = 'aa' then 'Y' else 'N' end) PERSISTENT
`c` enum('Y','N') AS ((case when (`b` = 'aa') then 'Y' else 'N' end)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1(a,b) values (1,'bb'), (2,'aa'), (3,'cc');
select * from t1;
@ -173,7 +173,7 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` set('y','n') AS (if(a=0,if(b=0,('n,n'),('n,y')),if(b=0,('y,n'),('y,y')))) PERSISTENT
`c` set('y','n') AS (if((`a` = 0),if((`b` = 0),'n,n','n,y'),if((`b` = 0),'y,n','y,y'))) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t2(a,b) values (7,0), (2,3), (0,1);
select * from t2;
@ -227,7 +227,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) DEFAULT NULL,
`b` bigint(20) AS (a > '2') VIRTUAL
`b` bigint(20) AS ((`a` > '2')) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 (a) values (1),(3);
select * from t1;
@ -244,7 +244,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) DEFAULT NULL,
`b` bigint(20) AS (a between 0 and 2) VIRTUAL
`b` bigint(20) AS ((`a` between 0 and 2)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 (a) values (1),(3);
select * from t1;
@ -261,7 +261,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL,
`b` char(10) AS (a between 0 and 2) VIRTUAL
`b` char(10) AS ((`a` between 0 and 2)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 (a) values (1),(3);
select * from t1;
@ -284,8 +284,8 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(32) DEFAULT NULL,
`c` int(11) AS (a MOD 10) VIRTUAL,
`d` varchar(5) AS (LEFT(b,5)) PERSISTENT
`c` int(11) AS ((`a` % 10)) VIRTUAL,
`d` varchar(5) AS (left(`b`,5)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show columns from t1;
Field Type Null Key Default Extra
@ -324,7 +324,7 @@ create table t1 (v1 varchar(255) as (c1) persistent, c1 varchar(50)) collate=lat
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`v1` varchar(255) AS (c1) PERSISTENT,
`v1` varchar(255) AS (`c1`) PERSISTENT,
`c1` varchar(50) COLLATE latin1_general_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
drop table t1;
@ -339,7 +339,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
`b` timestamp AS (TIMESTAMP(a)) VIRTUAL
`b` timestamp AS (cast(`a` as datetime)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a DATETIME, b TIMESTAMP AS (TIMESTAMP(a)),c TIMESTAMP);
@ -347,7 +347,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
`b` timestamp AS (TIMESTAMP(a)) VIRTUAL,
`b` timestamp AS (cast(`a` as datetime)) VIRTUAL,
`c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;

View file

@ -81,7 +81,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored
@ -92,7 +92,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 9. CREATE LIKE
@ -173,7 +173,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`c` int(11) AS (dayofyear(b)) VIRTUAL,
`c` int(11) AS (dayofyear(`b`)) VIRTUAL,
`b` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
@ -194,7 +194,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`c` int(11) AS (dayofyear(b)) PERSISTENT,
`c` int(11) AS (dayofyear(`b`)) PERSISTENT,
`b` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
@ -216,7 +216,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` int(11) AS (week(b,1)) PERSISTENT
`c` int(11) AS (week(`b`,1)) PERSISTENT
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# Case 15. ALTER. Changing the expression of a virtual non-stored column.
@ -237,7 +237,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` int(11) AS (week(b,1)) VIRTUAL
`c` int(11) AS (week(`b`,1)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
#

View file

@ -81,7 +81,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) PERSISTENT
`b` int(11) AS ((`a` % 2)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored
@ -92,7 +92,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a % 2) VIRTUAL
`b` int(11) AS ((`a` % 2)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 9. CREATE LIKE
@ -173,7 +173,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`c` int(11) AS (dayofyear(b)) VIRTUAL,
`c` int(11) AS (dayofyear(`b`)) VIRTUAL,
`b` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
@ -194,7 +194,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`c` int(11) AS (dayofyear(b)) PERSISTENT,
`c` int(11) AS (dayofyear(`b`)) PERSISTENT,
`b` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
@ -216,7 +216,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` int(11) AS (week(b,1)) PERSISTENT
`c` int(11) AS (week(`b`,1)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# Case 15. ALTER. Changing the expression of a virtual non-stored column.
@ -237,7 +237,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` int(11) AS (week(b,1)) VIRTUAL
`c` int(11) AS (week(`b`,1)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
#

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a+1) VIRTUAL
`b` int(11) AS ((`a` + 1)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int as (a+1) virtual);
@ -13,7 +13,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a+1) VIRTUAL
`b` int(11) AS ((`a` + 1)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int generated always as (a+1) persistent);
@ -21,7 +21,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) AS (a+1) PERSISTENT
`b` int(11) AS ((`a` + 1)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
set session sql_mode='ORACLE';
@ -30,7 +30,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" int(11) DEFAULT NULL,
"b" int(11) AS (a+1) VIRTUAL
"b" int(11) AS (("a" + 1)) VIRTUAL
)
drop table t1;
create table t1 (a int, b int generated always as (a+1) virtual);
@ -38,7 +38,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" int(11) DEFAULT NULL,
"b" int(11) AS (a+1) VIRTUAL
"b" int(11) AS (("a" + 1)) VIRTUAL
)
drop table t1;
create table t1 (a int, b int as (a+1) persistent);
@ -46,7 +46,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" int(11) DEFAULT NULL,
"b" int(11) AS (a+1) PERSISTENT
"b" int(11) AS (("a" + 1)) PERSISTENT
)
drop table t1;
set session sql_mode=@OLD_SQL_MODE;

View file

@ -0,0 +1,5 @@
create table t (a int primary key, b int, c int as (b), index (c));
insert t (a,b) values (10,1);
replace delayed t (a,b) values (10,5);
check table t;
drop table t;

View file

@ -345,7 +345,7 @@ eval create or replace table t1 (a int, b varchar(16384) as (concat(a,'$tmp_long
--disable_query_log
let $tmp_long_string = `SELECT repeat('a',65535)`;
--error ER_TOO_MANY_FIELDS
--error ER_EXPRESSION_IS_TOO_BIG
eval create or replace table t1 (a int, b varchar(16384) as (concat(a,'$tmp_long_string')));
--enable_query_log

View file

@ -448,11 +448,12 @@ DEALLOCATE PREPARE stmt;
# We can't have an expression for prepared statements
#
PREPARE stmt FROM 'CREATE TABLE t1 (a INT DEFAULT(?+?))';
prepare stmt from 'create table t1 (a int default(?+?))';
set @a=1;
--error ER_PARSE_ERROR
execute stmt using @a,@a;
DEALLOCATE PREPARE stmt;
deallocate prepare stmt;
show create table t1;
drop table t1;
--echo #
--echo # Parenthesized Item_basic_constant
@ -1974,3 +1975,21 @@ DROP TABLE t1;
--echo # end of 10.2 test
#
# ANSI_QUOTES
#
set sql_mode=ansi_quotes;
create table t1 (a int, b int default (a+1));
show create table t1;
insert t1 (a) values (10);
set sql_mode='';
show create table t1;
insert t1 (a) values (20);
flush tables;
show create table t1;
insert t1 (a) values (30);
select * from t1;
drop table t1;
set sql_mode=default;

View file

@ -163,7 +163,7 @@ create table t1 (col1 date)
partition by range(unix_timestamp(col1))
(partition p0 values less than (10), partition p1 values less than (30));
-- error ER_PARSE_ERROR
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create table t1 (col1 datetime)
partition by range(week(col1))
(partition p0 values less than (10), partition p1 values less than (30));

View file

@ -4956,8 +4956,8 @@ Field_timestamp::Field_timestamp(uchar *ptr_arg, uint32 len_arg,
this field will be automaticly updated on insert.
*/
flags|= TIMESTAMP_FLAG;
flags|= ON_UPDATE_NOW_FLAG;
DBUG_ASSERT(unireg_check == TIMESTAMP_UN_FIELD);
if (unireg_check != TIMESTAMP_DN_FIELD)
flags|= ON_UPDATE_NOW_FLAG;
}
}
@ -9773,35 +9773,32 @@ void Column_definition::create_length_to_internal_length(void)
}
bool check_expression(Virtual_column_info *vcol, const char *type,
const char *name, bool must_be_determinstic)
bool check_expression(Virtual_column_info *vcol, const char *name,
enum_vcol_info_type type)
{
bool ret;
Item::vcol_func_processor_result res;
/* We use 2 bytes to store the expression length */
if (vcol->expr_str.length > UINT_MAX32)
{
my_error(ER_EXPRESSION_IS_TOO_BIG, MYF(0), type, name);
return TRUE;
}
if (!vcol->name.length)
vcol->name.str= const_cast<char*>(name);
/*
Walk through the Item tree checking if all items are valid
to be part of the virtual column
*/
res.errors= 0;
ret= vcol->expr_item->walk(&Item::check_vcol_func_processor, 0, &res);
vcol->flags= res.errors;
uint filter= VCOL_IMPOSSIBLE;
if (must_be_determinstic)
if (type != VCOL_GENERATED_VIRTUAL && type != VCOL_DEFAULT)
filter|= VCOL_NOT_STRICTLY_DETERMINISTIC;
if (ret || (res.errors & filter))
{
my_error(ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED, MYF(0), res.name,
type, name);
vcol_type_name(type), name);
return TRUE;
}
/*
@ -9826,20 +9823,19 @@ bool Column_definition::check(THD *thd)
{
DBUG_ASSERT(vcol_info->expr_item);
vcol_info->set_field_type(sql_type);
if (check_expression(vcol_info, "GENERATED ALWAYS AS", field_name,
vcol_info->stored_in_db))
if (check_expression(vcol_info, field_name, vcol_info->stored_in_db
? VCOL_GENERATED_STORED : VCOL_GENERATED_VIRTUAL))
DBUG_RETURN(TRUE);
}
if (check_constraint &&
check_expression(check_constraint, "CHECK", field_name, 0))
DBUG_RETURN(1);
check_expression(check_constraint, field_name, VCOL_CHECK_FIELD))
DBUG_RETURN(1);
if (default_value)
{
Item *def_expr= default_value->expr_item;
if (check_expression(default_value, "DEFAULT", field_name, 0))
if (check_expression(default_value, field_name, VCOL_DEFAULT))
DBUG_RETURN(TRUE);
/* Constant's are stored in the 'empty_record', except for blobs */
@ -10556,8 +10552,8 @@ Column_definition::Column_definition(THD *thd, Field *old_field,
if (!(flags & (NO_DEFAULT_VALUE_FLAG | BLOB_FLAG)) &&
old_field->ptr != NULL && orig_field != NULL)
{
if (orig_field->has_update_default_function())
unireg_check= Field::TIMESTAMP_UN_FIELD;
if (orig_field->unireg_check != Field::NEXT_NUMBER)
unireg_check= orig_field->unireg_check;
/* Get the value from default_values */
const uchar *dv= orig_field->table->s->default_values;
@ -10567,8 +10563,6 @@ Column_definition::Column_definition(THD *thd, Field *old_field,
String *res= orig_field->val_str(&tmp, orig_field->ptr_in_record(dv));
char *pos= (char*) thd->strmake(res->ptr(), res->length());
default_value= new (thd->mem_root) Virtual_column_info();
default_value->expr_str.str= pos;
default_value->expr_str.length= res->length();
default_value->expr_item=
new (thd->mem_root) Item_string(thd, pos, res->length(), charset);
default_value->utf8= 0;

View file

@ -560,6 +560,28 @@ inline bool is_temporal_type_with_time(enum_field_types type)
}
}
enum enum_vcol_info_type
{
VCOL_GENERATED_VIRTUAL, VCOL_GENERATED_STORED,
VCOL_DEFAULT, VCOL_CHECK_FIELD, VCOL_CHECK_TABLE
};
static inline const char *vcol_type_name(enum_vcol_info_type type)
{
switch (type)
{
case VCOL_GENERATED_VIRTUAL:
case VCOL_GENERATED_STORED:
return "GENERATED ALWAYS AS";
case VCOL_DEFAULT:
return "DEFAULT";
case VCOL_CHECK_FIELD:
case VCOL_CHECK_TABLE:
return "CHECK";
}
return 0;
}
/*
Flags for Virtual_column_info. If none is set, the expression must be
a constant with no side-effects, so it's calculated at CREATE TABLE time,
@ -599,10 +621,7 @@ public:
/* Flag indicating that the field is physically stored in the database */
bool stored_in_db;
bool utf8; /* Already in utf8 */
/* The expression to compute the value of the virtual column */
Item *expr_item;
/* Text representation of the defining expression */
LEX_STRING expr_str;
LEX_STRING name; /* Name of constraint */
uint flags;
@ -611,7 +630,7 @@ public:
in_partitioning_expr(FALSE), stored_in_db(FALSE),
utf8(TRUE), expr_item(NULL), flags(0)
{
expr_str.str= name.str= NULL;
name.str= NULL;
name.length= 0;
};
~Virtual_column_info() {}
@ -640,13 +659,8 @@ public:
{
in_partitioning_expr= TRUE;
}
bool is_equal(const Virtual_column_info* vcol) const
{
return field_type == vcol->get_real_type()
&& stored_in_db == vcol->is_stored()
&& expr_str.length == vcol->expr_str.length
&& memcmp(expr_str.str, vcol->expr_str.str, expr_str.length) == 0;
}
inline bool is_equal(const Virtual_column_info* vcol) const;
void print(String*);
};
class Field: public Value_source
@ -920,7 +934,12 @@ public:
bool has_update_default_function() const
{
return unireg_check == TIMESTAMP_UN_FIELD;
return flags & ON_UPDATE_NOW_FLAG;
}
bool has_default_now_unireg_check() const
{
return unireg_check == TIMESTAMP_DN_FIELD
|| unireg_check == TIMESTAMP_DNUN_FIELD;
}
/*
@ -940,14 +959,6 @@ public:
}
virtual void set_explicit_default(Item *value);
/**
Evaluates the @c INSERT default function and stores the result in the
field. If no such function exists for the column, or the function is not
valid for the column's data type, invoking this function has no effect.
*/
virtual int evaluate_insert_default_function() { return 0; }
/**
Evaluates the @c UPDATE default function, if one exists, and stores the
result in the record buffer. If no such function exists for the column,
@ -2785,7 +2796,11 @@ public:
const char *field_name_arg)
:Field_temporal_with_date(ptr_arg, length_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg)
{}
{
if (unireg_check == TIMESTAMP_UN_FIELD ||
unireg_check == TIMESTAMP_DNUN_FIELD)
flags|= ON_UPDATE_NOW_FLAG;
}
enum_field_types type() const { return MYSQL_TYPE_DATETIME;}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
double val_real(void);
@ -3779,8 +3794,7 @@ public:
bool has_default_function() const
{
return (unireg_check == Field::TIMESTAMP_UN_FIELD ||
unireg_check == Field::NEXT_NUMBER);
return unireg_check != Field::NONE;
}
Field *make_field(TABLE_SHARE *share, MEM_ROOT *mem_root,
@ -3801,6 +3815,12 @@ public:
}
/* Return true if default is an expression that must be saved explicitely */
bool has_default_expression();
bool has_default_now_unireg_check() const
{
return unireg_check == Field::TIMESTAMP_DN_FIELD
|| unireg_check == Field::TIMESTAMP_DNUN_FIELD;
}
};
@ -3897,8 +3917,8 @@ uint32 calc_pack_length(enum_field_types type,uint32 length);
int set_field_to_null(Field *field);
int set_field_to_null_with_conversions(Field *field, bool no_conversions);
int convert_null_to_field_value_or_error(Field *field);
bool check_expression(Virtual_column_info *vcol, const char *type,
const char *name, bool must_be_deterministic);
bool check_expression(Virtual_column_info *vcol, const char *name,
enum_vcol_info_type type);
/*
The following are for the interface with the .frm file

Some files were not shown because too many files have changed in this diff Show more