Debian Codegraph @

mysql-test/suite/json/inc/sql_vs_json_equalto.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
283 echo "Testcase for CHAR";
284 #===================
285 --sorted_result
286 select
287 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,
288 a._chr as side1,
289 b.col as side2,
290 JSON_TYPE(CAST(a._chr as JSON)) as side1_json_type,
291 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
292 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._chr as JSON))) as side1_json_weightage,
293 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
294 a._chr = b.col as json_compare,
295 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._chr as JSON))) =
296 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
297 from t_chr a , jj b
298 where a._chr is not NULL
299 and b.col is not NULL
300 and JSON_TYPE(CAST(a._chr as JSON))!='BLOB'
301 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
302 and ((a._chr = b.col) != (
303 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._chr as JSON)))
304 =
305 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
306 ));
307
308 echo "Testcase for VARCHAR";
309 #=====================
310
311 --sorted_result
312 select
313 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,
314 a._vch as side1,
315 b.col as side2,
316 JSON_TYPE(CAST(a._vch as JSON)) as side1_json_type,
317 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
318 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vch as JSON))) as side1_json_weightage,
319 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
320 a._vch = b.col as json_compare,
321 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vch as JSON))) =
322 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
323 from t_vch a , jj b
324 where a._vch is not NULL
325 and b.col is not NULL
326 and JSON_TYPE(CAST(a._vch as JSON))!='BLOB'
327 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
328 and ((a._vch = b.col) != (
329 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vch as JSON)))
330 =
331 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
332 ));
333
334 echo "Testcase for Binary(255)";
335 #==========================
336
337 --sorted_result
338 select
339 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,
340 a._bin as side1,
341 b.col as side2,
342 JSON_TYPE(CAST(a._bin as JSON)) as side1_json_type,
343 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
344 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bin as JSON))) as side1_json_weightage,
345 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
346 a._bin = b.col as json_compare,
347 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bin as JSON))) =
348 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
349 from t_bin a , jj b
350 where a._bin is not NULL
351 and b.col is not NULL
352 and JSON_TYPE(CAST(a._bin as JSON))!='BLOB'
353 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
354 and ((a._bin = b.col) != (
355 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._bin as JSON)))
356 =
357 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
358 ));
359
360
361 echo "Testcase for Variable Binary";
362 #=============================
363 --sorted_result
364 select
365 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,
366 a._vbn as side1,
367 b.col as side2,
368 JSON_TYPE(CAST(a._vbn as JSON)) as side1_json_type,
369 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
370 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vbn as JSON))) as side1_json_weightage,
371 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
372 a._vbn = b.col as json_compare,
373 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vbn as JSON))) =
374 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
375 from t_vbn a , jj b
376 where a._vbn is not NULL
377 and b.col is not NULL
378 and JSON_TYPE(CAST(a._vbn as JSON))!='BLOB'
379 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
380 and ((a._vbn = b.col) != (
381 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._vbn as JSON)))
382 =
383 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
384 ));
385
386 echo "Testcase for TinyBlob";
387 #======================
388 --sorted_result
389 select
390 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,
391 a._tbl as side1,
392 b.col as side2,
393 JSON_TYPE(CAST(a._tbl as JSON)) as side1_json_type,
394 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
395 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tbl as JSON))) as side1_json_weightage,
396 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
397 a._tbl = b.col as json_compare,
398 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tbl as JSON))) =
399 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
400 from t_tbl a , jj b
401 where a._tbl is not NULL
402 and b.col is not NULL
403 and JSON_TYPE(CAST(a._tbl as JSON))!='BLOB'
404 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
405 and ((a._tbl = b.col) != (
406 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._tbl as JSON)))
407 =
408 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
409 ));
410
411 echo "Testcase for TinyText";
412 #======================
413 --sorted_result
414 select
415 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,
416 a._ttx as side1,
417 b.col as side2,
418 JSON_TYPE(CAST(a._ttx as JSON)) as side1_json_type,
419 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
420 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ttx as JSON))) as side1_json_weightage,
421 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
422 a._ttx = b.col as json_compare,
423 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ttx as JSON))) =
424 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
425 from t_ttx a , jj b
426 where a._ttx is not NULL
427 and b.col is not NULL
428 and JSON_TYPE(CAST(a._ttx as JSON))!='BLOB'
429 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
430 and ((a._ttx = b.col) != (
431 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ttx as JSON)))
432 =
433 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
434 ));
435
436 echo "Testcase for Blob";
437 #======================
438 --sorted_result
439 select
440 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,
441 a._blb as side1,
442 b.col as side2,
443 JSON_TYPE(CAST(a._blb as JSON)) as side1_json_type,
444 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
445 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._blb as JSON))) as side1_json_weightage,
446 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
447 a._blb = b.col as json_compare,
448 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._blb as JSON))) =
449 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
450 from t_blb a , jj b
451 where a._blb is not NULL
452 and b.col is not NULL
453 and JSON_TYPE(CAST(a._blb as JSON))!='BLOB'
454 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
455 and ((a._blb = b.col) != (
456 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._blb as JSON)))
457 =
458 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
459 ));
460
461
462 echo "Testcase for Text";
463 #======================
464 --sorted_result
465 select
466 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,
467 a._txt as side1,
468 b.col as side2,
469 JSON_TYPE(CAST(a._txt as JSON)) as side1_json_type,
470 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
471 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._txt as JSON))) as side1_json_weightage,
472 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
473 a._txt = b.col as json_compare,
474 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._txt as JSON))) =
475 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
476 from t_txt a , jj b
477 where a._txt is not NULL
478 and b.col is not NULL
479 and JSON_TYPE(CAST(a._txt as JSON))!='BLOB'
480 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
481 and ((a._txt = b.col) != (
482 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._txt as JSON)))
483 =
484 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
485 ));
486
487 echo "Testcase for Medium Blob";
488 #=========================
489 --sorted_result
490 select
491 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,
492 a._mbb as side1,
493 b.col as side2,
494 JSON_TYPE(CAST(a._mbb as JSON)) as side1_json_type,
495 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
496 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mbb as JSON))) as side1_json_weightage,
497 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
498 a._mbb = b.col as json_compare,
499 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mbb as JSON))) =
500 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
501 from t_mbb a , jj b
502 where a._mbb is not NULL
503 and b.col is not NULL
504 and JSON_TYPE(CAST(a._mbb as JSON))!='BLOB'
505 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
506 and ((a._mbb = b.col) != (
507 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mbb as JSON)))
508 =
509 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
510 ));
511
512 echo "Testcase for Medium Text";
513 #=========================
514 --sorted_result
515 select
516 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,
517 a._mtx as side1,
518 b.col as side2,
519 JSON_TYPE(CAST(a._mtx as JSON)) as side1_json_type,
520 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
521 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mtx as JSON))) as side1_json_weightage,
522 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
523 a._mtx = b.col as json_compare,
524 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mtx as JSON))) =
525 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
526 from t_mtx a , jj b
527 where a._mtx is not NULL
528 and b.col is not NULL
529 and JSON_TYPE(CAST(a._mtx as JSON))!='BLOB'
530 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
531 and ((a._mtx = b.col) != (
532 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._mtx as JSON)))
533 =
534 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
535 ));
536
537 echo "Testcase for Long Blob";
538 #=========================
539 --sorted_result
540 select
541 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,
542 a._lbb as side1,
543 b.col as side2,
544 JSON_TYPE(CAST(a._lbb as JSON)) as side1_json_type,
545 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
546 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._lbb as JSON))) as side1_json_weightage,
547 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
548 a._lbb = b.col as json_compare,
549 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._lbb as JSON))) =
550 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
551 from t_lbb a , jj b
552 where a._lbb is not NULL
553 and b.col is not NULL
554 and JSON_TYPE(CAST(a._lbb as JSON))!='BLOB'
555 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
556 and ((a._lbb = b.col) != (
557 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._lbb as JSON)))
558 =
559 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
560 ));
561
562 echo "Testcase for Long Text";
563 #=========================
564 --sorted_result
565 select
566 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,
567 a._ltx as side1,
568 b.col as side2,
569 JSON_TYPE(CAST(a._ltx as JSON)) as side1_json_type,
570 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
571 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ltx as JSON))) as side1_json_weightage,
572 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
573 a._ltx = b.col as json_compare,
574 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ltx as JSON))) =
575 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
576 from t_ltx a , jj b
577 where a._ltx is not NULL
578 and b.col is not NULL
579 and JSON_TYPE(CAST(a._ltx as JSON))!='BLOB'
580 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
581 and ((a._ltx = b.col) != (
582 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._ltx as JSON)))
583 =
584 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
585 ));
586
587 echo "Testcase for Enum";
588 #==================
589 --sorted_result
590 select
591 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,
592 a._enu as side1,
593 b.col as side2,
594 JSON_TYPE(CAST(a._enu as JSON)) as side1_json_type,
595 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
596 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._enu as JSON))) as side1_json_weightage,
597 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
598 a._enu = b.col as json_compare,
599 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._enu as JSON))) =
600 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
601 from t_enu a , jj b
602 where a._enu is not NULL
603 and b.col is not NULL
604 and JSON_TYPE(CAST(a._enu as JSON))!='BLOB'
605 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
606 and ((a._enu = b.col) != (
607 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._enu as JSON)))
608 =
609 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
610 ));
611
612 echo "Testcase for Set";
613 #==================
614 --sorted_result
615 select
616 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,
617 a._set as side1,
618 b.col as side2,
619 JSON_TYPE(CAST(a._set as JSON)) as side1_json_type,
620 JSON_TYPE(CAST(b.col as JSON)) as side2_json_type,
621 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._set as JSON))) as side1_json_weightage,
622 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage,
623 a._set = b.col as json_compare,
624 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._set as JSON))) =
625 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation
626 from t_set a , jj b
627 where a._set is not NULL
628 and b.col is not NULL
629 and JSON_TYPE(CAST(a._set as JSON))!='BLOB'
630 and JSON_TYPE(CAST(b.col as JSON))!='BLOB'
631 and ((a._set = b.col) != (
632 GET_JSON_WEIGHT(JSON_TYPE(CAST(a._set as JSON)))
633 =
634 GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)))
635 ));