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