Debian Codegraph @

mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result

raw
1 SET @@session.default_storage_engine = 'InnoDB';
2 create or replace table t1 (b double generated always as (rand()) virtual);
3 create or replace table t1 (a datetime generated always as (curdate()) virtual);
4 create or replace table t1 (a datetime generated always as (current_date) virtual);
5 create or replace table t1 (a datetime generated always as (current_date()) virtual);
6 create or replace table t1 (a datetime generated always as (current_time) virtual);
7 create or replace table t1 (a datetime generated always as (current_time()) virtual);
8 create or replace table t1 (a datetime generated always as (current_timestamp()) virtual);
9 create or replace table t1 (a datetime generated always as (current_timestamp) virtual);
10 create or replace table t1 (a datetime generated always as (curtime()) virtual);
11 create or replace table t1 (a datetime, b varchar(10) generated always as (localtime()) virtual);
12 create or replace table t1 (a datetime, b varchar(10) generated always as (localtime) virtual);
13 create or replace table t1 (a datetime, b varchar(10) generated always as (localtimestamp()) virtual);
14 create or replace table t1 (a datetime, b varchar(10) generated always as (localtimestamp) virtual);
15 create or replace table t1 (a datetime, b varchar(10) generated always as (now()) virtual);
16 create or replace table t1 (a int, b varchar(10) generated always as (sysdate()) virtual);
17 create or replace table t1 (a datetime, b datetime generated always as (unix_timestamp()) virtual);
18 create or replace table t1 (a datetime, b datetime generated always as (utc_date()) virtual);
19 create or replace table t1 (a datetime, b datetime generated always as (utc_time()) virtual);
20 create or replace table t1 (a datetime, b datetime generated always as (utc_timestamp()) virtual);
21 create or replace table t1 (a int generated always as (connection_id()) virtual);
22 create or replace table t1 (a varchar(32) generated always as (current_user()) virtual);
23 create or replace table t1 (a varchar(32) generated always as (current_user) virtual);
24 create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (database()) virtual);
25 create or replace table t1 (a varchar(32) generated always as (schema()) virtual);
26 create or replace table t1 (a varchar(32) generated always as (session_user()) virtual);
27 create or replace table t1 (a varchar(32) generated always as (system_user()) virtual);
28 create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (user()) virtual);
29 create or replace table t1 (a varchar(1024) generated always as (uuid_short()) virtual);
30 create or replace table t1 (a varchar(1024) generated always as (uuid()) virtual);
31 create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (version()) virtual);
32 create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (encrypt(a)) virtual);
33 create or replace table t1 (a varchar(1024), b varchar(1024) generated always as (UpdateXML(a,'/a','<e>fff</e>')) virtual);
34 drop table t1;
35 # LOAD_FILE()
36 create table t1 (a varchar(64), b varchar(1024) generated always as (load_file(a)) virtual);
37 ERROR HY000: Function or expression 'load_file()' cannot be used in the GENERATED ALWAYS AS clause of `b`
38 # MATCH()
39 # BENCHMARK()
40 create table t1 (a varchar(1024), b varchar(1024) generated always as (benchmark(a,3)) virtual);
41 ERROR HY000: Function or expression 'benchmark()' cannot be used in the GENERATED ALWAYS AS clause of `b`
42 # FOUND_ROWS()
43 create table t1 (a varchar(1024), b varchar(1024) generated always as (found_rows()) virtual);
44 ERROR HY000: Function or expression 'found_rows()' cannot be used in the GENERATED ALWAYS AS clause of `b`
45 # GET_LOCK()
46 create table t1 (a varchar(1024), b varchar(1024) generated always as (get_lock(a,10)) virtual);
47 ERROR HY000: Function or expression 'get_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b`
48 # IS_FREE_LOCK()
49 create table t1 (a varchar(1024), b varchar(1024) generated always as (is_free_lock(a)) virtual);
50 ERROR HY000: Function or expression 'is_free_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b`
51 # IS_USED_LOCK()
52 create table t1 (a varchar(1024), b varchar(1024) generated always as (is_used_lock(a)) virtual);
53 ERROR HY000: Function or expression 'is_used_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b`
54 # LAST_INSERT_ID()
55 create table t1 (a int generated always as (last_insert_id()) virtual);
56 ERROR HY000: Function or expression 'last_insert_id()' cannot be used in the GENERATED ALWAYS AS clause of `a`
57 # MASTER_POS_WAIT()
58 create table t1 (a varchar(32), b int generated always as (master_pos_wait(a,0,2)) virtual);
59 ERROR HY000: Function or expression 'master_pos_wait()' cannot be used in the GENERATED ALWAYS AS clause of `b`
60 # NAME_CONST()
61 create table t1 (a varchar(32) generated always as (name_const('test',1)) virtual);
62 ERROR HY000: Function or expression 'name_const()' cannot be used in the GENERATED ALWAYS AS clause of `a`
63 # RELEASE_LOCK()
64 create table t1 (a varchar(32), b int generated always as (release_lock(a)) virtual);
65 ERROR HY000: Function or expression 'release_lock()' cannot be used in the GENERATED ALWAYS AS clause of `b`
66 # ROW_COUNT()
67 create table t1 (a int generated always as (row_count()) virtual);
68 ERROR HY000: Function or expression 'row_count()' cannot be used in the GENERATED ALWAYS AS clause of `a`
69 # SLEEP()
70 create table t1 (a int, b int generated always as (sleep(a)) virtual);
71 ERROR HY000: Function or expression 'sleep()' cannot be used in the GENERATED ALWAYS AS clause of `b`
72 # VALUES()
73 create table t1 (a varchar(1024), b varchar(1024) generated always as (value(a)) virtual);
74 ERROR HY000: Function or expression 'value()' cannot be used in the GENERATED ALWAYS AS clause of `b`
75 # Stored procedures
76 create procedure p1()
77 begin
78 select current_user();
79 end //
80 create function f1()
81 returns int
82 begin
83 return 1;
84 end //
85 create table t1 (a int generated always as (p1()) virtual);
86 ERROR HY000: Function or expression '`p1`()' cannot be used in the GENERATED ALWAYS AS clause of `a`
87 create table t1 (a int generated always as (f1()) virtual);
88 ERROR HY000: Function or expression '`f1`()' cannot be used in the GENERATED ALWAYS AS clause of `a`
89 drop procedure p1;
90 drop function f1;
91 # Unknown functions
92 create table t1 (a int generated always as (f1()) virtual);
93 ERROR HY000: Function or expression '`f1`()' cannot be used in the GENERATED ALWAYS AS clause of `a`
94 #
95 # GROUP BY FUNCTIONS
96 #
97 # AVG()
98 create table t1 (a int, b int generated always as (avg(a)) virtual);
99 ERROR HY000: Function or expression 'avg()' cannot be used in the GENERATED ALWAYS AS clause of `b`
100 # BIT_AND()
101 create table t1 (a int, b int generated always as (bit_and(a)) virtual);
102 ERROR HY000: Function or expression 'bit_and()' cannot be used in the GENERATED ALWAYS AS clause of `b`
103 # BIT_OR()
104 create table t1 (a int, b int generated always as (bit_or(a)) virtual);
105 ERROR HY000: Function or expression 'bit_or()' cannot be used in the GENERATED ALWAYS AS clause of `b`
106 # BIT_XOR()
107 create table t1 (a int, b int generated always as (bit_xor(a)) virtual);
108 ERROR HY000: Function or expression 'bit_xor()' cannot be used in the GENERATED ALWAYS AS clause of `b`
109 # COUNT(DISTINCT)
110 create table t1 (a int, b int generated always as (count(distinct a)) virtual);
111 ERROR HY000: Function or expression 'count(distinct )' cannot be used in the GENERATED ALWAYS AS clause of `b`
112 # COUNT()
113 create table t1 (a int, b int generated always as (count(a)) virtual);
114 ERROR HY000: Function or expression 'count()' cannot be used in the GENERATED ALWAYS AS clause of `b`
115 # GROUP_CONCAT()
116 create table t1 (a varchar(32), b int generated always as (group_concat(a,'')) virtual);
117 ERROR HY000: Function or expression 'group_concat()' cannot be used in the GENERATED ALWAYS AS clause of `b`
118 # MAX()
119 create table t1 (a int, b int generated always as (max(a)) virtual);
120 ERROR HY000: Function or expression 'max()' cannot be used in the GENERATED ALWAYS AS clause of `b`
121 # MIN()
122 create table t1 (a int, b int generated always as (min(a)) virtual);
123 ERROR HY000: Function or expression 'min()' cannot be used in the GENERATED ALWAYS AS clause of `b`
124 # STD()
125 create table t1 (a int, b int generated always as (std(a)) virtual);
126 ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b`
127 # STDDEV_POP()
128 create table t1 (a int, b int generated always as (stddev_pop(a)) virtual);
129 ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b`
130 # STDDEV_SAMP()
131 create table t1 (a int, b int generated always as (stddev_samp(a)) virtual);
132 ERROR HY000: Function or expression 'stddev_samp()' cannot be used in the GENERATED ALWAYS AS clause of `b`
133 # STDDEV()
134 create table t1 (a int, b int generated always as (stddev(a)) virtual);
135 ERROR HY000: Function or expression 'std()' cannot be used in the GENERATED ALWAYS AS clause of `b`
136 # SUM()
137 create table t1 (a int, b int generated always as (sum(a)) virtual);
138 ERROR HY000: Function or expression 'sum()' cannot be used in the GENERATED ALWAYS AS clause of `b`
139 # VAR_POP()
140 create table t1 (a int, b int generated always as (var_pop(a)) virtual);
141 ERROR HY000: Function or expression 'variance()' cannot be used in the GENERATED ALWAYS AS clause of `b`
142 # VAR_SAMP()
143 create table t1 (a int, b int generated always as (var_samp(a)) virtual);
144 ERROR HY000: Function or expression 'var_samp()' cannot be used in the GENERATED ALWAYS AS clause of `b`
145 # VARIANCE()
146 create table t1 (a int, b int generated always as (variance(a)) virtual);
147 ERROR HY000: Function or expression 'variance()' cannot be used in the GENERATED ALWAYS AS clause of `b`
148 #
149 # Sub-selects
150 #
151 create table t1 (a int);
152 create table t2 (a int, b int generated always as (select count(*) virtual from t1));
153 ERROR HY000: Function or expression 'select ...' cannot be used in the GENERATED ALWAYS AS clause of `b`
154 drop table t1;
155 #
156 # Long expression
157 create table t1 (a int, b varchar(300) generated always as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')) virtual);
158 drop table t1;
159 create table t1 (a int, b varchar(300) generated always as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')) virtual);
160 drop table t1;
161 #
162 # Constant expression
163 create table t1 (a int generated always as (PI()) virtual);
164 drop table t1;
165 # bug#21098119: GCOL WITH MATCH/AGAINST -->
166 # ASSERTION FAILED: TR && TR->TABLE->FILE
167 #
168 create table t1 (a int);
169 alter table t1 add column r blob generated always
170 as (match(a) against ('' in boolean mode)) virtual;
171 ERROR HY000: Function or expression 'match ... against()' cannot be used in the GENERATED ALWAYS AS clause of `r`
172 drop table t1;
173 #
174 # End of 10.3 tests
175 #
176 #
177 # MDEV-29029 Index corruption and/or assertion failure upon using RANDOM_BYTES for indexed virtual column
178 #
179 create table t1 (a int);
180 insert t1 values (1);
181 alter table t1 add column b binary(32) generated always as (random_bytes(a));
182 select a,length(b) from t1;
183 a length(b)
184 1 32
185 alter table t1 add index (b);
186 ERROR HY000: Function or expression 'random_bytes()' cannot be used in the GENERATED ALWAYS AS clause of `b`
187 alter table t1 add column c binary(32) default (random_bytes(a));
188 select a,length(b),length(c) from t1;
189 a length(b) length(c)
190 1 32 32
191 drop table t1;
192 #
193 #
194 # End of 10.10 tests
195 #
196 DROP VIEW IF EXISTS v1,v2;
197 DROP TABLE IF EXISTS t1,t2,t3;
198 DROP PROCEDURE IF EXISTS p1;
199 DROP FUNCTION IF EXISTS f1;
200 DROP TRIGGER IF EXISTS trg1;
201 DROP TRIGGER IF EXISTS trg2;
202 set sql_warnings = 0;