summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-09-02 11:51:07 +0400
committerAlexander Barkov <bar@mariadb.org>2015-09-02 11:51:07 +0400
commit4f37a861c977e333f79c114cdae0e6c3b355bd45 (patch)
treecf9f9fea420d23103930690fafb37f61b300036d /mysql-test
parentaa1002a35cefcc1851cbfb6b6b60463bda6f9aa3 (diff)
downloadmariadb-git-4f37a861c977e333f79c114cdae0e6c3b355bd45.tar.gz
The fix for MDEV-8723 unintentionally broke vcol_supported_sql_funcs_myisam
and vcol_supported_sql_funcs_innodb. Moving the test for using CHARSET(), COLLATION(), COERCIBILITY() in virtual column from vcol_supported_sql_funcs_xxx to vcol_blocked_sql_funcs_xxx, as these functions are not supported in virtual columns any longer. Discussed with Sanja on IRC.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc12
-rw-r--r--mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc18
-rw-r--r--mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result9
-rw-r--r--mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result9
-rw-r--r--mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result45
-rw-r--r--mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result45
6 files changed, 30 insertions, 108 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 8124e4df888..571fe75560b 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
@@ -102,6 +102,18 @@ if (!$skip_full_text_checks)
-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3)));
+--echo # CHARSET()
+-- error ER_CONST_EXPR_IN_VCOL
+create table t1 (a varchar(64), b varchar(64) as (charset(a)));
+
+--echo # COERCIBILITY()
+-- error ER_CONST_EXPR_IN_VCOL
+create table t1 (a varchar(64), b int as (coercibility(a)));
+
+--echo # COLLATION()
+-- error ER_CONST_EXPR_IN_VCOL
+create table t1 (a varchar(64), b varchar(64) as (collation(a)));
+
--echo # CONNECTION_ID()
-- error ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
create table t1 (a int as (connection_id()));
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 5d2cbc63a6d..38f2b00a1a0 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
@@ -1142,24 +1142,6 @@ let $values1 = 5,default;
let $rows = 1;
--source suite/vcol/inc/vcol_supported_sql_funcs.inc
---echo # CHARSET()
-let $cols = a varchar(1024), b varchar(1024) as (charset(a));
-let $values1 = 'abc',default;
-let $rows = 1;
---source suite/vcol/inc/vcol_supported_sql_funcs.inc
-
---echo # COERCIBILITY()
-let $cols = a varchar(1024), b int as (coercibility(a));
-let $values1 = 'abc',default;
-let $rows = 1;
---source suite/vcol/inc/vcol_supported_sql_funcs.inc
-
---echo # COLLATION()
-let $cols = a varchar(1024), b varchar(1024) as (collation(a));
-let $values1 = 'abc',default;
-let $rows = 1;
---source suite/vcol/inc/vcol_supported_sql_funcs.inc
-
--echo # COMPRESS(), UNCOMPRESS()
let $cols = a varchar(1024), b varchar(1024) as (uncompress(compress(a)));
let $values1 = 'MySQL',default;
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 8d453565977..7f805459264 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
@@ -61,6 +61,15 @@ ERROR HY000: Function or expression is not allowed for column 'b'
# BENCHMARK()
create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3)));
ERROR HY000: Function or expression is not allowed for column 'b'
+# CHARSET()
+create table t1 (a varchar(64), b varchar(64) as (charset(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
+# COERCIBILITY()
+create table t1 (a varchar(64), b int as (coercibility(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
+# COLLATION()
+create table t1 (a varchar(64), b varchar(64) as (collation(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
# CONNECTION_ID()
create table t1 (a int as (connection_id()));
ERROR HY000: Function or expression is not allowed for column 'a'
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 d4dfc49ee32..1e1e6d6466e 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
@@ -63,6 +63,15 @@ ERROR HY000: Function or expression is not allowed for column 'b'
# BENCHMARK()
create table t1 (a varchar(1024), b varchar(1024) as (benchmark(a,3)));
ERROR HY000: Function or expression is not allowed for column 'b'
+# CHARSET()
+create table t1 (a varchar(64), b varchar(64) as (charset(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
+# COERCIBILITY()
+create table t1 (a varchar(64), b int as (coercibility(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
+# COLLATION()
+create table t1 (a varchar(64), b varchar(64) as (collation(a)));
+ERROR HY000: Constant expression in computed column function is not allowed
# CONNECTION_ID()
create table t1 (a int as (connection_id()));
ERROR HY000: Function or expression is not allowed for column 'a'
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 c2b601f8c46..f9a7e2cc65c 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
@@ -2756,51 +2756,6 @@ a b
5 2
drop table t1;
set sql_warnings = 0;
-# CHARSET()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b varchar(1024) as (charset(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` varchar(1024) AS (charset(a)) VIRTUAL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc latin1
-drop table t1;
-set sql_warnings = 0;
-# COERCIBILITY()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b int as (coercibility(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` int(11) AS (coercibility(a)) VIRTUAL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc 2
-drop table t1;
-set sql_warnings = 0;
-# COLLATION()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b varchar(1024) as (collation(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` varchar(1024) AS (collation(a)) VIRTUAL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc latin1_swedish_ci
-drop table t1;
-set sql_warnings = 0;
# COMPRESS(), UNCOMPRESS()
set sql_warnings = 1;
create table t1 (a varchar(1024), b varchar(1024) as (uncompress(compress(a))));
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 ac48c289059..184b4a441b2 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
@@ -2756,51 +2756,6 @@ a b
5 2
drop table t1;
set sql_warnings = 0;
-# CHARSET()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b varchar(1024) as (charset(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` varchar(1024) AS (charset(a)) VIRTUAL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc latin1
-drop table t1;
-set sql_warnings = 0;
-# COERCIBILITY()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b int as (coercibility(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` int(11) AS (coercibility(a)) VIRTUAL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc 2
-drop table t1;
-set sql_warnings = 0;
-# COLLATION()
-set sql_warnings = 1;
-create table t1 (a varchar(1024), b varchar(1024) as (collation(a)));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(1024) DEFAULT NULL,
- `b` varchar(1024) AS (collation(a)) VIRTUAL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-insert into t1 values ('abc',default);
-select * from t1;
-a b
-abc latin1_swedish_ci
-drop table t1;
-set sql_warnings = 0;
# COMPRESS(), UNCOMPRESS()
set sql_warnings = 1;
create table t1 (a varchar(1024), b varchar(1024) as (uncompress(compress(a))));