MDEV-32250 Enable --no-autocommit by default in mysqldump

- 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.
This commit is contained in:
Thirunarayanan Balathandayuthapani 2024-12-03 17:51:35 +05:30
parent f0961301c8
commit b24ecd7ca6
21 changed files with 238 additions and 68 deletions

View file

@ -118,7 +118,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_no_data_m
opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0,
opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0,
opt_set_charset=0, opt_dump_date=1,
opt_autocommit=0,opt_disable_keys=1,opt_xml=0,
no_autocommit=0,opt_disable_keys=1,opt_xml=0,
opt_delete_master_logs=0, tty_password=0,
opt_single_transaction=0, opt_comments= 0, opt_compact= 0,
opt_hex_blob=0, opt_order_by_primary=0, opt_order_by_size = 0,
@ -501,7 +501,7 @@ static struct my_option my_long_options[] =
1024*1024L-1025, 4096, 16*1024L*1024L, 0, 1024, 0},
{"no-autocommit", 0,
"Wrap tables with autocommit/commit statements.",
&opt_autocommit, &opt_autocommit, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
&no_autocommit, &no_autocommit, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
{"no-create-db", 'n',
"Suppress the CREATE DATABASE ... IF EXISTS statement that normally is "
"output for each dumped database if --all-databases or --databases is "
@ -949,7 +949,7 @@ get_one_option(const struct my_option *opt,
case 'X':
opt_xml= 1;
extended_insert= opt_drop= opt_lock=
opt_disable_keys= opt_autocommit= opt_create_db= 0;
opt_disable_keys= no_autocommit= opt_create_db= 0;
break;
case 'i':
opt_comments_used= 1;
@ -4457,7 +4457,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
if (opt_xml)
print_xml_tag(md_result_file, "\t", "\n", "table_data", "name=", table,
NullS);
if (opt_autocommit)
if (no_autocommit)
{
fprintf(md_result_file, "set autocommit=0;\n");
check_io(md_result_file);
@ -4729,7 +4729,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
fputs("UNLOCK TABLES;\n", md_result_file);
check_io(md_result_file);
}
if (opt_autocommit)
if (no_autocommit)
{
fprintf(md_result_file, "commit;\n");
check_io(md_result_file);

View file

@ -674,7 +674,7 @@ use mysqltest1|
--echo
--echo ---> Dump of mysqltest1
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1
--exec $MYSQL_DUMP --no-autocommit=0 --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_koi8r.triggers.mysqltest1.sql
@ -684,7 +684,7 @@ use mysqltest1|
--echo
--echo ---> Dump of mysqltest2
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2
--exec $MYSQL_DUMP --no-autocommit=0 --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2
--echo
--echo ---> Dumping mysqltest2 to ddl_i18n_koi8r.triggers.mysqltest2.sql

View file

@ -405,7 +405,7 @@ set names utf8|
--echo
--echo ---> Dump of mysqltest1
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1
--exec $MYSQL_DUMP --no-autocommit=0 --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest1
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8sp.mysqltest1.sql
@ -415,7 +415,7 @@ set names utf8|
--echo
--echo ---> Dump of mysqltest2
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2
--exec $MYSQL_DUMP --no-autocommit=0 --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --routines --databases mysqltest2
--echo
--echo ---> Dumping mysqltest2 to ddl_i18n_utf8sp.mysqltest2.sql
@ -676,7 +676,7 @@ use mysqltest1|
--echo
--echo ---> Dump of mysqltest1
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1
--exec $MYSQL_DUMP --no-autocommit=0 --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest1
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8triggers.mysqltest1.sql
@ -686,7 +686,7 @@ use mysqltest1|
--echo
--echo ---> Dump of mysqltest2
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2
--exec $MYSQL_DUMP --no-autocommit=0 --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --triggers --databases mysqltest2
--echo
--echo ---> Dumping mysqltest2 to ddl_i18n_utf8triggers.mysqltest2.sql
@ -931,7 +931,7 @@ set names utf8|
--echo
--echo ---> Dump of mysqltest1
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1
--exec $MYSQL_DUMP --no-autocommit=0 --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest1
--echo
--echo ---> Dumping mysqltest1 to ddl_i18n_utf8events.mysqltest1.sql
@ -941,7 +941,7 @@ set names utf8|
--echo
--echo ---> Dump of mysqltest2
--exec $MYSQL_DUMP --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2
--exec $MYSQL_DUMP --no-autocommit=0 --character-sets-dir=$MYSQL_SHAREDIR/charsets --compact --events --databases mysqltest2
--echo
--echo ---> Dumping mysqltest2 to ddl_i18n_utf8events.mysqltest2.sql

View file

@ -25,7 +25,7 @@ create definer=definer@localhost view mysqltest3.v3ps as select user from perfor
create definer=definer@localhost view mysqltest3.v3nt as select 1;
create definer=definer@localhost sql security invoker view mysqltest3.v3i as select * from mysqltest1.t1;
exec $MYSQL_DUMP --compact -B mysqltest1 mysqltest2 mysqltest3;
exec $MYSQL_DUMP --no-autocommit=0 --compact -B mysqltest1 mysqltest2 mysqltest3;
connect inv,localhost,invoker;
error ER_DBACCESS_DENIED_ERROR;
@ -91,7 +91,7 @@ create view v1 as select * from (select * from t1) dt;
lock table v1 read;
disconnect con1;
connection default;
exec $MYSQL_DUMP test v1 -uu1 --compact;
exec $MYSQL_DUMP --no-autocommit=0 test v1 -uu1 --compact;
drop view v1;
drop table t1;
drop user u1@localhost;

View file

@ -660,7 +660,7 @@ create table `a1\``b1` (a int);
show tables;
insert `a1\``b1` values (1),(2);
show create table `a1\``b1`;
--exec $MYSQL_DUMP --compact test
--exec $MYSQL_DUMP --no-autocommit=0 --compact test
--exec $MYSQL_DUMP test > $MYSQLTEST_VARDIR/tmp/bug.sql
insert `a1\``b1` values (4),(5);
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug.sql
@ -674,8 +674,8 @@ create table "a1\""b1" (a int);
show tables;
insert "a1\""b1" values (1),(2);
show create table "a1\""b1";
--exec $MYSQL_DUMP --compact --compatible=postgres test
--exec $MYSQL_DUMP --compatible=postgres test > $MYSQLTEST_VARDIR/tmp/bug.sql
--exec $MYSQL_DUMP --no-autocommit=0 --compact --compatible=postgres test
--exec $MYSQL_DUMP --no-autocommit=0 --compatible=postgres test > $MYSQLTEST_VARDIR/tmp/bug.sql
insert "a1\""b1" values (4),(5);
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug.sql
show create table "a1\""b1";
@ -762,7 +762,7 @@ source $MYSQL_TMP_DIR/mysql_in;" $MYSQL_TMP_DIR/mysql_in2;
create table t1 (a int);
--exec $MYSQL_DUMP test t1 > $MYSQLTEST_VARDIR/tmp/MDEV-34203.sql
--exec $MYSQL_DUMP --no-autocommit test t1 > $MYSQLTEST_VARDIR/tmp/MDEV-34203.sql
drop table t1;

View file

@ -61,9 +61,9 @@ select * from t5;
select * from t6;
--replace_result "NAMES utf8mb4" "NAMES utf8mb4" "NAMES utf8" "NAMES utf8mb4"
--exec $MYSQL_DUMP --skip-comments --delayed-insert --insert-ignore --databases test
--exec $MYSQL_DUMP --no-autocommit=0 --skip-comments --delayed-insert --insert-ignore --databases test
--replace_result "NAMES utf8mb4" "NAMES utf8mb4" "NAMES utf8" "NAMES utf8mb4"
--exec $MYSQL_DUMP --skip-comments --delayed-insert --databases test
--exec $MYSQL_DUMP --no-autocommit=0 --skip-comments --delayed-insert --databases test
drop table t1;
drop table t2;

View file

@ -26,10 +26,10 @@ create procedure sp() select * from `v1
flush tables;
use test;
exec $MYSQL_DUMP --compact --comments --routines --add-drop-database --databases 'mysqltest1
exec $MYSQL_DUMP --compact --comments --routines --add-drop-database --databases --no-autocommit=0 'mysqltest1
1tsetlqsym';
exec $MYSQL_DUMP --compact --comments --routines --add-drop-database --databases 'mysqltest1
exec $MYSQL_DUMP --compact --comments --routines --add-drop-database --databases --no-autocommit=0 'mysqltest1
1tsetlqsym' | $MYSQL;
show tables from `mysqltest1
@ -45,11 +45,11 @@ create database `test\``
show databases like 'test%';
exec $MYSQL_DUMP --compact --comments --add-drop-database --databases 'test`' 'test\`
exec $MYSQL_DUMP --compact --comments --add-drop-database --no-autocommit=0 --databases 'test`' 'test\`
\! ls
#';
exec $MYSQL_DUMP --compact --comments --add-drop-database --databases 'test`' 'test\`
exec $MYSQL_DUMP --compact --comments --add-drop-database --no-autocommit=0 --databases 'test`' 'test\`
\! ls
#' | $MYSQL;

View file

@ -70,7 +70,7 @@ eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--echo #
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB $AUTH_TEST_PLUGIN_SO AUTH_TEST_PLUGIN_LIB
--exec $MYSQL_DUMP --skip-comments --system=all
--exec $MYSQL_DUMP --skip-comments --system=all --no-autocommit=0
--echo #
@ -78,18 +78,18 @@ eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--echo #
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB $AUTH_TEST_PLUGIN_SO AUTH_TEST_PLUGIN_LIB
--exec $MYSQL_DUMP --skip-comments --system=all --replace
--exec $MYSQL_DUMP --skip-comments --system=all --replace --no-autocommit=0
# save this for restore
--exec $MYSQL_DUMP --system=users,servers,stats,timezones,udfs --replace > $MYSQLTEST_VARDIR/tmp/dump1.sql
--exec $MYSQL_DUMP --system=users,servers,stats,timezones,udfs --replace --no-autocommit=0 > $MYSQLTEST_VARDIR/tmp/dump1.sql
--echo #
--echo # mysqldump of system tables with --system=all --insert-ignore
--echo #
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB $AUTH_TEST_PLUGIN_SO AUTH_TEST_PLUGIN_LIB
--exec $MYSQL_DUMP --skip-comments --system=all --insert-ignore
--exec $MYSQL_DUMP --skip-comments --system=all --insert-ignore --no-autocommit=0
# global_priv checksum not restored because:

View file

@ -16,7 +16,7 @@ SET @save_max_statement_time=@@max_statement_time;
SET GLOBAL max_statement_time=0.1;
--send UNLOCK TABLES;
--echo This would be a race condition otherwise, but default max_statement_time=0 makes it succeed
--exec $MYSQL_DUMP --skip-lock-tables --skip-comments test1 t1
--exec $MYSQL_DUMP --no-autocommit=0 --skip-lock-tables --skip-comments test1 t1
--reap
SET GLOBAL max_statement_time=@save_max_statement_time;
DROP DATABASE test1;

View file

@ -26,7 +26,7 @@ INSERT INTO t1 VALUES ('01f300', UNHEX('f09f8c80'), 'U+1F300 CYCLONE');
--echo Testing text format output
--echo ----
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --skip-create-options --skip-comments test t1
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --skip-create-options --skip-comments --no-autocommit=0 test t1
DROP TABLE t1;

File diff suppressed because one or more lines are too long

View file

@ -167,17 +167,17 @@ CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
# Run mysqldump
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --skip-create-options --skip-comments --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test t1
--exec $MYSQL_DUMP --no-autocommit=0 --default-character-set=utf8mb4 --skip-create-options --skip-comments --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test t1
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --skip-create-options --skip-comments --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test
--exec $MYSQL_DUMP --no-autocommit=0 --default-character-set=utf8mb4 --skip-create-options --skip-comments --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --skip-create-options --skip-comments --ssl --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test
--exec $MYSQL_DUMP --no-autocommit=0 --default-character-set=utf8mb4 --skip-create-options --skip-comments --ssl --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test
# With wrong parameters
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQL_DUMP mariadb-dump .\exe ''
--replace_regex /TLS\/SSL error.*/TLS\/SSL error: xxxx/
--error 2
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --skip-create-options --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1
--exec $MYSQL_DUMP --no-autocommit=0 --default-character-set=utf8mb4 --skip-create-options --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1
--echo
DROP TABLE t1;
--remove_file $MYSQLTEST_VARDIR/tmp/test.sql

View file

@ -344,7 +344,7 @@ CREATE TRIGGER tr2_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a:=2;
CREATE TRIGGER tr1_bu BEFORE UPDATE ON t1 FOR EACH ROW SET @a:=3;
# dump tables and triggers
--exec $MYSQL_DUMP --compact test
--exec $MYSQL_DUMP --compact --no-autocommit=0 test
DROP TABLE t1;
@ -361,7 +361,7 @@ CREATE TRIGGER tr1_1_bi BEFORE INSERT ON t1 FOR EACH ROW FOLLOWS tr1_bi SET @a:=
--echo # Expected order of triggers in the dump is: tr0_bi, tr1_bi, tr1_1_bi, tr2_i.
# dump tables and triggers
--exec $MYSQL_DUMP --compact test
--exec $MYSQL_DUMP --no-autocommit=0 --compact test
DROP TABLE t1;
@ -377,7 +377,7 @@ CREATE TRIGGER tr1_bu BEFORE UPDATE ON t1 FOR EACH ROW SET @a:=3;
SET TIMESTAMP=DEFAULT;
# dump tables and triggers
--exec $MYSQL_DUMP --compact --no-create-info --xml test
--exec $MYSQL_DUMP --compact --no-create-info --no-autocommit=0 --xml test
DROP TABLE t1;

View file

@ -18,8 +18,8 @@ insert t1 (v) values (Vec_Fromtext('[0.418,0.809,0.823,0.598,0.033]')),
(Vec_Fromtext('[0.415,0.609,0.426,0.988,0.475]'));
select id from t1 order by vec_distance_euclidean(v, Vec_FromText('[1,0,0,0,0]')) limit 3;
replace_result InnoDB MyISAM;
exec $MYSQL_DUMP --compact --hex-blob test t1;
exec $MYSQL_DUMP --hex-blob test t1 > $MYSQL_TMP_DIR/vector.sql;
exec $MYSQL_DUMP --no-autocommit=0 --compact --hex-blob test t1;
exec $MYSQL_DUMP --no-autocommit=0 --hex-blob test t1 > $MYSQL_TMP_DIR/vector.sql;
exec $MYSQL test < $MYSQL_TMP_DIR/vector.sql;
remove_file $MYSQL_TMP_DIR/vector.sql;
show create table t1;

View file

@ -96,7 +96,7 @@ INSERT INTO `t1` VALUES
(NULL,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
# Determine the number of open sessions
--source include/count_sessions.inc
--exec $MYSQL_DUMP --hex-blob --compact --order-by-primary --skip-extended-insert --no-create-info test t1
--exec $MYSQL_DUMP --no-autocommit=0 --hex-blob --compact --order-by-primary --skip-extended-insert --no-create-info test t1
drop table t1;
# Wait till the number of open sessions is <= the number before the run with $MYSQL_DUMP
# = The session caused by mysqldump has finished its disconnect

View file

@ -31,7 +31,7 @@ CREATE TABLE t2 (
CREATE VIEW v2 AS SELECT
LTRIM(now()) AS a0,
LPAD(now(),10) AS b0;
--exec $MYSQL_DUMP --skip-extended-insert test --skip-comments --compact t1 t2 v1 v2
--exec $MYSQL_DUMP --no-autocommit=0 --skip-extended-insert test --skip-comments --compact t1 t2 v1 v2
--exec $MYSQL_DUMP --skip-extended-insert test --skip-comments t1 t2 v1 v2 > $mysqldumpfile
DROP TABLE t1,t2;
DROP VIEW v1,v2;

View file

@ -305,7 +305,7 @@ delete from t1 where a=111;
# note that LOCK TABLES won't work because v3 has invalid definer
--exec $MYSQL_DUMP --compact --events --routines --skip-lock-tables --databases test mysqltest1
--exec $MYSQL_DUMP --no-autocommit=0 --compact --events --routines --skip-lock-tables --databases test mysqltest1
##################################################
# cleanup

View file

@ -66,10 +66,10 @@ select @@global.gtid_slave_pos as "after initial slave got in sync";
--echo # 3. A
# Two dumps prepared to be restored in the following loop
--exec $MYSQL_DUMP_SLAVE --dump-slave --gtid mysql gtid_slave_pos > $MYSQLTEST_VARDIR/tmp/dump_2.sql
--exec $MYSQL_DUMP_SLAVE --no-autocommit=0 --dump-slave --gtid mysql gtid_slave_pos > $MYSQLTEST_VARDIR/tmp/dump_2.sql
--source include/stop_slave.inc
--exec $MYSQL_DUMP_SLAVE --master-data --gtid mysql gtid_slave_pos > $MYSQLTEST_VARDIR/tmp/dump_1.sql
--exec $MYSQL_DUMP_SLAVE --no-autocommit=0 --master-data --gtid mysql gtid_slave_pos > $MYSQLTEST_VARDIR/tmp/dump_1.sql
--let $i=2
while ($i)

View file

@ -12,15 +12,15 @@ CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
insert into t1 values (1),(2);
CREATE SEQUENCE x1 engine=innodb;
--echo # dump whole database
--exec $MYSQL_DUMP --compact test
--exec $MYSQL_DUMP --no-autocommit=0 --compact test
--echo # dump by tables order 1
--exec $MYSQL_DUMP --compact --tables test t1 a1 x1
--exec $MYSQL_DUMP --no-autocommit=0 --compact --tables test t1 a1 x1
--echo # dump by tables order 2
--exec $MYSQL_DUMP --compact --tables test a1 t1 x1
--exec $MYSQL_DUMP --no-autocommit=0 --compact --tables test a1 t1 x1
--echo # dump by tables only tables
--exec $MYSQL_DUMP --compact --tables test t1
--exec $MYSQL_DUMP --no-autocommit=0 --compact --tables test t1
--echo # dump by tables only sequences
--exec $MYSQL_DUMP --compact --tables test a1 x1
--exec $MYSQL_DUMP --no-autocommit=0 --compact --tables test a1 x1
--echo # end of dumps
DROP TABLE a1,t1,x1;

View file

@ -14,18 +14,18 @@ delete from t1 where x=2;
set timestamp=default;
--echo #MYSQL_DUMP --compact test
--exec $MYSQL_DUMP --compact test
--exec $MYSQL_DUMP --no-autocommit=0 --compact test
--echo #MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test
--exec $MYSQL_DUMP --compact --as-of="1990-01-02 00:00" test
--exec $MYSQL_DUMP --no-autocommit=0 --compact --as-of="1990-01-02 00:00" test
--echo #MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test
--exec $MYSQL_DUMP --compact --as-of="1990-08-02 00:00" --databases test
--exec $MYSQL_DUMP --no-autocommit=0 --compact --as-of="1990-08-02 00:00" --databases test
--echo #MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1
--exec $MYSQL_DUMP --compact --as-of="1990-08-04 00:00" test t1
--exec $MYSQL_DUMP --no-autocommit=0 --compact --as-of="1990-08-04 00:00" test t1
## Forged query protection
--echo #MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1
--replace_result mariadb-dump.exe mariadb-dump
--error 1
--exec $MYSQL_DUMP --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1
--exec $MYSQL_DUMP --no-autocommit=0 --compact --as-of="1990-08-04 00:00' where 'abc" test 2>&1
drop tables t1;
@ -65,23 +65,23 @@ select x, check_fields(x, row_start, row_end) from t2 for system_time all order
--let TMP= $MYSQLTEST_VARDIR/tmp
--exec $MYSQL_DUMP --dump-history --databases test > $TMP/dump_history.sql
--exec $MYSQL_DUMP --databases test > $TMP/dump_no_history.sql
--exec $MYSQL_DUMP --dump-history --no-create-info --skip-comments --databases test > $TMP/dump_only_data.sql
--exec $MYSQL_DUMP --dump-history --compact test 2>&1 > $TMP/dump_history_compact.sql
--exec $MYSQL_DUMP --no-autocommit=0 --dump-history --databases test > $TMP/dump_history.sql
--exec $MYSQL_DUMP --no-autocommit=0 --databases test > $TMP/dump_no_history.sql
--exec $MYSQL_DUMP --no-autocommit=0 --dump-history --no-create-info --skip-comments --databases test > $TMP/dump_only_data.sql
--exec $MYSQL_DUMP --no-autocommit=0 --dump-history --compact test 2>&1 > $TMP/dump_history_compact.sql
--replace_result $sys_time_max_replace MAX_TIME
--cat_file $TMP/dump_history_compact.sql
--replace_result mariadb-dump.exe mariadb-dump
--error 1
--exec $MYSQL_DUMP --dump-history --as-of="1990-01-02 00:00" test 2>&1
--exec $MYSQL_DUMP --no-autocommit=0 --dump-history --as-of="1990-01-02 00:00" test 2>&1
--replace_result mariadb-dump.exe mariadb-dump
--error 1
--exec $MYSQL_DUMP --dump-history --replace test 2>&1
--exec $MYSQL_DUMP --no-autocommit=0 --dump-history --replace test 2>&1
--replace_result mariadb-dump.exe mariadb-dump
--error 1
--exec $MYSQL_DUMP --dump-history --xml test 2>&1
--exec $MYSQL_DUMP --dump-history --tab=$TMP test
--exec $MYSQL_DUMP --no-autocommit=0 --dump-history --tab=$TMP test
--echo # SQL dump with/without history
--echo ## With history
@ -162,10 +162,10 @@ delete from t1 where x=1;
--replace_result mariadb-dump.exe mariadb-dump
--error 6
--exec $MYSQL_DUMP --dump-history test 2>&1 >/dev/null
--exec $MYSQL_DUMP --no-autocommit=0 --dump-history test 2>&1 >/dev/null
--replace_regex /2,\d+,/2,XXX,/ /mariadb-dump\.exe/mariadb-dump/
--error 6
--exec $MYSQL_DUMP --force --dump-history --compact test 2>&1
--exec $MYSQL_DUMP --no-autocommit=0 --force --dump-history --compact test 2>&1
drop table t1;

View file

@ -45,8 +45,8 @@ let $MARIADB_DATADIR= `select @@datadir`;
--copy_file std_data/sv_partition.frm $MARIADB_DATADIR/test/sv_partition.frm
--copy_file std_data/sv_partition.par $MARIADB_DATADIR/test/sv_partition.par
--exec $MYSQL_DUMP --compact --dump-history test
--exec $MYSQL_DUMP --compact --dump-history --update-history test
--exec $MYSQL_DUMP --no-autocommit=0 --compact --dump-history test
--exec $MYSQL_DUMP --no-autocommit=0 --compact --dump-history --update-history test
--exec $MYSQL_UPGRADE --force --silent 2>&1
--remove_file $MARIADB_DATADIR/mariadb_upgrade_info