Current Path : /home/usr.opt/mysql57/mysql-test/suite/json/inc/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/json/inc/json_vs_json_comparator.inc |
# These are tests for JSON vs JSON datatypes. # Comparator > #----------------------- echo "Test for JSON vs JSON"; echo ""; echo ""; --disable_query_log select a.col as side1, b.col as side2, JSON_TYPE(CAST(a.col as JSON)) as side1_json_type, JSON_TYPE(CAST(b.col as JSON)) as side2_json_type, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) as side1_json_weightage, GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage, a.col > b.col as json_compare, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) > GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation from jj a , jj b where a.col is not NULL and b.col is not NULL and ((a.col > b.col) != ( GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) > GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) ))AND JSON_TYPE(CAST(a.col as JSON)) !='BLOB' AND JSON_TYPE(CAST(b.col as JSON)) !='BLOB' AND GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) != GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))); echo "Comparator <"; echo "=============="; # Comparator < #----------------------- select a.col as side1, b.col as side2, JSON_TYPE(CAST(a.col as JSON)) as side1_json_type, JSON_TYPE(CAST(b.col as JSON)) as side2_json_type, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) as side1_json_weightage, GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage, a.col < b.col as json_compare, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) < GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation from jj a , jj b where a.col is not NULL and b.col is not NULL and ((a.col < b.col) != ( GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) < GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) ))AND JSON_TYPE(CAST(a.col as JSON)) !='BLOB' AND JSON_TYPE(CAST(b.col as JSON)) !='BLOB' AND GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) != GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))); echo "Comparator >="; echo "=============="; # Comparator >= #----------------------- select a.col as side1, b.col as side2, JSON_TYPE(CAST(a.col as JSON)) as side1_json_type, JSON_TYPE(CAST(b.col as JSON)) as side2_json_type, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) as side1_json_weightage, GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage, a.col >= b.col as json_compare, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) >= GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation from jj a , jj b where a.col is not NULL and b.col is not NULL and ((a.col >= b.col) != ( GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) >= GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) ))AND JSON_TYPE(CAST(a.col as JSON)) !='BLOB' AND JSON_TYPE(CAST(b.col as JSON)) !='BLOB' AND GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) != GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))); echo "Comparator <="; echo "=============="; # Comparator <= #----------------------- select a.col as side1, b.col as side2, JSON_TYPE(CAST(a.col as JSON)) as side1_json_type, JSON_TYPE(CAST(b.col as JSON)) as side2_json_type, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) as side1_json_weightage, GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage, a.col <= b.col as json_compare, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) <= GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation from jj a , jj b where a.col is not NULL and b.col is not NULL and ((a.col <= b.col) != ( GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) <= GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) ))AND JSON_TYPE(CAST(a.col as JSON)) !='BLOB' AND JSON_TYPE(CAST(b.col as JSON)) !='BLOB' AND GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) != GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))); echo "Comparator ="; echo "=============="; # Comparator = #----------------------- select a.col as side1, b.col as side2, JSON_TYPE(CAST(a.col as JSON)) as side1_json_type, JSON_TYPE(CAST(b.col as JSON)) as side2_json_type, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) as side1_json_weightage, GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage, a.col = b.col as json_compare, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) = GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation from jj a , jj b where a.col is not NULL and b.col is not NULL and ((a.col = b.col) != ( GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) = GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) ))AND JSON_TYPE(CAST(a.col as JSON)) !='BLOB' AND JSON_TYPE(CAST(b.col as JSON)) !='BLOB' AND GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) != GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))); echo "Comparator !="; echo "=============="; # Comparator != #----------------------- select a.col as side1, b.col as side2, JSON_TYPE(CAST(a.col as JSON)) as side1_json_type, JSON_TYPE(CAST(b.col as JSON)) as side2_json_type, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) as side1_json_weightage, GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage, a.col != b.col as json_compare, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) != GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation from jj a , jj b where a.col is not NULL and b.col is not NULL and ((a.col != b.col) != ( GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) != GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) ))AND JSON_TYPE(CAST(a.col as JSON)) !='BLOB' AND JSON_TYPE(CAST(b.col as JSON)) !='BLOB' AND GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) != GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))); echo "Comparator <>"; echo "=============="; # Comparator <> #----------------------- select a.col as side1, b.col as side2, JSON_TYPE(CAST(a.col as JSON)) as side1_json_type, JSON_TYPE(CAST(b.col as JSON)) as side2_json_type, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) as side1_json_weightage, GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage, a.col <> b.col as json_compare, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) <> GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation from jj a , jj b where a.col is not NULL and b.col is not NULL and ((a.col <> b.col) != ( GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) <> GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) ))AND JSON_TYPE(CAST(a.col as JSON)) !='BLOB' AND JSON_TYPE(CAST(b.col as JSON)) !='BLOB' AND GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) != GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))); echo "Comparator <=>"; echo "=============="; # Comparator <=> #----------------------- select a.col as side1, b.col as side2, JSON_TYPE(CAST(a.col as JSON)) as side1_json_type, JSON_TYPE(CAST(b.col as JSON)) as side2_json_type, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) as side1_json_weightage, GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as side2_json_weightage, a.col <=> b.col as json_compare, GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) <=> GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) as first_level_validation from jj a , jj b where a.col is not NULL and b.col is not NULL and ((a.col <=> b.col) != ( GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) <=> GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON))) ))AND JSON_TYPE(CAST(a.col as JSON)) !='BLOB' AND JSON_TYPE(CAST(b.col as JSON)) !='BLOB' AND GET_JSON_WEIGHT(JSON_TYPE(CAST(a.col as JSON))) != GET_JSON_WEIGHT(JSON_TYPE(CAST(b.col as JSON)));