diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-06-18 04:58:15 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-06-18 07:48:08 +0400 |
commit | 5352e9687a86094d19aaea605970487516e99ab5 (patch) | |
tree | 40f765c43fcfd46d53e56edd4753223f0000cced /mysql-test/main/sp.result | |
parent | 3784ed7a623ccc55a4755efeeb2f9ba06c7baf4e (diff) | |
download | mariadb-git-5352e9687a86094d19aaea605970487516e99ab5.tar.gz |
MDEV-17363 - Compressed columns cannot be restored from dump
In collaboration with Sergey Vojtovich <svoj@mariadb.org>
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:
<varchar or text data type> <length> <compression> <character set> <column attributes>
<varbinary or blob data type> <length> <compression> <column attributes>
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)
Diffstat (limited to 'mysql-test/main/sp.result')
-rw-r--r-- | mysql-test/main/sp.result | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result index b7022559dc5..2a32be05bb9 100644 --- a/mysql-test/main/sp.result +++ b/mysql-test/main/sp.result @@ -8814,4 +8814,31 @@ Note 1050 Table 't1' already exists drop procedure p4; drop table t1; set @@sql_mode=@save_sql_mode; +# +# MDEV-17363 Compressed columns cannot be restored from dump +# COMPRESSED conflicted between data type and SP label, +# so it's not allowed as an SP label any more. +# +CREATE FUNCTION f1() RETURNS TEXT COMPRESSED +BEGIN +RETURN ''; +END; +$$ +SHOW CREATE FUNCTION f1; +Function sql_mode Create Function character_set_client collation_connection Database Collation +f1 STRICT_ALL_TABLES CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS text COMPRESSED CHARSET latin1 +BEGIN +RETURN ''; +END latin1 latin1_swedish_ci latin1_swedish_ci +DROP FUNCTION f1; +CREATE FUNCTION f1() RETURNS TEXT +COMPRESSED: +BEGIN +RETURN ''; +END; +$$ +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ': +BEGIN +RETURN ''; +END' at line 2 # End of 10.3 tests |