1--echo # 2--echo # The following statements run without warnings. 3--echo # 4 5--eval CREATE TABLE t1 (a $type COMPRESSED) 6SHOW CREATE TABLE t1; 7DROP TABLE t1; 8 9 10--echo # 11--echo # The following statements run without warnings. 12--echo # They have extra column attributes (or GENERATED) after COMPRESSED. 13--echo # 14 15--eval CREATE TABLE t1 (a $type COMPRESSED DEFAULT '') 16SHOW CREATE TABLE t1; 17DROP TABLE t1; 18--eval CREATE TABLE t1 (a $type COMPRESSED NULL) 19SHOW CREATE TABLE t1; 20DROP TABLE t1; 21 22--eval CREATE TABLE t1 (a $type COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10))) 23SHOW CREATE TABLE t1; 24DROP TABLE t1; 25 26 27--echo # 28--echo # The following statements return deprecated syntax warnings 29--echo # 30 31--eval CREATE TABLE t1 (a $type DEFAULT '' COMPRESSED) 32SHOW CREATE TABLE t1; 33DROP TABLE t1; 34--eval CREATE TABLE t1 (a $type NULL COMPRESSED) 35SHOW CREATE TABLE t1; 36DROP TABLE t1; 37 38 39--echo # 40--echo # The following statements fail by the grammar, 41--echo # because COMPRESSED immediately follows 'field_type'. 42--echo # 43 44--error ER_PARSE_ERROR 45--eval CREATE TABLE t1 (a $type COMPRESSED COMPRESSED) 46 47--echo # 48--echo # The following statements are not prohibited by the *.yy grammar, 49--echo # because the sequence `field_type attribute COMPRESSED` is allowed 50--echo # (notice there is at least one attribute after `field_type`). 51--echo # The first COMPRESSED is parsed inside `field_type`. 52--echo # The second COMPRESSED passes through the parser but then is caught 53--echo # inside Column_definition::set_compressed_deprecated_with_type_check() 54--echo # and a syntax error is raised. 55--echo # 56 57--error ER_PARSE_ERROR 58--eval CREATE TABLE t1 (a $type COMPRESSED DEFAULT '' COMPRESSED) 59--error ER_PARSE_ERROR 60--eval CREATE TABLE t1 (a $type COMPRESSED NULL COMPRESSED) 61--error ER_PARSE_ERROR 62