Debian Codegraph @

mysql-test/suite/json/inc/sql_vs_json_greaterthanequalto.inc

raw
1 echo "Test for SQL vs JSON";
2 echo "Comparator >=";
3 echo "";
4 echo "Testcase for Tinyint";
5 #====================
6 --sorted_result
7 select
8 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tin as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
9 a._tin as side1,
10 b.col as side2,
11 JSON_TYPE(CAST(a._tin as JSON)) as side1_json_type,
12 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
13 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tin as JSON))) as side1_json_weightage,
14 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
15 a._tin >= b.col as json_compare,
16 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tin as JSON))) >=
17 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
18 from t_tin a , jj b
19 where a._tin is not NULL
20 and b.col is not NULL
21 and JSON_TYPE(CAST(a._tin as JSON))!='BLOB'
22 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
23 and ((a._tin >= b.col) != (
24 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tin as JSON)))
25 >=
26 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
27 ));
28
29
30 echo "Testcase for Boolean";
31 #=====================
32 --sorted_result
33 select
34 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._boo as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
35 a._boo as side1,
36 b.col as side2,
37 JSON_TYPE(CAST(a._boo as JSON)) as side1_json_type,
38 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
39 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._boo as JSON))) as side1_json_weightage,
40 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
41 a._boo >= b.col as json_compare,
42 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._boo as JSON))) >=
43 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
44 from t_boo a , jj b
45 where a._boo is not NULL
46 and b.col is not NULL
47 and JSON_TYPE(CAST(a._boo as JSON))!='BLOB'
48 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
49 and ((a._boo >= b.col) != (
50 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._boo as JSON)))
51 >=
52 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
53 ));
54
55 echo "Testcase for small Int Signed";
56 #==============================
57 --sorted_result
58 select
59 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._sms as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
60 a._sms as side1,
61 b.col as side2,
62 JSON_TYPE(CAST(a._sms as JSON)) as side1_json_type,
63 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
64 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._sms as JSON))) as side1_json_weightage,
65 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
66 a._sms >= b.col as json_compare,
67 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._sms as JSON))) >=
68 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
69 from t_sms a , jj b
70 where a._sms is not NULL
71 and b.col is not NULL
72 and JSON_TYPE(CAST(a._sms as JSON))!='BLOB'
73 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
74 and ((a._sms >= b.col) != (
75 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._sms as JSON)))
76 >=
77 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
78 ));
79
80
81
82 echo "Testcase for Signed Medium Int";
83 #===============================
84 --sorted_result
85 select
86 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mes as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
87 a._mes as side1,
88 b.col as side2,
89 JSON_TYPE(CAST(a._mes as JSON)) as side1_json_type,
90 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
91 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mes as JSON))) as side1_json_weightage,
92 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
93 a._mes >= b.col as json_compare,
94 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mes as JSON))) >=
95 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
96 from t_mes a , jj b
97 where a._mes is not NULL
98 and b.col is not NULL
99 and JSON_TYPE(CAST(a._mes as JSON))!='BLOB'
100 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
101 and ((a._mes >= b.col) != (
102 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mes as JSON)))
103 >=
104 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
105 ));
106
107
108 echo "Testcase for unsigned Medium Int";
109 #==================================
110 --sorted_result
111 select
112 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._meu as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
113 a._meu as side1,
114 b.col as side2,
115 JSON_TYPE(CAST(a._meu as JSON)) as side1_json_type,
116 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
117 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._meu as JSON))) as side1_json_weightage,
118 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
119 a._meu >= b.col as json_compare,
120 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._meu as JSON))) >=
121 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
122 from t_meu a , jj b
123 where a._meu is not NULL
124 and b.col is not NULL
125 and JSON_TYPE(CAST(a._meu as JSON))!='BLOB'
126 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
127 and ((a._meu >= b.col) != (
128 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._meu as JSON)))
129 >=
130 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
131 ));
132
133 echo "Testcase for signed Int";
134 #========================
135 --sorted_result
136 select
137 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ins as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
138 a._ins as side1,
139 b.col as side2,
140 JSON_TYPE(CAST(a._ins as JSON)) as side1_json_type,
141 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
142 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ins as JSON))) as side1_json_weightage,
143 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
144 a._ins >= b.col as json_compare,
145 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ins as JSON))) >=
146 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
147 from t_ins a , jj b
148 where a._ins is not NULL
149 and b.col is not NULL
150 and ((a._ins >= b.col) != (
151 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ins as JSON)))
152 >=
153 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
154 ));
155
156 echo "Testcase for Unsigned Int";
157 #========================
158 --sorted_result
159 select
160 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._inu as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
161 a._inu as side1,
162 b.col as side2,
163 JSON_TYPE(CAST(a._inu as JSON)) as side1_json_type,
164 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
165 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._inu as JSON))) as side1_json_weightage,
166 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
167 a._inu >= b.col as json_compare,
168 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._inu as JSON))) >=
169 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
170 from t_inu a , jj b
171 where a._inu is not NULL
172 and b.col is not NULL
173 and JSON_TYPE(CAST(a._inu as JSON))!='BLOB'
174 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
175 and ((a._inu >= b.col) != (
176 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._inu as JSON)))
177 >=
178 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
179 ));
180
181
182 echo "Testcase for Big Int";
183 #========================
184 --sorted_result
185 select
186 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bis as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
187 a._bis as side1,
188 b.col as side2,
189 JSON_TYPE(CAST(a._bis as JSON)) as side1_json_type,
190 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
191 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bis as JSON))) as side1_json_weightage,
192 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
193 a._bis >= b.col as json_compare,
194 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bis as JSON))) >=
195 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
196 from t_bis a , jj b
197 where a._bis is not NULL
198 and b.col is not NULL
199 and JSON_TYPE(CAST(a._bis as JSON))!='BLOB'
200 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
201 and ((a._bis >= b.col) != (
202 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bis as JSON)))
203 >=
204 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
205 ));
206
207 echo "Testcase for Big Int Unsigned";
208 #==============================
209 --sorted_result
210 select
211 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._biu as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
212 a._biu as side1,
213 b.col as side2,
214 JSON_TYPE(CAST(a._biu as JSON)) as side1_json_type,
215 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
216 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._biu as JSON))) as side1_json_weightage,
217 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
218 a._biu >= b.col as json_compare,
219 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._biu as JSON))) >=
220 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
221 from t_biu a , jj b
222 where a._biu is not NULL
223 and b.col is not NULL
224 and JSON_TYPE(CAST(a._biu as JSON))!='BLOB'
225 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
226 and ((a._biu >= b.col) != (
227 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._biu as JSON)))
228 >=
229 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
230 ));
231
232 echo "Testcase for Decimal";
233 #=====================
234 --sorted_result
235 select
236 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._dec as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
237 a._dec as side1,
238 b.col as side2,
239 JSON_TYPE(CAST(a._dec as JSON)) as side1_json_type,
240 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
241 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._dec as JSON))) as side1_json_weightage,
242 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
243 a._dec >= b.col as json_compare,
244 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._dec as JSON))) >=
245 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
246 from t_dec a , jj b
247 where a._dec is not NULL
248 and b.col is not NULL
249 and JSON_TYPE(CAST(a._dec as JSON))!='BLOB'
250 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
251 and ((a._dec >= b.col) != (
252 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._dec as JSON)))
253 >=
254 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
255 ));
256
257 echo "Testcase for Double";
258 #=====================
259 --sorted_result
260 select
261 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._dou as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
262 a._dou as side1,
263 b.col as side2,
264 JSON_TYPE(CAST(a._dou as JSON)) as side1_json_type,
265 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
266 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._dou as JSON))) as side1_json_weightage,
267 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
268 a._dou >= b.col as json_compare,
269 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._dou as JSON))) >=
270 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
271 from t_dou a , jj b
272 where a._dou is not NULL
273 and b.col is not NULL
274 and JSON_TYPE(CAST(a._dou as JSON))!='BLOB'
275 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
276 and ((a._dou >= b.col) != (
277 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._dou as JSON)))
278 >=
279 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
280 ));
281
282 echo "Testcase for CHAR";
283 #===================
284 --sorted_result
285 select
286 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._chr as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
287 a._chr as side1,
288 b.col as side2,
289 JSON_TYPE(CAST(a._chr as JSON)) as side1_json_type,
290 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
291 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._chr as JSON))) as side1_json_weightage,
292 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
293 a._chr >= b.col as json_compare,
294 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._chr as JSON))) >=
295 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
296 from t_chr a , jj b
297 where a._chr is not NULL
298 and b.col is not NULL
299 and JSON_TYPE(CAST(a._chr as JSON))!='BLOB'
300 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
301 and ((a._chr >= b.col) != (
302 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._chr as JSON)))
303 >=
304 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
305 ));
306
307 echo "Testcase for VARCHAR";
308 #=====================
309
310 --sorted_result
311 select
312 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vch as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
313 a._vch as side1,
314 b.col as side2,
315 JSON_TYPE(CAST(a._vch as JSON)) as side1_json_type,
316 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
317 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vch as JSON))) as side1_json_weightage,
318 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
319 a._vch >= b.col as json_compare,
320 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vch as JSON))) >=
321 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
322 from t_vch a , jj b
323 where a._vch is not NULL
324 and b.col is not NULL
325 and JSON_TYPE(CAST(a._vch as JSON))!='BLOB'
326 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
327 and ((a._vch >= b.col) != (
328 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vch as JSON)))
329 >=
330 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
331 ));
332
333 echo "Testcase for Binary(255)";
334 #==========================
335
336 --sorted_result
337 select
338 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bin as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
339 a._bin as side1,
340 b.col as side2,
341 JSON_TYPE(CAST(a._bin as JSON)) as side1_json_type,
342 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
343 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bin as JSON))) as side1_json_weightage,
344 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
345 a._bin >= b.col as json_compare,
346 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bin as JSON))) >=
347 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
348 from t_bin a , jj b
349 where a._bin is not NULL
350 and b.col is not NULL
351 and JSON_TYPE(CAST(a._bin as JSON))!='BLOB'
352 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
353 and ((a._bin >= b.col) != (
354 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bin as JSON)))
355 >=
356 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
357 ));
358
359
360 echo "Testcase for Variable Binary";
361 #=============================
362 --sorted_result
363 select
364 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vbn as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
365 a._vbn as side1,
366 b.col as side2,
367 JSON_TYPE(CAST(a._vbn as JSON)) as side1_json_type,
368 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
369 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vbn as JSON))) as side1_json_weightage,
370 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
371 a._vbn >= b.col as json_compare,
372 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vbn as JSON))) >=
373 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
374 from t_vbn a , jj b
375 where a._vbn is not NULL
376 and b.col is not NULL
377 and JSON_TYPE(CAST(a._vbn as JSON))!='BLOB'
378 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
379 and ((a._vbn >= b.col) != (
380 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vbn as JSON)))
381 >=
382 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
383 ));
384
385 echo "Testcase for TinyBlob";
386 #======================
387 --sorted_result
388 select
389 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tbl as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
390 a._tbl as side1,
391 b.col as side2,
392 JSON_TYPE(CAST(a._tbl as JSON)) as side1_json_type,
393 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
394 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tbl as JSON))) as side1_json_weightage,
395 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
396 a._tbl >= b.col as json_compare,
397 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tbl as JSON))) >=
398 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
399 from t_tbl a , jj b
400 where a._tbl is not NULL
401 and b.col is not NULL
402 and JSON_TYPE(CAST(a._tbl as JSON))!='BLOB'
403 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
404 and ((a._tbl >= b.col) != (
405 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tbl as JSON)))
406 >=
407 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
408 ));
409
410 echo "Testcase for TinyText";
411 #======================
412 --sorted_result
413 select
414 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ttx as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
415 a._ttx as side1,
416 b.col as side2,
417 JSON_TYPE(CAST(a._ttx as JSON)) as side1_json_type,
418 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
419 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ttx as JSON))) as side1_json_weightage,
420 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
421 a._ttx >= b.col as json_compare,
422 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ttx as JSON))) >=
423 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
424 from t_ttx a , jj b
425 where a._ttx is not NULL
426 and b.col is not NULL
427 and JSON_TYPE(CAST(a._ttx as JSON))!='BLOB'
428 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
429 and ((a._ttx >= b.col) != (
430 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ttx as JSON)))
431 >=
432 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
433 ));
434
435 echo "Testcase for Blob";
436 #======================
437 --sorted_result
438 select
439 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._blb as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
440 a._blb as side1,
441 b.col as side2,
442 JSON_TYPE(CAST(a._blb as JSON)) as side1_json_type,
443 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
444 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._blb as JSON))) as side1_json_weightage,
445 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
446 a._blb >= b.col as json_compare,
447 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._blb as JSON))) >=
448 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
449 from t_blb a , jj b
450 where a._blb is not NULL
451 and b.col is not NULL
452 and JSON_TYPE(CAST(a._blb as JSON))!='BLOB'
453 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
454 and ((a._blb >= b.col) != (
455 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._blb as JSON)))
456 >=
457 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
458 ));
459
460
461 echo "Testcase for Text";
462 #======================
463 --sorted_result
464 select
465 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._txt as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
466 a._txt as side1,
467 b.col as side2,
468 JSON_TYPE(CAST(a._txt as JSON)) as side1_json_type,
469 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
470 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._txt as JSON))) as side1_json_weightage,
471 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
472 a._txt >= b.col as json_compare,
473 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._txt as JSON))) >=
474 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
475 from t_txt a , jj b
476 where a._txt is not NULL
477 and b.col is not NULL
478 and JSON_TYPE(CAST(a._txt as JSON))!='BLOB'
479 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
480 and ((a._txt >= b.col) != (
481 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._txt as JSON)))
482 >=
483 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
484 ));
485
486 echo "Testcase for Medium Blob";
487 #=========================
488 --sorted_result
489 select
490 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mbb as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
491 a._mbb as side1,
492 b.col as side2,
493 JSON_TYPE(CAST(a._mbb as JSON)) as side1_json_type,
494 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
495 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mbb as JSON))) as side1_json_weightage,
496 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
497 a._mbb >= b.col as json_compare,
498 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mbb as JSON))) >=
499 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
500 from t_mbb a , jj b
501 where a._mbb is not NULL
502 and b.col is not NULL
503 and JSON_TYPE(CAST(a._mbb as JSON))!='BLOB'
504 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
505 and ((a._mbb >= b.col) != (
506 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mbb as JSON)))
507 >=
508 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
509 ));
510
511 echo "Testcase for Medium Text";
512 #=========================
513 --sorted_result
514 select
515 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mtx as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
516 a._mtx as side1,
517 b.col as side2,
518 JSON_TYPE(CAST(a._mtx as JSON)) as side1_json_type,
519 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
520 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mtx as JSON))) as side1_json_weightage,
521 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
522 a._mtx >= b.col as json_compare,
523 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mtx as JSON))) >=
524 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
525 from t_mtx a , jj b
526 where a._mtx is not NULL
527 and b.col is not NULL
528 and JSON_TYPE(CAST(a._mtx as JSON))!='BLOB'
529 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
530 and ((a._mtx >= b.col) != (
531 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mtx as JSON)))
532 >=
533 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
534 ));
535
536 echo "Testcase for Long Blob";
537 #=========================
538 --sorted_result
539 select
540 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._lbb as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
541 a._lbb as side1,
542 b.col as side2,
543 JSON_TYPE(CAST(a._lbb as JSON)) as side1_json_type,
544 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
545 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._lbb as JSON))) as side1_json_weightage,
546 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
547 a._lbb >= b.col as json_compare,
548 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._lbb as JSON))) >=
549 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
550 from t_lbb a , jj b
551 where a._lbb is not NULL
552 and b.col is not NULL
553 and JSON_TYPE(CAST(a._lbb as JSON))!='BLOB'
554 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
555 and ((a._lbb >= b.col) != (
556 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._lbb as JSON)))
557 >=
558 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
559 ));
560
561 echo "Testcase for Long Text";
562 #=========================
563 --sorted_result
564 select
565 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ltx as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
566 a._ltx as side1,
567 b.col as side2,
568 JSON_TYPE(CAST(a._ltx as JSON)) as side1_json_type,
569 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
570 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ltx as JSON))) as side1_json_weightage,
571 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
572 a._ltx >= b.col as json_compare,
573 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ltx as JSON))) >=
574 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
575 from t_ltx a , jj b
576 where a._ltx is not NULL
577 and b.col is not NULL
578 and JSON_TYPE(CAST(a._ltx as JSON))!='BLOB'
579 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
580 and ((a._ltx >= b.col) != (
581 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ltx as JSON)))
582 >=
583 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
584 ));
585
586 echo "Testcase for Enum";
587 #==================
588 --sorted_result
589 select
590 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._enu as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
591 a._enu as side1,
592 b.col as side2,
593 JSON_TYPE(CAST(a._enu as JSON)) as side1_json_type,
594 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
595 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._enu as JSON))) as side1_json_weightage,
596 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
597 a._enu >= b.col as json_compare,
598 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._enu as JSON))) >=
599 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
600 from t_enu a , jj b
601 where a._enu is not NULL
602 and b.col is not NULL
603 and JSON_TYPE(CAST(a._enu as JSON))!='BLOB'
604 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
605 and ((a._enu >= b.col) != (
606 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._enu as JSON)))
607 >=
608 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
609 ));
610
611 echo "Testcase for Set";
612 #==================
613 --sorted_result
614 select
615 IF(GET_JSON_WEIGHT(JSON_TYPE(CAST(a._set as JSON)))=GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))),'2nd Level','1st Level') validation_stage,
616 a._set as side1,
617 b.col as side2,
618 JSON_TYPE(CAST(a._set as JSON)) as side1_json_type,
619 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
620 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._set as JSON))) as side1_json_weightage,
621 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
622 a._set >= b.col as json_compare,
623 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._set as JSON))) >=
624 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
625 from t_set a , jj b
626 where a._set is not NULL
627 and b.col is not NULL
628 and JSON_TYPE(CAST(a._set as JSON))!='BLOB'
629 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
630 and ((a._set >= b.col) != (
631 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._set as JSON)))
632 >=
633 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
634 ));