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