summaryrefslogtreecommitdiff
path: root/mysql-test/main/mysqldump-utf8mb4.test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-10-12 06:15:21 +0400
committerAlexander Barkov <bar@mariadb.com>2018-10-12 06:34:13 +0400
commit6120ae4acafb23badecc623e33797949e3f6fbbb (patch)
treef998ce7ed5e8fc2bf62574b7c6ec93d8ef04569c /mysql-test/main/mysqldump-utf8mb4.test
parentce643ddac78ce66cdef9e4c0164ce7f8fbcf2da0 (diff)
downloadmariadb-git-6120ae4acafb23badecc623e33797949e3f6fbbb.tar.gz
Adjusting old tests and adding new tests for "MDEV-8765: mysqldump -use utf8mb4 by default"
Diffstat (limited to 'mysql-test/main/mysqldump-utf8mb4.test')
-rw-r--r--mysql-test/main/mysqldump-utf8mb4.test49
1 files changed, 49 insertions, 0 deletions
diff --git a/mysql-test/main/mysqldump-utf8mb4.test b/mysql-test/main/mysqldump-utf8mb4.test
new file mode 100644
index 00000000000..f8512c9bd7b
--- /dev/null
+++ b/mysql-test/main/mysqldump-utf8mb4.test
@@ -0,0 +1,49 @@
+--source include/have_utf8mb4.inc
+--source include/not_embedded.inc
+
+SET NAMES utf8mb4;
+
+--echo #
+--echo # MDEV-8765 mysqldump silently corrupts 4-byte UTF-8 data
+--echo #
+
+CREATE TABLE t1 (
+ point VARCHAR(10) PRIMARY KEY,
+ data VARCHAR(10),
+ comment VARCHAR(64)
+) CHARACTER SET utf8mb4;
+INSERT INTO t1 VALUES ('01f300', UNHEX('f09f8c80'), 'U+1F300 CYCLONE');
+
+--echo ----
+--echo Testing XML format output
+--echo ----
+
+--exec $MYSQL_DUMP --skip-create-options --skip-comments -X test t1
+
+
+--echo ----
+--echo Testing text format output
+--echo ----
+
+--exec $MYSQL_DUMP --skip-create-options --skip-comments test t1
+DROP TABLE t1;
+
+
+--echo ----
+--echo Testing text format dump/restore
+--echo ----
+
+--let $file = $MYSQLTEST_VARDIR/tmp/mysqldump-utf8mb4.sql
+
+CREATE TABLE t1 (
+ point VARCHAR(10) PRIMARY KEY,
+ data VARCHAR(10),
+ comment VARCHAR(64)
+) CHARACTER SET utf8mb4;
+INSERT INTO t1 VALUES ('01f300', UNHEX('f09f8c80'), 'U+1F300 CYCLONE');
+
+--exec $MYSQL_DUMP test t1 > $file
+DROP TABLE t1;
+--exec $MYSQL test < $file
+SELECT * FROM t1;
+DROP TABLE t1;