mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-32216 add tests for mariadb-dump --parallel
- --parallel=N with or without --single-transaction - Error cases (too many connections, emulate error on one connection) - Windows specific test for named pipe connections
This commit is contained in:
4
mysql-test/main/mariadb-dump-debug.result
Normal file
4
mysql-test/main/mariadb-dump-debug.result
Normal file
@ -0,0 +1,4 @@
|
||||
set @save_debug_dbug=@@global.debug_dbug;
|
||||
set global debug_dbug='+d,select_export_kill';
|
||||
mariadb-dump: Couldn't execute async query 'SELECT /*!40001 SQL_NO_CACHE */ `Host`, `User`, `Priv` INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/global_priv.txt' /*!50138 CHARACTER SET binary */ FROM `mysql`.`global_priv`' (Query execution was interrupted)
|
||||
set global debug_dbug=@save_debug_dbug;
|
15
mysql-test/main/mariadb-dump-debug.test
Normal file
15
mysql-test/main/mariadb-dump-debug.test
Normal file
@ -0,0 +1,15 @@
|
||||
--source include/have_debug.inc
|
||||
--source include/not_embedded.inc
|
||||
# need to dump "mysql" schema
|
||||
--source include/have_innodb.inc
|
||||
|
||||
# inject error on SELECT INTO OUTFILE
|
||||
set @save_debug_dbug=@@global.debug_dbug;
|
||||
set global debug_dbug='+d,select_export_kill';
|
||||
# This one succeeds
|
||||
--replace_result .\exe '' $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --parallel=2 mysql global_priv 2>&1
|
||||
|
||||
set global debug_dbug=@save_debug_dbug;
|
||||
|
1
mysql-test/main/mysqldump-win.opt
Normal file
1
mysql-test/main/mysqldump-win.opt
Normal file
@ -0,0 +1 @@
|
||||
--loose-enable-named-pipe
|
9
mysql-test/main/mysqldump-win.result
Normal file
9
mysql-test/main/mysqldump-win.result
Normal file
@ -0,0 +1,9 @@
|
||||
# Test mysqldump specific features (pipe connection, with parallel)
|
||||
CREATE TABLE t1 (i INT);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
DROP TABLE t1;
|
||||
test.t1: Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
|
||||
SELECT * FROM t1;
|
||||
i
|
||||
1
|
||||
DROP TABLE t1;
|
14
mysql-test/main/mysqldump-win.test
Normal file
14
mysql-test/main/mysqldump-win.test
Normal file
@ -0,0 +1,14 @@
|
||||
--source include/windows.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
--echo # Test mysqldump specific features (pipe connection, with parallel)
|
||||
CREATE TABLE t1 (i INT);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
|
||||
--exec $MYSQL_DUMP --host=. --tab=$MYSQLTEST_VARDIR/tmp/ test --parallel=2
|
||||
DROP TABLE t1;
|
||||
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
|
||||
--exec $MYSQL_IMPORT test $MYSQLTEST_VARDIR/tmp/t1.txt
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
@ -6658,3 +6658,12 @@ drop table t1;
|
||||
# End of 10.4 tests
|
||||
#
|
||||
mariadb-dump: --xml can't be used with --tab.
|
||||
select @@max_connections into @save_max_connections;
|
||||
set global max_connections=10;
|
||||
mariadb-dump: Got error: 1040: "Too many connections" when trying to connect
|
||||
set global max_connections=300;
|
||||
mariadb-dump: Too many connections
|
||||
set global max_connections=@save_max_connections;
|
||||
#
|
||||
# End of 11.4 tests
|
||||
#
|
||||
|
@ -2482,7 +2482,7 @@ INSERT INTO t2 VALUES (3), (4);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --tab=$MYSQLTEST_VARDIR/tmp/ db_20772273
|
||||
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --tab=$MYSQLTEST_VARDIR/tmp/ --parallel=2 db_20772273
|
||||
--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t1.sql
|
||||
--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t2.sql
|
||||
|
||||
@ -3023,3 +3023,24 @@ drop table t1;
|
||||
--replace_result mariadb-dump.exe mariadb-dump
|
||||
--error 1
|
||||
--exec $MYSQL_DUMP --xml --tab=$MYSQLTEST_VARDIR/tmp 2>&1
|
||||
|
||||
#
|
||||
# MDEV-32589 parallel-mysqldump - test "too many connections"
|
||||
#
|
||||
select @@max_connections into @save_max_connections;
|
||||
set global max_connections=10;
|
||||
--replace_result mariadb-dump.exe mariadb-dump
|
||||
--error 2
|
||||
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --parallel=20 mysql 2>&1
|
||||
#
|
||||
# MDEV-32589 test builtin 256 connections limit
|
||||
#
|
||||
set global max_connections=300;
|
||||
--replace_result mariadb-dump.exe mariadb-dump
|
||||
--error 1
|
||||
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --parallel=280 mysql 2>&1
|
||||
set global max_connections=@save_max_connections;
|
||||
|
||||
--echo #
|
||||
--echo # End of 11.4 tests
|
||||
--echo #
|
||||
|
@ -3399,6 +3399,9 @@ int select_export::send_data(List<Item> &items)
|
||||
uint used_length=0,items_left=items.elements;
|
||||
List_iterator_fast<Item> li(items);
|
||||
|
||||
DBUG_EXECUTE_IF("select_export_kill", {
|
||||
thd->killed= KILL_QUERY;
|
||||
});
|
||||
if (my_b_write(&cache,(uchar*) exchange->line_start->ptr(),
|
||||
exchange->line_start->length()))
|
||||
goto err;
|
||||
|
Reference in New Issue
Block a user