summaryrefslogtreecommitdiffstats
path: root/mysql-test/include/column_compression_syntax_varbinary.inc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
commit06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/include/column_compression_syntax_varbinary.inc
parentInitial commit. (diff)
downloadmariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz
mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/include/column_compression_syntax_varbinary.inc')
-rw-r--r--mysql-test/include/column_compression_syntax_varbinary.inc64
1 files changed, 64 insertions, 0 deletions
diff --git a/mysql-test/include/column_compression_syntax_varbinary.inc b/mysql-test/include/column_compression_syntax_varbinary.inc
new file mode 100644
index 00000000..e2f96c33
--- /dev/null
+++ b/mysql-test/include/column_compression_syntax_varbinary.inc
@@ -0,0 +1,64 @@
+--echo #
+--echo # The following statements run without warnings.
+--echo #
+
+--eval CREATE TABLE t1 (a $type COMPRESSED)
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # The following statements run without warnings.
+--echo # They have extra column attributes (or GENERATED) after COMPRESSED.
+--echo #
+
+--eval CREATE TABLE t1 (a $type COMPRESSED DEFAULT '')
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+--eval CREATE TABLE t1 (a $type COMPRESSED NULL)
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--eval CREATE TABLE t1 (a $type COMPRESSED GENERATED ALWAYS AS (REPEAT('a',10)))
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # The following statements return deprecated syntax warnings
+--echo #
+
+--enable_prepare_warnings
+
+--eval CREATE TABLE t1 (a $type DEFAULT '' COMPRESSED)
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+--eval CREATE TABLE t1 (a $type NULL COMPRESSED)
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--disable_prepare_warnings
+
+--echo #
+--echo # The following statements fail by the grammar,
+--echo # because COMPRESSED immediately follows 'field_type'.
+--echo #
+
+--error ER_PARSE_ERROR
+--eval CREATE TABLE t1 (a $type COMPRESSED COMPRESSED)
+
+--echo #
+--echo # The following statements are not prohibited by the *.yy grammar,
+--echo # because the sequence `field_type attribute COMPRESSED` is allowed
+--echo # (notice there is at least one attribute after `field_type`).
+--echo # The first COMPRESSED is parsed inside `field_type`.
+--echo # The second COMPRESSED passes through the parser but then is caught
+--echo # inside Column_definition::set_compressed_deprecated_with_type_check()
+--echo # and a syntax error is raised.
+--echo #
+
+--error ER_PARSE_ERROR
+--eval CREATE TABLE t1 (a $type COMPRESSED DEFAULT '' COMPRESSED)
+--error ER_PARSE_ERROR
+--eval CREATE TABLE t1 (a $type COMPRESSED NULL COMPRESSED)
+--error ER_PARSE_ERROR