Commit 7bf4f9f7 authored by Sergei Golubchik's avatar Sergei Golubchik

followup for MDEV-6996, update tests and results

parent 24a6b413
...@@ -87,6 +87,10 @@ create table t1 (a datetime, b datetime as (utc_time())); ...@@ -87,6 +87,10 @@ create table t1 (a datetime, b datetime as (utc_time()));
-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED -- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
create table t1 (a datetime, b datetime as (utc_timestamp())); create table t1 (a datetime, b datetime as (utc_timestamp()));
--echo # WEEK() - one argument version
-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
create table t1 (a datetime, b datetime as (week(a)));
--echo # MATCH() --echo # MATCH()
if (!$skip_full_text_checks) if (!$skip_full_text_checks)
{ {
......
...@@ -141,7 +141,7 @@ show create table t1; ...@@ -141,7 +141,7 @@ show create table t1;
drop table t1; drop table t1;
--echo # Case 14. ALTER. Changing the expression of a virtual stored column. --echo # Case 14. ALTER. Changing the expression of a virtual stored column.
create table t1 (a int, b datetime, c int as (week(b)) persistent); create table t1 (a int, b datetime, c int as (week(b,0)) persistent);
insert into t1 values (1,'2008-09-04',default); insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default); insert into t1 values (2,'2008-09-05',default);
select * from t1; select * from t1;
...@@ -151,7 +151,7 @@ show create table t1; ...@@ -151,7 +151,7 @@ show create table t1;
drop table t1; drop table t1;
--echo # Case 15. ALTER. Changing the expression of a virtual non-stored column. --echo # Case 15. ALTER. Changing the expression of a virtual non-stored column.
create table t1 (a int, b datetime, c int as (week(b))); create table t1 (a int, b datetime, c int as (week(b,0)));
insert into t1 values (1,'2008-09-04',default); insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default); insert into t1 values (2,'2008-09-05',default);
select * from t1; select * from t1;
......
...@@ -1068,7 +1068,7 @@ let $rows = 1; ...@@ -1068,7 +1068,7 @@ let $rows = 1;
--source suite/vcol/inc/vcol_supported_sql_funcs.inc --source suite/vcol/inc/vcol_supported_sql_funcs.inc
--echo # WEEK() --echo # WEEK()
let $cols = a datetime, b int as (week(a)); let $cols = a datetime, b int as (week(a,0));
let $values1 = '2008-09-01',default; let $values1 = '2008-09-01',default;
let $rows = 1; let $rows = 1;
--source suite/vcol/inc/vcol_supported_sql_funcs.inc --source suite/vcol/inc/vcol_supported_sql_funcs.inc
......
...@@ -54,6 +54,9 @@ ERROR HY000: Function or expression is not allowed for column 'b' ...@@ -54,6 +54,9 @@ ERROR HY000: Function or expression is not allowed for column 'b'
# UTC_TIMESTAMP() # UTC_TIMESTAMP()
create table t1 (a datetime, b datetime as (utc_timestamp())); create table t1 (a datetime, b datetime as (utc_timestamp()));
ERROR HY000: Function or expression is not allowed for column 'b' ERROR HY000: Function or expression is not allowed for column 'b'
# WEEK() - one argument version
create table t1 (a datetime, b datetime as (week(a)));
ERROR HY000: Function or expression is not allowed for column 'b'
# MATCH() # MATCH()
# BENCHMARK() # BENCHMARK()
create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3))); create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3)));
......
...@@ -54,6 +54,9 @@ ERROR HY000: Function or expression is not allowed for column 'b' ...@@ -54,6 +54,9 @@ ERROR HY000: Function or expression is not allowed for column 'b'
# UTC_TIMESTAMP() # UTC_TIMESTAMP()
create table t1 (a datetime, b datetime as (utc_timestamp())); create table t1 (a datetime, b datetime as (utc_timestamp()));
ERROR HY000: Function or expression is not allowed for column 'b' ERROR HY000: Function or expression is not allowed for column 'b'
# WEEK() - one argument version
create table t1 (a datetime, b datetime as (week(a)));
ERROR HY000: Function or expression is not allowed for column 'b'
# MATCH() # MATCH()
create table t1 (a varchar(32), b bool as (match a against ('sample text'))); create table t1 (a varchar(32), b bool as (match a against ('sample text')));
ERROR HY000: Function or expression is not allowed for column 'b' ERROR HY000: Function or expression is not allowed for column 'b'
......
...@@ -199,7 +199,7 @@ t1 CREATE TABLE `t1` ( ...@@ -199,7 +199,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1; drop table t1;
# Case 14. ALTER. Changing the expression of a virtual stored column. # Case 14. ALTER. Changing the expression of a virtual stored column.
create table t1 (a int, b datetime, c int as (week(b)) persistent); create table t1 (a int, b datetime, c int as (week(b,0)) persistent);
insert into t1 values (1,'2008-09-04',default); insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default); insert into t1 values (2,'2008-09-05',default);
select * from t1; select * from t1;
...@@ -220,7 +220,7 @@ t1 CREATE TABLE `t1` ( ...@@ -220,7 +220,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1; drop table t1;
# Case 15. ALTER. Changing the expression of a virtual non-stored column. # Case 15. ALTER. Changing the expression of a virtual non-stored column.
create table t1 (a int, b datetime, c int as (week(b))); create table t1 (a int, b datetime, c int as (week(b,0)));
insert into t1 values (1,'2008-09-04',default); insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default); insert into t1 values (2,'2008-09-05',default);
select * from t1; select * from t1;
......
...@@ -199,7 +199,7 @@ t1 CREATE TABLE `t1` ( ...@@ -199,7 +199,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
# Case 14. ALTER. Changing the expression of a virtual stored column. # Case 14. ALTER. Changing the expression of a virtual stored column.
create table t1 (a int, b datetime, c int as (week(b)) persistent); create table t1 (a int, b datetime, c int as (week(b,0)) persistent);
insert into t1 values (1,'2008-09-04',default); insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default); insert into t1 values (2,'2008-09-05',default);
select * from t1; select * from t1;
...@@ -220,7 +220,7 @@ t1 CREATE TABLE `t1` ( ...@@ -220,7 +220,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
# Case 15. ALTER. Changing the expression of a virtual non-stored column. # Case 15. ALTER. Changing the expression of a virtual non-stored column.
create table t1 (a int, b datetime, c int as (week(b))); create table t1 (a int, b datetime, c int as (week(b,0)));
insert into t1 values (1,'2008-09-04',default); insert into t1 values (1,'2008-09-04',default);
insert into t1 values (2,'2008-09-05',default); insert into t1 values (2,'2008-09-05',default);
select * from t1; select * from t1;
......
...@@ -2595,12 +2595,12 @@ drop table t1; ...@@ -2595,12 +2595,12 @@ drop table t1;
set sql_warnings = 0; set sql_warnings = 0;
# WEEK() # WEEK()
set sql_warnings = 1; set sql_warnings = 1;
create table t1 (a datetime, b int as (week(a))); create table t1 (a datetime, b int as (week(a,0)));
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL, `a` datetime DEFAULT NULL,
`b` int(11) AS (week(a)) VIRTUAL `b` int(11) AS (week(a,0)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values ('2008-09-01',default); insert into t1 values ('2008-09-01',default);
select * from t1; select * from t1;
......
...@@ -2595,12 +2595,12 @@ drop table t1; ...@@ -2595,12 +2595,12 @@ drop table t1;
set sql_warnings = 0; set sql_warnings = 0;
# WEEK() # WEEK()
set sql_warnings = 1; set sql_warnings = 1;
create table t1 (a datetime, b int as (week(a))); create table t1 (a datetime, b int as (week(a,0)));
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL, `a` datetime DEFAULT NULL,
`b` int(11) AS (week(a)) VIRTUAL `b` int(11) AS (week(a,0)) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('2008-09-01',default); insert into t1 values ('2008-09-01',default);
select * from t1; select * from t1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment