summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc4
-rw-r--r--mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc4
-rw-r--r--mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc2
-rw-r--r--mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result3
-rw-r--r--mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result3
-rw-r--r--mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result4
9 files changed, 21 insertions, 11 deletions
diff --git a/mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc b/mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc
index 01f939337ed..8124e4df888 100644
--- a/mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc
+++ b/mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc
@@ -87,6 +87,10 @@ create table t1 (a datetime, b datetime as (utc_time()));
-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
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()
if (!$skip_full_text_checks)
{
diff --git a/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc b/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc
index 8c83586109c..5074d672ec4 100644
--- a/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc
+++ b/mysql-test/suite/vcol/inc/vcol_non_stored_columns.inc
@@ -141,7 +141,7 @@ show create table t1;
drop table t1;
--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 (2,'2008-09-05',default);
select * from t1;
@@ -151,7 +151,7 @@ show create table t1;
drop table t1;
--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 (2,'2008-09-05',default);
select * from t1;
diff --git a/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc b/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc
index 559f9ae6eaa..5d2cbc63a6d 100644
--- a/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc
+++ b/mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc
@@ -1068,7 +1068,7 @@ let $rows = 1;
--source suite/vcol/inc/vcol_supported_sql_funcs.inc
--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 $rows = 1;
--source suite/vcol/inc/vcol_supported_sql_funcs.inc
diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result
index cbb56977a93..8d453565977 100644
--- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result
@@ -54,6 +54,9 @@ ERROR HY000: Function or expression is not allowed for column 'b'
# UTC_TIMESTAMP()
create table t1 (a datetime, b datetime as (utc_timestamp()));
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()
# BENCHMARK()
create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3)));
diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result
index 757964ff9f1..d4dfc49ee32 100644
--- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result
@@ -54,6 +54,9 @@ ERROR HY000: Function or expression is not allowed for column 'b'
# UTC_TIMESTAMP()
create table t1 (a datetime, b datetime as (utc_timestamp()));
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()
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'
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 85e89f57090..76482b39d79 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
@@ -199,7 +199,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# 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 (2,'2008-09-05',default);
select * from t1;
@@ -220,7 +220,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
# 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 (2,'2008-09-05',default);
select * from 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 d73ea923a11..233f6778ca9 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
@@ -199,7 +199,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# 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 (2,'2008-09-05',default);
select * from t1;
@@ -220,7 +220,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
# 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 (2,'2008-09-05',default);
select * from t1;
diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result
index 6efdc33d9d8..899a19c68f0 100644
--- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result
@@ -2595,12 +2595,12 @@ drop table t1;
set sql_warnings = 0;
# WEEK()
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;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
- `b` int(11) AS (week(a)) VIRTUAL
+ `b` int(11) AS (week(a,0)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into t1 values ('2008-09-01',default);
select * from t1;
diff --git a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result
index 65ace7acb65..0034f25e223 100644
--- a/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result
@@ -2595,12 +2595,12 @@ drop table t1;
set sql_warnings = 0;
# WEEK()
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;
Table Create Table
t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
- `b` int(11) AS (week(a)) 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;