1--echo #
2--echo # The following statements run without warnings.
3--echo # The `compressed opt_binary` grammar sequence is covered.
4--echo #
5
6--eval CREATE TABLE t1 (a $type COMPRESSED)
7SHOW CREATE TABLE t1;
8DROP TABLE t1;
9--eval CREATE TABLE t1 (a $type COMPRESSED BINARY)
10SHOW CREATE TABLE t1;
11DROP TABLE t1;
12--eval CREATE TABLE t1 (a $type COMPRESSED BINARY ASCII)
13SHOW CREATE TABLE t1;
14DROP TABLE t1;
15--eval CREATE TABLE t1 (a $type COMPRESSED BYTE)
16SHOW CREATE TABLE t1;
17DROP TABLE t1;
18--eval CREATE TABLE t1 (a $type COMPRESSED ASCII)
19SHOW CREATE TABLE t1;
20DROP TABLE t1;
21--eval CREATE TABLE t1 (a $type COMPRESSED UNICODE)
22SHOW CREATE TABLE t1;
23DROP TABLE t1;
24--eval CREATE TABLE t1 (a $type COMPRESSED CHARACTER SET utf8)
25SHOW CREATE TABLE t1;
26DROP TABLE t1;
27
28
29--echo #
30--echo # The following statements run without warnings.
31--echo # They have extra column attributes (or GENERATED) after COMPRESSED.
32--echo #
33
34--eval CREATE TABLE t1 (a $type COMPRESSED BYTE DEFAULT '')
35SHOW CREATE TABLE t1;
36DROP TABLE t1;
37--eval CREATE TABLE t1 (a $type COMPRESSED BINARY DEFAULT '')
38SHOW CREATE TABLE t1;
39DROP TABLE t1;
40--eval CREATE TABLE t1 (a $type COMPRESSED ASCII DEFAULT '')
41SHOW CREATE TABLE t1;
42DROP TABLE t1;
43--eval CREATE TABLE t1 (a $type COMPRESSED CHARACTER SET utf8 DEFAULT '')
44SHOW CREATE TABLE t1;
45DROP TABLE t1;
46
47--eval CREATE TABLE t1 (a $type COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)))
48SHOW CREATE TABLE t1;
49DROP TABLE t1;
50
51
52--echo #
53--echo # The following statements return deprecated syntax warnings
54--echo #
55
56--eval CREATE TABLE t1 (a $type BINARY COMPRESSED)
57SHOW CREATE TABLE t1;
58DROP TABLE t1;
59--eval CREATE TABLE t1 (a $type ASCII COMPRESSED)
60SHOW CREATE TABLE t1;
61DROP TABLE t1;
62--eval CREATE TABLE t1 (a $type BYTE COMPRESSED)
63SHOW CREATE TABLE t1;
64DROP TABLE t1;
65
66
67--echo #
68--echo # The following statements fail by the grammar,
69--echo # because COMPRESSED immediately follows  'field_type'.
70--echo #
71
72--error ER_PARSE_ERROR
73--eval CREATE TABLE t1 (a $type COMPRESSED BYTE COMPRESSED)
74--error ER_PARSE_ERROR
75--eval CREATE TABLE t1 (a $type COMPRESSED BINARY COMPRESSED)
76--error ER_PARSE_ERROR
77--eval CREATE TABLE t1 (a $type COMPRESSED ASCII COMPRESSED)
78--error ER_PARSE_ERROR
79--eval CREATE TABLE t1 (a $type COMPRESSED CHARACTER SET utf8 COMPRESSED)
80
81
82--echo #
83--echo # The following statements are not prohibited by the *.yy grammar,
84--echo # because the sequence `field_type attribute COMPRESSED` is allowed
85--echo # (notice there is at least one attribute after `field_type`).
86--echo # The first COMPRESSED is parsed inside `field_type`.
87--echo # The second COMPRESSED passes through the parser but then is caught
88--echo # inside Column_definition::set_compressed_deprecated_with_type_check()
89--echo # and a syntax error is raised.
90--echo #
91
92--error ER_PARSE_ERROR
93--eval CREATE TABLE t1 (a $type COMPRESSED BYTE DEFAULT '' COMPRESSED)
94--error ER_PARSE_ERROR
95--eval CREATE TABLE t1 (a $type COMPRESSED BINARY DEFAULT '' COMPRESSED)
96--error ER_PARSE_ERROR
97--eval CREATE TABLE t1 (a $type COMPRESSED ASCII DEFAULT '' COMPRESSED)
98--error ER_PARSE_ERROR
99--eval CREATE TABLE t1 (a $type COMPRESSED CHARACTER SET utf8 DEFAULT '' COMPRESSED)
100