diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-11-07 17:17:40 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-12-12 20:35:41 +0100 |
commit | a411d7f4f670c24b43b50f7d2a1129e10218f4a7 (patch) | |
tree | cc1e9cdf6b85bdcec8c0369e502d4d211b2f7263 /mysql-test/suite/vcol/r | |
parent | 8b3b6dc377c548b1b72978a015af999cf6e99760 (diff) | |
download | mariadb-git-a411d7f4f670c24b43b50f7d2a1129e10218f4a7.tar.gz |
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.
Diffstat (limited to 'mysql-test/suite/vcol/r')
-rw-r--r-- | mysql-test/suite/vcol/r/delayed.result | 7 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/innodb_autoinc_vcol.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/rpl_vcol.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result | 16 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_keys_innodb.result | 8 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_keys_myisam.result | 8 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_misc.result | 22 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result | 354 | ||||
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_syntax.result | 12 |
13 files changed, 243 insertions, 236 deletions
diff --git a/mysql-test/suite/vcol/r/delayed.result b/mysql-test/suite/vcol/r/delayed.result new file mode 100644 index 00000000000..ba3ac5c1c65 --- /dev/null +++ b/mysql-test/suite/vcol/r/delayed.result @@ -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; diff --git a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result index 934a84cc3cc..7bad8e9f6d4 100644 --- a/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result +++ b/mysql-test/suite/vcol/r/innodb_autoinc_vcol.result @@ -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 diff --git a/mysql-test/suite/vcol/r/rpl_vcol.result b/mysql-test/suite/vcol/r/rpl_vcol.result index a20719ad813..2ec225b0ff6 100644 --- a/mysql-test/suite/vcol/r/rpl_vcol.result +++ b/mysql-test/suite/vcol/r/rpl_vcol.result @@ -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); diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result index dd580c344b0..6605f7c99b4 100644 --- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result +++ b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result @@ -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); diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result index e66c2d3a3c3..42b852a7c6c 100644 --- a/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result @@ -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; diff --git a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result index d60a3cf1a51..7af1d35b67f 100644 --- a/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result @@ -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; diff --git a/mysql-test/suite/vcol/r/vcol_keys_innodb.result b/mysql-test/suite/vcol/r/vcol_keys_innodb.result index 79450d41684..843bd6efc8e 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_keys_innodb.result @@ -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; diff --git a/mysql-test/suite/vcol/r/vcol_keys_myisam.result b/mysql-test/suite/vcol/r/vcol_keys_myisam.result index a62fc2ffda0..2a551956173 100644 --- a/mysql-test/suite/vcol/r/vcol_keys_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_keys_myisam.result @@ -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; diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index d4a583c34b2..4aeeda38cc1 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -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; diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result index 76482b39d79..c026637c0a5 100644 --- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result +++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result @@ -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; # diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result index 233f6778ca9..172fc631f08 100644 --- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result @@ -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; # diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result index a6f69edab1a..328184aabca 100644 --- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result +++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs.result @@ -9,7 +9,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (abs(a)) VIRTUAL + `b` int(11) AS (abs(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1, default); select * from t1; @@ -24,7 +24,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(acos(a),6)) VIRTUAL + `b` double AS (format(acos(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1, default); insert into t1 values (1.0001,default); @@ -43,7 +43,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(asin(a),6)) VIRTUAL + `b` double AS (format(asin(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0.2, default); insert into t1 values (1.0001,default); @@ -61,7 +61,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan(a,b),6)) VIRTUAL + `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -77,7 +77,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `c` double AS (format(atan(a),6)) VIRTUAL + `c` double AS (format(atan(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,default); insert into t1 values (format(PI(),6),default); @@ -95,7 +95,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(atan2(a,b),6)) VIRTUAL + `c` double AS (format(atan(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-2,2,default); insert into t1 values (format(PI(),6),0,default); @@ -112,7 +112,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (ceil(a)) VIRTUAL + `b` int(11) AS (ceiling(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -131,7 +131,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` int(11) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (conv(a,b,c)) VIRTUAL + `d` varchar(10) AS (conv(`a`,`b`,`c`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a',16,2,default); insert into t1 values ('6e',18,8,default); @@ -152,7 +152,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cos(a),6)) VIRTUAL + `b` double AS (format(cos(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); select * from t1; @@ -167,7 +167,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(cot(a),6)) VIRTUAL + `b` double AS (format(cot(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); insert into t1 values (1,default); @@ -184,7 +184,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (crc32(a)) VIRTUAL + `b` mediumtext AS (crc32(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('mysql',default); @@ -201,7 +201,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(degrees(a),6)) VIRTUAL + `b` double AS (format(degrees(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()/2,6),default); @@ -218,7 +218,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a/2) VIRTUAL + `b` double AS ((`a` / 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -233,7 +233,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(exp(a),6)) VIRTUAL + `b` double AS (format(exp(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -252,7 +252,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` mediumtext AS (floor(a)) VIRTUAL + `b` mediumtext AS (floor(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.23,default); insert into t1 values (-1.23,default); @@ -269,7 +269,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(ln(a),6)) VIRTUAL + `b` double AS (format(ln(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -287,7 +287,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` double AS (format(log(a,b),6)) VIRTUAL + `c` double AS (format(log(`a`,`b`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,65536,default); insert into t1 values (10,100,default); @@ -305,7 +305,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log(a),6)) VIRTUAL + `b` double AS (format(log(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (-2,default); @@ -322,7 +322,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log2(a),6)) VIRTUAL + `b` double AS (format(log2(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (65536,default); insert into t1 values (-100,default); @@ -339,7 +339,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(log10(a),6)) VIRTUAL + `b` double AS (format(log10(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); insert into t1 values (100,default); @@ -358,7 +358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a-1) VIRTUAL + `b` double AS ((`a` - 1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2,default); select * from t1; @@ -373,7 +373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (mod(a,10)) VIRTUAL + `b` int(11) AS ((`a` % 10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -390,7 +390,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a % 10) VIRTUAL + `b` int(11) AS ((`a` % 10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (11,default); @@ -407,7 +407,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(10) AS (oct(a)) VIRTUAL + `b` varchar(10) AS (conv(`a`,10,8)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -422,7 +422,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(PI()*a*a,6)) VIRTUAL + `b` double AS (format(((pi() * `a`) * `a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); select * from t1; @@ -437,7 +437,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); select * from t1; @@ -452,8 +452,8 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (pow(a,2)) VIRTUAL, - `c` int(11) AS (power(a,2)) VIRTUAL + `b` int(11) AS (pow(`a`,2)) VIRTUAL, + `c` int(11) AS (pow(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default,default); insert into t1 values (2,default,default); @@ -470,7 +470,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(radians(a),6)) VIRTUAL + `b` double AS (format(radians(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (90,default); select * from t1; @@ -485,7 +485,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (round(a)) VIRTUAL + `b` int(11) AS (round(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1.23,default); insert into t1 values (-1.58,default); @@ -504,7 +504,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, `b` double DEFAULT NULL, - `c` int(11) AS (round(a,b)) VIRTUAL + `c` int(11) AS (round(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.298,1,default); insert into t1 values (1.298,0,default); @@ -523,7 +523,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` int(11) AS (sign(a)) VIRTUAL + `b` int(11) AS (sign(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-32,default); insert into t1 values (0,default); @@ -542,7 +542,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sin(a),6)) VIRTUAL + `b` double AS (format(sin(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI()/2,6),default); select * from t1; @@ -557,7 +557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(sqrt(a),6)) VIRTUAL + `b` double AS (format(sqrt(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (4,default); insert into t1 values (20,default); @@ -576,7 +576,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (format(tan(a),6)) VIRTUAL + `b` double AS (format(tan(`a`),6)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (format(PI(),6),default); insert into t1 values (format(PI()+1,6),default); @@ -593,7 +593,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (a*3) VIRTUAL + `b` double AS ((`a` * 3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -612,7 +612,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (truncate(a,4)) VIRTUAL + `b` double AS (truncate(`a`,4)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1.223,default); insert into t1 values (1.999,default); @@ -633,7 +633,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` double AS (-a) VIRTUAL + `b` double AS (-(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -653,7 +653,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(2) DEFAULT NULL, - `b` int(11) AS (ascii(a)) VIRTUAL + `b` int(11) AS (ascii(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2',default); insert into t1 values (2,default); @@ -672,7 +672,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (bin(a)) VIRTUAL + `b` varchar(10) AS (conv(`a`,10,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -687,7 +687,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (bit_length(a)) VIRTUAL + `b` mediumtext AS (bit_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -702,7 +702,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (char_length(a)) VIRTUAL + `b` mediumtext AS (char_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -718,7 +718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` varbinary(10) AS (char(a,b)) VIRTUAL + `c` varbinary(10) AS (char(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (77,121,default); select * from t1; @@ -733,7 +733,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (character_length(a)) VIRTUAL + `b` mediumtext AS (char_length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -749,7 +749,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat_ws(',',a,b)) VIRTUAL + `c` varchar(20) AS (concat_ws(',',`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -765,7 +765,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (concat(a,',',b)) VIRTUAL + `c` varchar(20) AS (concat(`a`,',',`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',default); select * from t1; @@ -782,7 +782,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(10) AS (elt(c,a,b)) VIRTUAL + `d` varchar(10) AS (elt(`c`,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('value1','value2',1,default); insert into t1 values ('value1','value2',2,default); @@ -799,7 +799,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (export_set(a,'1','0','',10)) VIRTUAL + `b` varchar(10) AS (export_set(`a`,'1','0','',10)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (6,default); select * from t1; @@ -815,7 +815,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (field('aa',a,b)) VIRTUAL + `c` int(11) AS (field('aa',`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('aa','bb',default); insert into t1 values ('bb','aa',default); @@ -833,7 +833,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (find_in_set(a,b)) VIRTUAL + `c` int(11) AS (find_in_set(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('aa','aa,bb,cc',default); insert into t1 values ('aa','bb,aa,cc',default); @@ -850,7 +850,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` double DEFAULT NULL, - `b` varchar(20) AS (format(a,2)) VIRTUAL + `b` varchar(20) AS (format(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12332.123456,default); select * from t1; @@ -865,7 +865,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` varchar(10) AS (hex(a)) VIRTUAL + `b` varchar(10) AS (hex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (17,default); select * from t1; @@ -879,7 +879,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (hex(a)) VIRTUAL + `b` varchar(10) AS (hex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -895,7 +895,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(20) AS (insert(a,length(a),length(b),b)) VIRTUAL + `c` varchar(20) AS (insert(`a`,length(`a`),length(`b`),`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('start,','end',default); select * from t1; @@ -911,7 +911,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` int(11) AS (instr(a,b)) VIRTUAL + `c` int(11) AS (locate(`b`,`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar,','bar',default); insert into t1 values ('xbar,','foobar',default); @@ -928,7 +928,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lcase(a)) VIRTUAL + `b` varchar(10) AS (lcase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -943,7 +943,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(5) AS (left(a,5)) VIRTUAL + `b` varchar(5) AS (left(`a`,5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -958,7 +958,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (length(a)) VIRTUAL + `b` int(11) AS (length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -973,7 +973,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a like 'H%!o' escape '!') VIRTUAL + `b` tinyint(1) AS ((`a` like 'H%!o' escape '!')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -990,7 +990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (locate('bar',a)) VIRTUAL + `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1005,7 +1005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lower(a)) VIRTUAL + `b` varchar(10) AS (lcase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1020,7 +1020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (lpad(a,4,' ')) VIRTUAL + `b` varchar(10) AS (lpad(`a`,4,' ')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); insert into t1 values ('M',default); @@ -1037,7 +1037,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (ltrim(a)) VIRTUAL + `b` varchar(10) AS (ltrim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (' MySQL',default); insert into t1 values ('MySQL',default); @@ -1056,7 +1056,7 @@ t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, `c` int(11) DEFAULT NULL, - `d` varchar(30) AS (make_set(c,a,b)) VIRTUAL + `d` varchar(30) AS (make_set(`c`,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',1,default); insert into t1 values ('a','b',3,default); @@ -1073,7 +1073,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (mid(a,1,2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,1,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1088,7 +1088,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a not like 'H%o') VIRTUAL + `b` tinyint(1) AS ((not((`a` like 'H%o')))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1105,7 +1105,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a not regexp 'H.+o') VIRTUAL + `b` tinyint(1) AS ((not((`a` regexp 'H.+o')))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1122,7 +1122,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` int(11) AS (octet_length(a)) VIRTUAL + `b` int(11) AS (length(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('text',default); select * from t1; @@ -1137,7 +1137,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` mediumtext AS (ord(a)) VIRTUAL + `b` mediumtext AS (ord(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2',default); select * from t1; @@ -1152,7 +1152,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (position('bar' in a)) VIRTUAL + `b` varchar(10) AS (locate('bar',`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1167,7 +1167,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (quote(a)) VIRTUAL + `b` varchar(10) AS (quote(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Don\'t',default); select * from t1; @@ -1182,7 +1182,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a regexp 'H.+o') VIRTUAL + `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('hello',default); @@ -1199,7 +1199,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (repeat(a,3)) VIRTUAL + `b` varchar(30) AS (repeat(`a`,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1214,7 +1214,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (replace(a,'aa','bb')) VIRTUAL + `b` varchar(30) AS (replace(`a`,'aa','bb')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1229,7 +1229,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(30) AS (reverse(a)) VIRTUAL + `b` varchar(30) AS (reverse(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('maa',default); select * from t1; @@ -1244,7 +1244,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (right(a,4)) VIRTUAL + `b` varchar(10) AS (right(`a`,4)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('foobarbar',default); select * from t1; @@ -1259,7 +1259,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` tinyint(1) AS (a rlike 'H.+o') VIRTUAL + `b` tinyint(1) AS ((`a` regexp 'H.+o')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); insert into t1 values ('MySQL',default); @@ -1276,7 +1276,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rpad(a,4,'??')) VIRTUAL + `b` varchar(10) AS (rpad(`a`,4,'??')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('He',default); select * from t1; @@ -1291,7 +1291,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (rtrim(a)) VIRTUAL + `b` varchar(10) AS (rtrim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello ',default); select * from t1; @@ -1306,7 +1306,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(20) AS (soundex(a)) VIRTUAL + `b` varchar(20) AS (soundex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1322,7 +1322,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a sounds like b) VIRTUAL + `c` tinyint(1) AS ((soundex(`a`) = soundex(`b`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello',default); insert into t1 values ('Hello','MySQL',default); @@ -1341,7 +1341,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (concat(a,space(5))) VIRTUAL + `b` varchar(10) AS (concat(`a`,space(5))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello', default); select * from t1; @@ -1357,7 +1357,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(9) DEFAULT NULL, `b` varchar(9) DEFAULT NULL, - `c` tinyint(1) AS (strcmp(a,b)) VIRTUAL + `c` tinyint(1) AS (strcmp(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello','Hello', default); insert into t1 values ('Hello','Hello1', default); @@ -1374,7 +1374,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substr(a,2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1389,7 +1389,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (substring_index(a,'.',2)) VIRTUAL + `b` varchar(10) AS (substring_index(`a`,'.',2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('www.mysql.com',default); select * from t1; @@ -1404,7 +1404,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (substring(a from 2 for 2)) VIRTUAL + `b` varchar(10) AS (substr(`a`,2,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('Hello',default); select * from t1; @@ -1419,7 +1419,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (trim(a)) VIRTUAL + `b` varchar(10) AS (trim(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (' aa ',default); select * from t1; @@ -1434,7 +1434,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (ucase(a)) VIRTUAL + `b` varchar(10) AS (ucase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1449,7 +1449,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(15) DEFAULT NULL, - `b` varchar(10) AS (unhex(a)) VIRTUAL + `b` varchar(10) AS (unhex(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('4D7953514C',default); select * from t1; @@ -1464,7 +1464,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(5) DEFAULT NULL, - `b` varchar(10) AS (upper(a)) VIRTUAL + `b` varchar(10) AS (ucase(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -1482,7 +1482,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(16) AS (case a when NULL then 'asd' when 'b' then 'B' else a end) VIRTUAL + `b` varchar(16) AS ((case `a` when NULL then 'asd' when 'b' then 'B' else `a` end)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,default); insert into t1 values ('b',default); @@ -1502,7 +1502,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (if(a=1,a,b)) VIRTUAL + `c` int(11) AS (if((`a` = 1),`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,2,default); insert into t1 values (3,4,default); @@ -1520,7 +1520,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` varchar(10) AS (ifnull(a,'DEFAULT')) VIRTUAL + `c` varchar(10) AS (ifnull(`a`,'DEFAULT')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (NULL,'adf',default); insert into t1 values ('a','adf',default); @@ -1537,7 +1537,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varchar(10) AS (nullif(a,'DEFAULT')) VIRTUAL + `b` varchar(10) AS (nullif(`a`,'DEFAULT')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('DEFAULT',default); insert into t1 values ('a',default); @@ -1557,7 +1557,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a>0 && a<2) VIRTUAL + `b` tinyint(1) AS (((`a` > 0) and (`a` < 2))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1574,7 +1574,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a between 0 and 2) VIRTUAL + `b` tinyint(1) AS ((`a` between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1591,7 +1591,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, - `b` varbinary(10) AS (binary a) VIRTUAL + `b` varbinary(10) AS (cast(`a` as char charset binary)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('11',default); insert into t1 values (1,default); @@ -1608,7 +1608,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a & 5) VIRTUAL + `b` int(11) AS ((`a` & 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1625,7 +1625,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (~a) VIRTUAL + `b` int(11) AS (~(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); Warnings: @@ -1642,7 +1642,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a | 5) VIRTUAL + `b` int(11) AS ((`a` | 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1661,7 +1661,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a ^ 5) VIRTUAL + `b` int(11) AS ((`a` ^ 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (0,default); @@ -1680,7 +1680,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a div 5) VIRTUAL + `b` int(11) AS ((`a` DIV 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (7,default); @@ -1698,7 +1698,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` tinyint(1) AS (a <=> b) VIRTUAL + `c` tinyint(1) AS ((`a` <=> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,1,default); insert into t1 values (NULL,NULL,default); @@ -1718,7 +1718,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a=b) VIRTUAL + `c` tinyint(1) AS ((`a` = `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1736,7 +1736,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a >= b) VIRTUAL + `c` tinyint(1) AS ((`a` >= `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1754,7 +1754,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a > b) VIRTUAL + `c` tinyint(1) AS ((`a` > `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a','b',default); insert into t1 values ('a','a',default); @@ -1771,7 +1771,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a is not null) VIRTUAL + `b` tinyint(1) AS ((`a` is not null)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1788,7 +1788,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a is null) VIRTUAL + `b` tinyint(1) AS (isnull(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (NULL,default); @@ -1805,7 +1805,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 insert into t1 values (1,default); insert into t1 values (3,default); @@ -1823,7 +1823,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a <= b) VIRTUAL + `c` tinyint(1) AS ((`a` <= `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1843,7 +1843,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a < b) VIRTUAL + `c` tinyint(1) AS ((`a` < `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1862,7 +1862,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` tinyint(1) AS (a not between 0 and 2) VIRTUAL + `b` tinyint(1) AS ((`a` not between 0 and 2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (-1,default); insert into t1 values (1,default); @@ -1880,7 +1880,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a <> b) VIRTUAL + `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1900,7 +1900,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(10) DEFAULT NULL, `b` varchar(10) DEFAULT NULL, - `c` tinyint(1) AS (a != b) VIRTUAL + `c` tinyint(1) AS ((`a` <> `b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('b','a',default); insert into t1 values ('b','b',default); @@ -1919,7 +1919,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a>5 || a<3) VIRTUAL + `b` int(11) AS (((`a` > 5) or (`a` < 3))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (4,default); @@ -1936,7 +1936,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 insert into t1 values (8,default); insert into t1 values (3,default); @@ -1953,7 +1953,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (a xor 5) VIRTUAL + `b` int(11) AS ((`a` xor 5)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (0,default); insert into t1 values (1,default); @@ -1975,7 +1975,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (adddate(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -1990,7 +1990,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (addtime(a,'02:00:00')) VIRTUAL + `b` datetime AS (addtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2005,7 +2005,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (convert_tz(a,'MET','UTC')) VIRTUAL + `b` datetime AS (convert_tz(`a`,'MET','UTC')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2020,7 +2020,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date_add(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` + interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2035,7 +2035,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date_sub(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2050,7 +2050,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (date(a)) VIRTUAL + `b` datetime AS (cast(`a` as date)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:00:00',default); select * from t1; @@ -2065,7 +2065,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` mediumtext AS (datediff(a,'2000-01-01')) VIRTUAL + `b` mediumtext AS ((to_days(`a`) - to_days('2000-01-01'))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2080,7 +2080,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (day(a)) VIRTUAL + `b` int(11) AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2095,7 +2095,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofmonth(a)) VIRTUAL + `b` int(11) AS (dayofmonth(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2110,7 +2110,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofweek(a)) VIRTUAL + `b` int(11) AS (dayofweek(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2125,7 +2125,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (dayofyear(a)) VIRTUAL + `b` int(11) AS (dayofyear(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2140,7 +2140,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (extract(year from a)) VIRTUAL + `b` int(11) AS (extract(year from `a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2155,7 +2155,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumtext DEFAULT NULL, - `b` datetime AS (from_days(a)) VIRTUAL + `b` datetime AS (from_days(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (730669,default); select * from t1; @@ -2171,7 +2171,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumtext DEFAULT NULL, - `b` datetime AS (from_unixtime(a)) VIRTUAL + `b` datetime AS (from_unixtime(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1196440219,default); select * from t1; @@ -2186,7 +2186,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` mediumtext AS (hour(a)) VIRTUAL + `b` mediumtext AS (hour(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2201,7 +2201,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (last_day(a)) VIRTUAL + `b` datetime AS (last_day(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-05',default); insert into t1 values ('2003-02-32',default); @@ -2220,7 +2220,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` datetime AS (makedate(a,1)) VIRTUAL + `b` datetime AS (makedate(`a`,1)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2001,default); select * from t1; @@ -2235,7 +2235,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` time AS (maketime(a,1,3)) VIRTUAL + `b` time AS (maketime(`a`,1,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (12,default); select * from t1; @@ -2250,7 +2250,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` mediumtext AS (microsecond(a)) VIRTUAL + `b` mediumtext AS (microsecond(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 12:00:00.123456',default); insert into t1 values ('2009-12-31 23:59:59.000010',default); @@ -2267,7 +2267,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (minute(a)) VIRTUAL + `b` int(11) AS (minute(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2282,7 +2282,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (month(a)) VIRTUAL + `b` int(11) AS (month(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2009-12-31 23:59:59.000010',default); select * from t1; @@ -2297,7 +2297,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (period_add(a,2)) VIRTUAL + `b` int(11) AS (period_add(`a`,2)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (200801,default); select * from t1; @@ -2313,7 +2313,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL, - `c` int(11) AS (period_diff(a,b)) VIRTUAL + `c` int(11) AS (period_diff(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (200802,200703,default); select * from t1; @@ -2328,7 +2328,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (quarter(a)) VIRTUAL + `b` int(11) AS (quarter(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2343,7 +2343,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumtext DEFAULT NULL, - `b` time AS (sec_to_time(a)) VIRTUAL + `b` time AS (sec_to_time(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (2378,default); select * from t1; @@ -2358,7 +2358,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (second(a)) VIRTUAL + `b` int(11) AS (second(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('10:05:03',default); select * from t1; @@ -2373,7 +2373,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(64) DEFAULT NULL, - `b` datetime AS (str_to_date(a,'%m/%d/%Y')) VIRTUAL + `b` datetime AS (str_to_date(`a`,'%m/%d/%Y')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('04/30/2004',default); select * from t1; @@ -2388,7 +2388,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subdate(a,interval 1 month)) VIRTUAL + `b` datetime AS ((`a` - interval 1 month)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2403,7 +2403,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` datetime AS (subtime(a,'02:00:00')) VIRTUAL + `b` datetime AS (subtime(`a`,'02:00:00')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31',default); select * from t1; @@ -2418,7 +2418,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` time DEFAULT NULL, - `b` mediumtext AS (time_to_sec(a)) VIRTUAL + `b` mediumtext AS (time_to_sec(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('22:23:00',default); select * from t1; @@ -2433,7 +2433,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` time AS (time(a)) VIRTUAL + `b` time AS (cast(`a` as time)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-08-31 02:03:04',default); select * from t1; @@ -2449,7 +2449,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, `b` datetime DEFAULT NULL, - `c` mediumtext AS (timediff(a,b)) VIRTUAL + `c` mediumtext AS (timediff(`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',default); select * from t1; @@ -2464,7 +2464,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 insert into t1 values ('2008-12-31',default); select * from t1; @@ -2479,7 +2479,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` timestamp AS (timestampadd(minute,1,a)) VIRTUAL + `b` timestamp AS ((`a` + interval 1 minute)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-01-02',default); select * from t1; @@ -2493,9 +2493,9 @@ create table t1 (a timestamp, b timestamp, c long as (timestampdiff(MONTH, a,b)) 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', - `c` mediumtext AS (timestampdiff(MONTH, a,b)) VIRTUAL + `c` mediumtext AS (timestampdiff(MONTH,`a`,`b`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2003-02-01','2003-05-01',default); select * from t1; @@ -2510,7 +2510,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` mediumtext AS (to_days(a)) VIRTUAL + `b` mediumtext AS (to_days(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2007-10-07',default); select * from t1; @@ -2525,7 +2525,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (week(a,0)) VIRTUAL + `b` int(11) AS (week(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2540,7 +2540,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekday(a)) VIRTUAL + `b` int(11) AS (weekday(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2555,7 +2555,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (weekofyear(a)) VIRTUAL + `b` int(11) AS (week(`a`,3)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2570,7 +2570,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (year(a)) VIRTUAL + `b` int(11) AS (year(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2585,7 +2585,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` int(11) AS (yearweek(a)) VIRTUAL + `b` int(11) AS (yearweek(`a`,0)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2008-09-01',default); select * from t1; @@ -2607,7 +2607,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` mediumtext AS (cast(a as unsigned)) VIRTUAL + `b` mediumtext AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2628,7 +2628,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` mediumtext AS (convert(a,unsigned)) VIRTUAL + `b` mediumtext AS (cast(`a` as unsigned)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1,default); insert into t1 values (-1,default); @@ -2656,7 +2656,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (aes_encrypt(aes_decrypt(a,'adf'),'adf')) VIRTUAL + `b` varchar(1024) AS (aes_encrypt(aes_decrypt(`a`,'adf'),'adf')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2671,7 +2671,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, - `b` int(11) AS (bit_count(a)) VIRTUAL + `b` int(11) AS (bit_count(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (5,default); select * from t1; @@ -2686,7 +2686,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (uncompress(compress(a))) VIRTUAL + `b` varchar(1024) AS (uncompress(compress(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2701,7 +2701,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (decode(encode(a,'abc'),'abc')) VIRTUAL + `b` varchar(1024) AS (decode(encode(`a`,'abc'),'abc')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('MySQL',default); select * from t1; @@ -2716,7 +2716,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT 'aaa', - `b` varchar(1024) AS (ifnull(a,default(a))) VIRTUAL + `b` varchar(1024) AS (ifnull(`a`,default(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('any value',default); select * from t1; @@ -2731,7 +2731,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (inet_ntoa(inet_aton(a))) VIRTUAL + `b` varchar(1024) AS (inet_ntoa(inet_aton(`a`))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('127.0.0.1',default); select * from t1; @@ -2746,7 +2746,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varbinary(32) AS (md5(a)) VIRTUAL + `b` varbinary(32) AS (md5(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('testing',default); select * from t1; @@ -2761,7 +2761,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (old_password(a)) VIRTUAL + `b` varchar(1024) AS (old_password(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('badpwd',default); select * from t1; @@ -2776,7 +2776,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (password(a)) VIRTUAL + `b` varchar(1024) AS (password(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('badpwd',default); select * from t1; @@ -2791,7 +2791,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha1(a)) VIRTUAL + `b` varchar(1024) AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2806,7 +2806,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(1024) DEFAULT NULL, - `b` varchar(1024) AS (sha(a)) VIRTUAL + `b` varchar(1024) AS (sha(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('abc',default); select * from t1; @@ -2821,7 +2821,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` char(1) DEFAULT NULL, - `b` varchar(1024) AS (uncompressed_length(compress(repeat(a,30)))) VIRTUAL + `b` varchar(1024) AS (uncompressed_length(compress(repeat(`a`,30)))) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('a',default); select * from t1; @@ -2836,7 +2836,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` varchar(100) AS (monthname(a)) VIRTUAL + `b` varchar(100) AS (monthname(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2010-10-10',default); select * from t1; @@ -2851,7 +2851,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` varchar(100) AS (dayname(a)) VIRTUAL + `b` varchar(100) AS (dayname(`a`)) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2011-11-11',default); select * from t1; @@ -2866,7 +2866,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` date DEFAULT NULL, - `b` varchar(100) AS (date_format(a, '%W %a %M %b')) VIRTUAL + `b` varchar(100) AS (date_format(`a`,'%W %a %M %b')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2012-12-12',default); select * from t1; @@ -2896,7 +2896,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` datetime DEFAULT NULL, - `b` varchar(10) AS (time_format(a,"%d.%m.%Y")) VIRTUAL + `b` varchar(10) AS (time_format(`a`,'%d.%m.%Y')) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values ('2001-01-01 02:02:02',default); select * from t1; diff --git a/mysql-test/suite/vcol/r/vcol_syntax.result b/mysql-test/suite/vcol/r/vcol_syntax.result index 8515d790359..14c376797d6 100644 --- a/mysql-test/suite/vcol/r/vcol_syntax.result +++ b/mysql-test/suite/vcol/r/vcol_syntax.result @@ -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; |