1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-09 22:24:09 +03:00

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.
This commit is contained in:
Alexander Barkov
2015-09-02 11:51:07 +04:00
parent aa1002a35c
commit 4f37a861c9
6 changed files with 30 additions and 108 deletions

View File

@@ -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()));

View File

@@ -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;

View File

@@ -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'

View File

@@ -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'

View File

@@ -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))));

View File

@@ -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))));