Debian Codegraph @

mysql-test/suite/vcol/t/not_supported.test

raw
1 #
2 # MDEV-7113 difference between check_vcol_func_processor and check_partition_func_processor
3 #
4
5 # the following functions must not be supported in persistent columns.
6 # but for compatibility reasons it won't be done in a GA version,
7 # we'll only fix most critical issues (inconsistent results, crashes)
8
9 connect (con1, localhost, root);
10
11 set lc_time_names = 'es_MX';
12 set time_zone='+10:00';
13 set div_precision_increment=20;
14
15 create table t1 (a int, b int, v decimal(20,19) as (a/3));
16 create table t2 (a int, b int, v int as (a+@a)); drop table t2;
17 --error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
18 create table t2 (a int, b int, v int as (a+@a) PERSISTENT);
19 create table t3_ok (a int, b int, v int as (a+@@error_count));
20 --error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
21 create table t3 (a int, b int, v int as (a+@@error_count) PERSISTENT);
22 create table t4 (a int, b int, v int as (@a:=a)); drop table t4;
23 --error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
24 create table t4 (a int, b int, v int as (@a:=a) PERSISTENT);
25 create table t8 (a int, b int, v varchar(100) as (from_unixtime(a)));
26
27 insert t1 (a,b) values (1,2);
28 insert t8 (a,b) values (1234567890,2);
29
30 select * from t1;
31 select * from t8;
32
33 disconnect con1;
34 connection default;
35 set time_zone='+1:00';
36 flush tables;
37
38 select * from t1;
39 select * from t8;
40
41 drop table t1, t3_ok, t8;
42
43 --echo #
44 --echo # Bug#33141966 - INCONSISTENT BEHAVIOR IF A COLUMN OF TYPE SERIAL IS SET AS GENERATED
45 --echo #
46 --error ER_PARSE_ERROR
47 create table t1 (a int, b serial as (a+1));
48
49 --echo #
50 --echo # End of 10.2 tests
51 --echo #
52
53 --error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
54 create table t1 (a int, b real as (rand()), c real as (b) stored);
55 --error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
56 create table t1 (a int, b real as (rand()), c real as (b) unique);
57 --error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
58 create table t1 (a int auto_increment primary key,
59 b int as (a+1), c int as (b+1) stored);
60 --error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
61 create table t1 (a int auto_increment primary key,
62 b int as (a+1), c int as (b+1) unique);
63
64 --echo #
65 --echo # End of 10.3 tests
66 --echo #
67
68 --echo #
69 --echo # MDEV-29155 CREATE OR REPLACE with self-referencing CHECK hangs forever, cannot be killed
70 --echo #
71 create table t1 (a int);
72 create table t2 (b int)
73 # create or replace table t (b int);
74 --error ER_SUBQUERIES_NOT_SUPPORTED
75 create table t3 (c int, check(exists(select a from t1) or exists(select b from t2)));
76 --error ER_SUBQUERIES_NOT_SUPPORTED
77 create table t3 (c int, check(exists(select c from t3)));
78 create table t3 (d int);
79 --error ER_SUBQUERIES_NOT_SUPPORTED
80 create or replace table t3 (c int, check(exists(select a from t1) or exists(select b from t2)));
81 drop table t3;
82 create table t3 (d int);
83 --error ER_SUBQUERIES_NOT_SUPPORTED
84 create or replace table t3 (c int, check(exists(select c from t3)));
85 drop table t3;
86 create table t3 (c int);
87 --error ER_SUBQUERIES_NOT_SUPPORTED
88 alter table t3 add check(exists(select a from t1) or exists(select b from t2));
89 --error ER_SUBQUERIES_NOT_SUPPORTED
90 alter table t3 add check(exists(select c from t3));
91 --error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
92 create table t3 (c int default (select a from t1));
93 --error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
94 create table t3 (c int, d int generated always as (select a from t1 limit 1));
95 drop tables t1, t2, t3;
96
97 --echo #
98 --echo # End of 10.4 tests
99 --echo #