Debian Codegraph @

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

raw
1 SET @@session.default_storage_engine = 'MyISAM';
2 # RAND()
3 create table t1 (b double generated always as (rand()) virtual);
4 ERROR HY000: Expression of generated column 'b' contains a disallowed function: rand.
5 # LOAD_FILE()
6 create table t1 (a varchar(64), b varchar(1024) generated always as (load_file(a)) virtual);
7 ERROR HY000: Expression of generated column 'b' contains a disallowed function: load_file.
8 # CURDATE()
9 create table t1 (a datetime generated always as (curdate()) virtual);
10 ERROR HY000: Expression of generated column 'a' contains a disallowed function: curdate.
11 # CURRENT_DATE(), CURRENT_DATE
12 create table t1 (a datetime generated always as (current_date) virtual);
13 ERROR HY000: Expression of generated column 'a' contains a disallowed function: curdate.
14 create table t1 (a datetime generated always as (current_date()) virtual);
15 ERROR HY000: Expression of generated column 'a' contains a disallowed function: curdate.
16 # CURRENT_TIME(), CURRENT_TIME
17 create table t1 (a datetime generated always as (current_time) virtual);
18 ERROR HY000: Expression of generated column 'a' contains a disallowed function: curtime.
19 create table t1 (a datetime generated always as (current_time()) virtual);
20 ERROR HY000: Expression of generated column 'a' contains a disallowed function: curtime.
21 # CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP
22 create table t1 (a datetime generated always as (current_timestamp()) virtual);
23 ERROR HY000: Expression of generated column 'a' contains a disallowed function: now.
24 create table t1 (a datetime generated always as (current_timestamp) virtual);
25 ERROR HY000: Expression of generated column 'a' contains a disallowed function: now.
26 # CURTIME()
27 create table t1 (a datetime generated always as (curtime()) virtual);
28 ERROR HY000: Expression of generated column 'a' contains a disallowed function: curtime.
29 # LOCALTIME(), LOCALTIME
30 create table t1 (a datetime, b varchar(10) generated always as (localtime()) virtual);
31 ERROR HY000: Expression of generated column 'b' contains a disallowed function: now.
32 create table t1 (a datetime, b varchar(10) generated always as (localtime) virtual);
33 ERROR HY000: Expression of generated column 'b' contains a disallowed function: now.
34 # LOCALTIMESTAMP, LOCALTIMESTAMP()(v4.0.6)
35 create table t1 (a datetime, b varchar(10) generated always as (localtimestamp()) virtual);
36 ERROR HY000: Expression of generated column 'b' contains a disallowed function: now.
37 create table t1 (a datetime, b varchar(10) generated always as (localtimestamp) virtual);
38 ERROR HY000: Expression of generated column 'b' contains a disallowed function: now.
39 # NOW()
40 create table t1 (a datetime, b varchar(10) generated always as (now()) virtual);
41 ERROR HY000: Expression of generated column 'b' contains a disallowed function: now.
42 # STATEMENT_DIGEST
43 create table t1 (a int, b int generated always as (statement_digest(a)) virtual);
44 ERROR HY000: Expression of generated column 'b' contains a disallowed function: statement_digest.
45 # STATEMENT_DIGEST_TEXT
46 create table t1 (a int, b int generated always as (statement_digest_text(a)) virtual);
47 ERROR HY000: Expression of generated column 'b' contains a disallowed function: statement_digest_text.
48 # SYSDATE()
49 create table t1 (a int, b varchar(10) generated always as (sysdate()) virtual);
50 ERROR HY000: Expression of generated column 'b' contains a disallowed function: sysdate.
51 # UNIX_TIMESTAMP()
52 create table t1 (a datetime, b datetime generated always as (unix_timestamp()) virtual);
53 ERROR HY000: Expression of generated column 'b' contains a disallowed function: unix_timestamp.
54 # UTC_DATE()
55 create table t1 (a datetime, b datetime generated always as (utc_date()) virtual);
56 ERROR HY000: Expression of generated column 'b' contains a disallowed function: utc_date.
57 # UTC_TIME()
58 create table t1 (a datetime, b datetime generated always as (utc_time()) virtual);
59 ERROR HY000: Expression of generated column 'b' contains a disallowed function: utc_time.
60 # UTC_TIMESTAMP()
61 create table t1 (a datetime, b datetime generated always as (utc_timestamp()) virtual);
62 ERROR HY000: Expression of generated column 'b' contains a disallowed function: utc_timestamp.
63 # MATCH()
64 create table t1 (a varchar(32), b bool generated always as (match a against ('sample text')) virtual);
65 ERROR HY000: Expression of generated column 'b' contains a disallowed function: match.
66 # BENCHMARK()
67 create table t1 (a varchar(1024), b varchar(1024) generated always as (benchmark(a,3)) virtual);
68 ERROR HY000: Expression of generated column 'b' contains a disallowed function: benchmark.
69 # CONNECTION_ID()
70 create table t1 (a int generated always as (connection_id()) virtual);
71 ERROR HY000: Expression of generated column 'a' contains a disallowed function: connection_id.
72 # CURRENT_USER(), CURRENT_USER
73 create table t1 (a varchar(32) generated always as (current_user()) virtual);
74 ERROR HY000: Expression of generated column 'a' contains a disallowed function: current_user.
75 create table t1 (a varchar(32) generated always as (current_user) virtual);
76 ERROR HY000: Expression of generated column 'a' contains a disallowed function: current_user.
77 # DATABASE()
78 create table t1 (a varchar(1024), b varchar(1024) generated always as (database()) virtual);
79 ERROR HY000: Expression of generated column 'b' contains a disallowed function: database.
80 # FOUND_ROWS()
81 create table t1 (a varchar(1024), b varchar(1024) generated always as (found_rows()) virtual);
82 ERROR HY000: Expression of generated column 'b' contains a disallowed function: found_rows.
83 # GET_LOCK()
84 create table t1 (a varchar(1024), b varchar(1024) generated always as (get_lock(a,10)) virtual);
85 ERROR HY000: Expression of generated column 'b' contains a disallowed function: get_lock.
86 # IS_FREE_LOCK()
87 create table t1 (a varchar(1024), b varchar(1024) generated always as (is_free_lock(a)) virtual);
88 ERROR HY000: Expression of generated column 'b' contains a disallowed function: is_free_lock.
89 # IS_USED_LOCK()
90 create table t1 (a varchar(1024), b varchar(1024) generated always as (is_used_lock(a)) virtual);
91 ERROR HY000: Expression of generated column 'b' contains a disallowed function: is_used_lock.
92 # LAST_INSERT_ID()
93 create table t1 (a int generated always as (last_insert_id()) virtual);
94 ERROR HY000: Expression of generated column 'a' contains a disallowed function: last_insert_id.
95 # SOURCE_POS_WAIT()
96 create table t1 (a varchar(32), b int generated always as (source_pos_wait(a,0,2)) virtual);
97 ERROR HY000: Expression of generated column 'b' contains a disallowed function: source_pos_wait.
98 # NAME_CONST()
99 create table t1 (a varchar(32) generated always as (name_const('test',1)) virtual);
100 ERROR HY000: Expression of generated column 'a' contains a disallowed function.
101 # RELEASE_LOCK()
102 create table t1 (a varchar(32), b int generated always as (release_lock(a)) virtual);
103 ERROR HY000: Expression of generated column 'b' contains a disallowed function: release_lock.
104 # ROW_COUNT()
105 create table t1 (a int generated always as (row_count()) virtual);
106 ERROR HY000: Expression of generated column 'a' contains a disallowed function: row_count.
107 # SCHEMA()
108 create table t1 (a varchar(32) generated always as (schema()) virtual);
109 ERROR HY000: Expression of generated column 'a' contains a disallowed function: database.
110 # SESSION_USER()
111 create table t1 (a varchar(32) generated always as (session_user()) virtual);
112 ERROR HY000: Expression of generated column 'a' contains a disallowed function: user.
113 # SLEEP()
114 create table t1 (a int, b int generated always as (sleep(a)) virtual);
115 ERROR HY000: Expression of generated column 'b' contains a disallowed function: sleep.
116 # SYSTEM_USER()
117 create table t1 (a varchar(32) generated always as (system_user()) virtual);
118 ERROR HY000: Expression of generated column 'a' contains a disallowed function: user.
119 # USER()
120 create table t1 (a varchar(1024), b varchar(1024) generated always as (user()) virtual);
121 ERROR HY000: Expression of generated column 'b' contains a disallowed function: user.
122 # UUID_SHORT()
123 create table t1 (a varchar(1024) generated always as (uuid_short()) virtual);
124 ERROR HY000: Expression of generated column 'a' contains a disallowed function: uuid_short.
125 # UUID()
126 create table t1 (a varchar(1024) generated always as (uuid()) virtual);
127 ERROR HY000: Expression of generated column 'a' contains a disallowed function: uuid.
128 # VALUES()
129 create table t1 (a varchar(1024), b varchar(1024) generated always as (values(a)) virtual);
130 ERROR HY000: Expression of generated column 'b' contains a disallowed function: values.
131 # VERSION()
132 create table t1 (a varchar(1024), b varchar(1024) generated always as (version()) virtual);
133 ERROR HY000: Expression of generated column 'b' contains a disallowed function: version().
134 # ENCRYPT()
135 create table t1 (a varchar(1024), b varchar(1024) generated always as (encrypt(a)) virtual);
136 ERROR HY000: Expression of generated column 'b' contains a disallowed function: `encrypt`.
137 # Stored procedures
138 create procedure p1()
139 begin
140 select current_user();
141 end //
142 create function f1()
143 returns int
144 begin
145 return 1;
146 end //
147 create table t1 (a int generated always as (p1()) virtual);
148 ERROR HY000: Expression of generated column 'a' contains a disallowed function: `p1`.
149 create table t1 (a int generated always as (f1()) virtual);
150 ERROR HY000: Expression of generated column 'a' contains a disallowed function: `f1`.
151 drop procedure p1;
152 drop function f1;
153 # Unknown functions
154 create table t1 (a int generated always as (f1()) virtual);
155 ERROR HY000: Expression of generated column 'a' contains a disallowed function: `f1`.
156 #
157 # GROUP BY FUNCTIONS
158 #
159 # AVG()
160 create table t1 (a int, b int generated always as (avg(a)) virtual);
161 ERROR HY000: Invalid use of group function
162 # BIT_AND()
163 create table t1 (a int, b int generated always as (bit_and(a)) virtual);
164 ERROR HY000: Invalid use of group function
165 # BIT_OR()
166 create table t1 (a int, b int generated always as (bit_or(a)) virtual);
167 ERROR HY000: Invalid use of group function
168 # BIT_XOR()
169 create table t1 (a int, b int generated always as (bit_xor(a)) virtual);
170 ERROR HY000: Invalid use of group function
171 # COUNT(DISTINCT)
172 create table t1 (a int, b int generated always as (count(distinct a)) virtual);
173 ERROR HY000: Invalid use of group function
174 # COUNT()
175 create table t1 (a int, b int generated always as (count(a)) virtual);
176 ERROR HY000: Invalid use of group function
177 # GROUP_CONCAT()
178 create table t1 (a varchar(32), b int generated always as (group_concat(a,'')) virtual);
179 ERROR HY000: Invalid use of group function
180 # MAX()
181 create table t1 (a int, b int generated always as (max(a)) virtual);
182 ERROR HY000: Invalid use of group function
183 # MIN()
184 create table t1 (a int, b int generated always as (min(a)) virtual);
185 ERROR HY000: Invalid use of group function
186 # STD()
187 create table t1 (a int, b int generated always as (std(a)) virtual);
188 ERROR HY000: Invalid use of group function
189 # STDDEV_POP()
190 create table t1 (a int, b int generated always as (stddev_pop(a)) virtual);
191 ERROR HY000: Invalid use of group function
192 # STDDEV_SAMP()
193 create table t1 (a int, b int generated always as (stddev_samp(a)) virtual);
194 ERROR HY000: Invalid use of group function
195 # STDDEV()
196 create table t1 (a int, b int generated always as (stddev(a)) virtual);
197 ERROR HY000: Invalid use of group function
198 # SUM()
199 create table t1 (a int, b int generated always as (sum(a)) virtual);
200 ERROR HY000: Invalid use of group function
201 # VAR_POP()
202 create table t1 (a int, b int generated always as (var_pop(a)) virtual);
203 ERROR HY000: Invalid use of group function
204 # VAR_SAMP()
205 create table t1 (a int, b int generated always as (var_samp(a)) virtual);
206 ERROR HY000: Invalid use of group function
207 # VARIANCE()
208 create table t1 (a int, b int generated always as (variance(a)) virtual);
209 ERROR HY000: Invalid use of group function
210 #
211 # XML FUNCTIONS
212 #
213 # UpdateXML()
214 create table t1 (a varchar(1024), b varchar(1024) generated always as (UpdateXML(a,'/a','<e>fff</e>')) virtual);
215 ERROR HY000: Expression of generated column 'b' contains a disallowed function: updatexml.
216 #
217 # Sub-selects
218 #
219 create table t1 (a int);
220 create table t2 (a int, b int generated always as (select count(*) virtual from t1));
221 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(*) virtual from t1))' at line 1
222 drop table t1;
223 #
224 # Long expression
225 create table t1 (a int, b varchar(300) generated always as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')) virtual);
226 drop table t1;
227 create table t1 (a int, b varchar(300) generated always as (concat(a,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')) virtual);
228 drop table t1;
229 #
230 # Constant expression
231 create table t1 (a int generated always as (PI()) virtual);
232 drop table t1;
233 # bug#21098119: GCOL WITH MATCH/AGAINST -->
234 # ASSERTION FAILED: TR && TR->TABLE->FILE
235 #
236 create table t1 (a int);
237 alter table t1 add column r blob generated always
238 as (match(a) against ('' in boolean mode)) virtual;
239 ERROR HY000: Expression of generated column 'r' contains a disallowed function: match.
240 drop table t1;
241 #
242 # Bug#26279884 : VIRTUAL COLUMNS ALLOW DEPRECATED FUNCTION TO BE USED
243 #
244 # JSON_MERGE()
245 CREATE TABLE t2(a JSON, b JSON, c JSON GENERATED ALWAYS AS (JSON_MERGE(a,b)));
246 ERROR HY000: Expression of generated column 'c' contains a disallowed function: json_merge_preserve.
247 #
248 # Bug#29342245 ASSERTION WHEN CREATING A FUNCTIONAL INDEX ON A SUBQUERY WITH UNION
249 #
250 CREATE TABLE t1 (x INT);
251 CREATE TABLE t2 (y INT, z INT AS ((SELECT 1 FROM t1 UNION SELECT 1 FROM t1)));
252 ERROR HY000: Expression of generated column 'z' contains a disallowed function.
253 DROP TABLE t1;
254 DROP VIEW IF EXISTS v1,v2;
255 DROP TABLE IF EXISTS t1,t2,t3;
256 DROP PROCEDURE IF EXISTS p1;
257 DROP FUNCTION IF EXISTS f1;
258 DROP TRIGGER IF EXISTS trg1;
259 DROP TRIGGER IF EXISTS trg2;
260 set sql_warnings = 0;