Skip to content

Commit

Permalink
The fix for MDEV-8723 unintentionally broke vcol_supported_sql_funcs_…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
Alexander Barkov committed Sep 2, 2015
1 parent aa1002a commit 4f37a86
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 108 deletions.
12 changes: 12 additions & 0 deletions mysql-test/suite/vcol/inc/vcol_blocked_sql_funcs_main.inc
Expand Up @@ -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()));
Expand Down
18 changes: 0 additions & 18 deletions mysql-test/suite/vcol/inc/vcol_supported_sql_funcs_main.inc
Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_innodb.result
Expand Up @@ -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'
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/suite/vcol/r/vcol_blocked_sql_funcs_myisam.result
Expand Up @@ -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'
Expand Down
45 changes: 0 additions & 45 deletions mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result
Expand Up @@ -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))));
Expand Down
45 changes: 0 additions & 45 deletions mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result
Expand Up @@ -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))));
Expand Down

0 comments on commit 4f37a86

Please sign in to comment.