1#
2# MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRY
3#
4SET NAMES utf8;
5CREATE TABLE t1 (
6js0 JSON,
7js1 TEXT CHECK (JSON_VALID(js1)),
8js2 TEXT CHECK (LENGTH(js2) > 0 AND JSON_VALID(js2)),
9js3 TEXT CHECK (LENGTH(js2) > 0 OR JSON_VALID(js2))
10) CHARACTER SET utf8;
11--------------
12SELECT * FROM t1
13--------------
14
15Field   1:  `js0`
16Org_field:  `js0`
17Catalog:    `def`
18Database:   `test`
19Table:      `t1`
20Org_table:  `t1`
21Type:       BLOB (format=json)
22Collation:  latin1_swedish_ci (8)
23Length:     4294967295
24Max_length: 0
25Decimals:   0
26Flags:      BLOB BINARY
27
28Field   2:  `js1`
29Org_field:  `js1`
30Catalog:    `def`
31Database:   `test`
32Table:      `t1`
33Org_table:  `t1`
34Type:       BLOB (format=json)
35Collation:  latin1_swedish_ci (8)
36Length:     65535
37Max_length: 0
38Decimals:   0
39Flags:      BLOB
40
41Field   3:  `js2`
42Org_field:  `js2`
43Catalog:    `def`
44Database:   `test`
45Table:      `t1`
46Org_table:  `t1`
47Type:       BLOB (format=json)
48Collation:  latin1_swedish_ci (8)
49Length:     65535
50Max_length: 0
51Decimals:   0
52Flags:      BLOB
53
54Field   4:  `js3`
55Org_field:  `js3`
56Catalog:    `def`
57Database:   `test`
58Table:      `t1`
59Org_table:  `t1`
60Type:       BLOB
61Collation:  latin1_swedish_ci (8)
62Length:     65535
63Max_length: 0
64Decimals:   0
65Flags:      BLOB
66
67
680 rows in set (TIME)
69
70Bye
71--------------
72SELECT JSON_COMPACT(js0) FROM t1
73--------------
74
75Field   1:  `JSON_COMPACT(js0)`
76Org_field:  ``
77Catalog:    `def`
78Database:   ``
79Table:      ``
80Org_table:  ``
81Type:       LONG_BLOB (format=json)
82Collation:  latin1_swedish_ci (8)
83Length:     4294967295
84Max_length: 0
85Decimals:   0
86Flags:      BINARY
87
88
890 rows in set (TIME)
90
91Bye
92DROP TABLE t1;
93