From 5352e9687a86094d19aaea605970487516e99ab5 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 18 Jun 2019 04:58:15 +0400 Subject: MDEV-17363 - Compressed columns cannot be restored from dump In collaboration with Sergey Vojtovich The COMPRESSED clause is now a part of the data type and goes immediately after the data type and length, but before the CHARACTER SET clause, and before column attributes such as DEFAULT, COLLATE, ON UPDATE, SYSTEM VERSIONING, engine specific column attributes. In the old reduction, the COMPRESSED clause was a column attribute. New syntax: New syntax examples: VARCHAR(1000) COMPRESSED CHARACTER SET latin1 DEFAULT '' BLOB COMPRESSED DEFAULT '' Deprecate syntax examples: VARCHAR(1000) CHARACTER SET latin1 COMPRESSED DEFAULT '' TEXT CHARACTER SET latin1 DEFAULT '' COMPRESSED VARBINARY(1000) DEFAULT '' COMPRESSED As a side effect: - COMPRESSED is not valid as an SP label name in SQL/PSM routines any more (but it's still valid as an SP label name in sql_mode=ORACLE) - COMPRESSED is now allowed in combination with GENERATED ALWAYS AS: TEXT COMPRESSED GENERATED ALWAYS AS REPEAT('a',1000) --- mysql-test/main/mysqldump_restore.test | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'mysql-test/main/mysqldump_restore.test') diff --git a/mysql-test/main/mysqldump_restore.test b/mysql-test/main/mysqldump_restore.test index 835ee3ee9e9..8d40a4f35f2 100644 --- a/mysql-test/main/mysqldump_restore.test +++ b/mysql-test/main/mysqldump_restore.test @@ -101,7 +101,29 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A); let $table_name = test.t1; --source include/mysqldump.inc ---echo # End tests +--echo # +--echo # Start of 10.3 tests +--echo # + +--echo # +--echo # MDEV-17363 Compressed columns cannot be restored from dump +--echo # + +CREATE TABLE t1 (a VARCHAR(1000) COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL); +INSERT INTO `t1` VALUES (REPEAT('a', 256)); +--exec $MYSQL_DUMP --skip-extended-insert test --skip-comments t1 > $mysqldumpfile +let $table_name = test.t1; +--source include/mysqldump.inc + +CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL); +INSERT INTO `t1` VALUES (REPEAT('a', 256)); +--exec $MYSQL_DUMP --skip-extended-insert test --skip-comments t1 > $mysqldumpfile +let $table_name = test.t1; +--source include/mysqldump.inc + +--echo # +--echo # End of 10.3 tests +--echo # --echo # Cleanup --echo # Reset concurrent_insert to its original value -- cgit v1.2.1