1
###############################################################################
2
# drizzledump_restore.test
4
# Purpose: Tests if drizzledump output can be used to successfully restore
6
# We CREATE a table, drizzledump it to a file, ALTER the original
7
# table's name, recreate the table from the drizzledump file, then
8
# utilize include/diff_tables to compare the original and recreated
11
# We use several examples from drizzledump.test here and include
12
# the relevant bug numbers and headers from that test.
14
# NOTE: This test is not currently complete and offers only basic
15
# cases of drizzledump output being restored.
16
# Also, does NOT work with -X (xml) output!
22
###############################################################################
24
#--source include/have_log_bin.inc
27
# Define drizzledumpfile here. It is used to capture drizzledump output
28
# in order to test the output's ability to restore an exact copy of the table
29
let $drizzledumpfile = $MYSQLTEST_VARDIR/tmp/drizzledumpfile.sql;
31
--echo # Pre-test cleanup
33
DROP TABLE IF EXISTS t1;
38
--echo # Bug#2005 Long decimal comparison bug.
40
CREATE TABLE t1 (a DECIMAL(64, 20));
41
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
42
("0987654321098765432109876543210987654321");
43
--exec $DRIZZLE_DUMP --compact test t1 > $drizzledumpfile
44
let $table_name = test.t1;
45
--source include/drizzledump.inc
48
--echo # Bug#3361 mysqldump quotes DECIMAL values inconsistently
50
CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
51
# Check at first how mysql work with quoted decimal
52
INSERT INTO t1 VALUES (1.2345, 2.3456);
53
INSERT INTO t1 VALUES ('1.2345', 2.3456);
54
INSERT INTO t1 VALUES ("1.2345", 2.3456);
55
INSERT INTO t1 VALUES (1.2345, 2.3456);
56
INSERT INTO t1 VALUES ('1.2345', 2.3456);
57
INSERT INTO t1 VALUES ("1.2345", 2.3456);
59
# check how drizzledump make quoting
60
--exec $DRIZZLE_DUMP --compact test t1 > $drizzledumpfile
61
let $table_name = test.t1;
62
--source include/drizzledump.inc
66
--echo # WL#2319 Exclude Tables from dump
68
CREATE TABLE t1 (a INT);
69
CREATE TABLE t2 (a INT);
70
INSERT INTO t1 VALUES (1),(2),(3);
71
INSERT INTO t2 VALUES (4),(5),(6);
72
--exec $DRIZZLE_DUMP --skip-comments --ignore-table=test.t1 test > $drizzledumpfile
73
let $table_name = test.t2;
74
--source include/drizzledump.inc
78
--echo # Bug#8830 mysqldump --skip-extended-insert causes --hex-blob to dump wrong values
80
CREATE TABLE t1 (`b` blob);
81
INSERT INTO `t1` VALUES (0x602010000280100005E71A);
82
--exec $DRIZZLE_DUMP --skip-extended-insert --hex-blob test --skip-comments t1 > $drizzledumpfile
83
let $table_name = test.t1;
84
--source include/drizzledump.inc
89
--echo # remove drizzledumpfile
91
--remove_file $drizzledumpfile