mirror of
https://github.com/MariaDB/server.git
synced 2025-02-20 20:33:15 +01:00

- mariadb-dump utility performs logical backups by producing set of sql statements that can be executed. By enabling this no-autocommit option, InnoDB can load the data in an efficient way and writes the only one undo log for the whole operation. Only first insert statement undergoes bulk insert operation, remaining insert statement doesn't write undo log and undergoes normal insert code path.
50 lines
1.2 KiB
Text
50 lines
1.2 KiB
Text
--source include/have_utf8mb4.inc
|
|
--source include/not_embedded.inc
|
|
--source include/default_charset.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 --default-character-set=utf8mb4 --skip-create-options --skip-comments -X test t1
|
|
|
|
|
|
--echo ----
|
|
--echo Testing text format output
|
|
--echo ----
|
|
|
|
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --skip-create-options --skip-comments --no-autocommit=0 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 --default-character-set=utf8mb4 test t1 > $file
|
|
DROP TABLE t1;
|
|
--exec $MYSQL test < $file
|
|
SELECT * FROM t1;
|
|
DROP TABLE t1;
|