File: mysqlpump_bugs.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (180 lines) | stat: -rw-r--r-- 5,792 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# One of the tests requires Perl Expect module, not present on Windows
--source include/not_windows.inc

--echo #
--echo # Bug#23102944: MYSQLPUMP LEAKS MEMORY IN CASE OF ERRORS.
--echo #

--echo # testing a failed connection: must not crash
--replace_regex /\([-0-9]*\) while connecting/(errno) while connecting/
--exec $MYSQL_PUMP --host=non_existent_ghost --add-locks 2>&1
--echo # testing an invalid option: must not crash
--replace_regex /\([-0-9]*\) while connecting/(errno) while connecting/
--exec $MYSQL_PUMP --host=non_existent_ghost --parallelism=3 2>&1

--echo #
--echo # Bug#29389828: CRASH WHEN TILDE EXPANSION USED IN --RESULT-FILE PATH
--echo #

--echo # report error when tilde is used in file name
--error 2
--exec $MYSQL_PUMP --result-file=~/dump.sql


--echo #
--echo # Bug #29343073: MYSQLPUMP DUMPS GRANT TABLES THAT IT SHOULD NOT
--echo #

--exec $MYSQL_PUMP --skip-dump-rows --exclude-tables=ndb_binlog_index mysql > $MYSQLTEST_VARDIR/tmp/bug29343073.sql

--let $assert_text=Should not contain mysql.role_edges
--let $assert_file=$MYSQLTEST_VARDIR/tmp/bug29343073.sql
--let $assert_select=CREATE TABLE `mysql`.`role_edges`
--let $assert_count=0
--source include/assert_grep.inc

--let $assert_text=Should not contain mysql.global_grants
--let $assert_file=$MYSQLTEST_VARDIR/tmp/bug29343073.sql
--let $assert_select=CREATE TABLE `mysql`.`mysql_global_grants`
--let $assert_count=0
--source include/assert_grep.inc

--let $assert_text=Should not contain mysql.default_roles
--let $assert_file=$MYSQLTEST_VARDIR/tmp/bug29343073.sql
--let $assert_select=CREATE TABLE `mysql`.`default_roles`
--let $assert_count=0
--source include/assert_grep.inc

--let $assert_text=Should contain mysql.password_history
--let $assert_file=$MYSQLTEST_VARDIR/tmp/bug29343073.sql
--let $assert_select=CREATE TABLE `mysql`.`password_history`
--let $assert_count=1
--source include/assert_grep.inc

--echo Test: dump of mysql database should not contain unexpected tables
--let $grep_file=$MYSQLTEST_VARDIR/tmp/bug29343073.sql
--let $grep_pattern=CREATE TABLE
--source include/grep_pattern.inc

--remove_file $MYSQLTEST_VARDIR/tmp/bug29343073.sql

--echo #
--echo # Bug #83144: mysqlpump reads mysql_dump group, not mysqlpump in config-group
--echo #

--write_file $MYSQLTEST_VARDIR/tmp/bug83144.cnf
[mysqlpump]
exclude_databases=db1,mysql,mtr
EOF

CREATE DATABASE db1;
CREATE DATABASE db2;

--exec $MYSQLPUMP --defaults-extra-file=$MYSQLTEST_VARDIR/tmp/bug83144.cnf --host=127.0.0.1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -uroot > $MYSQLTEST_VARDIR/tmp/bug83144.dump

DROP DATABASE db1;
DROP DATABASE db2;

--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug83144.dump

SHOW DATABASES like 'db%';

#cleanup
DROP DATABASE db2;
--remove_file $MYSQLTEST_VARDIR/tmp/bug83144.cnf
--remove_file $MYSQLTEST_VARDIR/tmp/bug83144.dump


--echo #
--echo # Bug #32067013: MYSQLPUMP SEGMENTATION FAULT
--echo #

CREATE DATABASE B32067013;
CREATE TABLE B32067013.t1(v1 INT, v2 INT);
CREATE TABLE B32067013.t2(v1 INT, v2 INT);
CREATE VIEW B32067013.t123 AS SELECT * FROM B32067013.t1;
DROP TABLE B32067013.t1;

--echo # Test criteria: shouldn't crash
--error 76,1356
--exec $MYSQL_PUMP --all-databases > $MYSQLTEST_VARDIR/tmp/bug32067013.dump 2>&1

#cleanup
DROP DATABASE B32067013;
--remove_file $MYSQLTEST_VARDIR/tmp/bug32067013.dump

--echo #
--echo # Bug#32340208: MYSQLPUMP SEGFAULT WHEN DUMPING 2 TABLES
--echo #

# TODO: Remove if the below CREATE TABLE doesn't garble the FRM file
--disable_query_log
CALL mtr.add_suppression("Incorrect information in file");
--enable_query_log


SET sql_mode ='';
CREATE DATABASE B32340208;
CREATE TABLE B32340208.test (
  `pk` int NOT NULL AUTO_INCREMENT,
  `a1` smallint GENERATED ALWAYS AS (((0 <> `c1`) and (_utf8mb4'0000-00-00
00:00:00' <> `d1`))) VIRTUAL NOT SECONDARY,
  `b1` char(8) DEFAULT NULL,
  `c1` longblob NOT NULL NOT SECONDARY,
  `d1` timestamp NOT NULL,
  PRIMARY KEY (`pk`),
  KEY `functional_index` ((radians(`c1`))) USING BTREE COMMENT 'you''re'
) ENGINE=InnoDB DEFAULT CHARSET=euckr;

--echo # Success criteria: should not crash
--error ER_WRONG_VALUE, 245
--exec $MYSQL_PUMP --all-databases > $MYSQLTEST_VARDIR/tmp/bug32340208.dump 2>&1

#cleanup
DROP DATABASE B32340208;
--remove_file $MYSQLTEST_VARDIR/tmp/bug32340208.dump
SET sql_mode = DEFAULT;

-- echo #
-- echo # Bug #33688141 mysqlpump exits in regards to 'std::logic_error'
-- echo #

# Write configuration with password not specified
--write_file $MYSQLTEST_VARDIR/tmp/bug33688141.cnf
[mysqlpump]
exclude_databases=db1,mysql,mtr
EOF

# No $ sign before the name to make it visible in Perl code below
--let MYSQLPUMP_ARGS = --defaults-file=$MYSQLTEST_VARDIR/tmp/bug33688141.cnf -uroot -p
--let MYSQLPUMP_LOG = $MYSQL_TMP_DIR/bug33688141.txt

# Start a mysqlpump and interactively fill up the dummy password.
# Mysqlpump should exit cleanly with "Dump process encountered error and will not continue."
--perl
use strict;
require Expect;

# Start the mysqlpump client
# The client should enter password prompt, we'll type a password 'a'.
# Use "log_stdout(0)" to avoid leaking output to record file because it may contain timestamps and custom paths.
my $texp = new Expect();
$texp->raw_pty(1);
$texp->log_stdout(0);
$texp->log_file("$ENV{MYSQLPUMP_LOG}", "w");
$texp->spawn("$ENV{MYSQLPUMP} $ENV{MYSQLPUMP_ARGS}");
$texp->expect(15,' -re ',[ 'Enter password:' => sub {
    $texp->send("a\n");}]) or die "Error sending the password";
$texp->soft_close();
EOF

--echo # Expect log that proves the client clean exit
--let SEARCH_FILE = $MYSQLPUMP_LOG
--let SEARCH_PATTERN=Dump process encountered error and will not continue.
--source include/search_pattern.inc

# cleanup for Bug #33688141
--remove_file $MYSQLPUMP_LOG
--remove_file $MYSQLTEST_VARDIR/tmp/bug33688141.cnf

--echo # End of 8.0 tests