summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorPatrick Crews <patrick.crews@sun.com>2009-05-22 10:38:17 -0400
committerPatrick Crews <patrick.crews@sun.com>2009-05-22 10:38:17 -0400
commite42f28192d582ec84cd62066a6ce0fb83e32ad0b (patch)
tree3a605894fb2abe775aef339ab3e0c844429e60b1 /mysql-test/t
parent2a47699cad56952ff5d22e18b080a2aacf4c91b4 (diff)
downloadmariadb-git-e42f28192d582ec84cd62066a6ce0fb83e32ad0b.tar.gz
Bug#40465 - mysqldump.test does no checking of dump or restore
Created new .test file - mysqldump_restore that does test restore from mysqldump output for a limited number of basic cases. Create new .inc file - mysqldump.inc - renames original table and uses mysqldump output to recreate the table, then uses diff_tables.inc to compare the two tables. Backported include/diff_tables.inc to facilitate this testing. New patch incorporating review feedback prior to push. mysqldump.test - removed redundant call to include/have_log_bin.inc (was used twice in the test!)
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/mysqldump.test1
-rw-r--r--mysql-test/t/mysqldump_restore.test21
2 files changed, 6 insertions, 16 deletions
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 1e9090fdd01..1aceb113b65 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1,6 +1,5 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
---source include/have_log_bin.inc
# Binlog is required
--source include/have_log_bin.inc
diff --git a/mysql-test/t/mysqldump_restore.test b/mysql-test/t/mysqldump_restore.test
index c5220e5de69..835ee3ee9e9 100644
--- a/mysql-test/t/mysqldump_restore.test
+++ b/mysql-test/t/mysqldump_restore.test
@@ -1,5 +1,6 @@
###############################################################################
# mysqldump_restore.test
+#
# Purpose: Tests if mysqldump output can be used to successfully restore
# tables and data.
# We CREATE a table, mysqldump it to a file, ALTER the original
@@ -35,15 +36,14 @@ let $mysqldumpfile = $MYSQLTEST_VARDIR/tmp/mysqldumpfile.sql;
--echo # Pre-test cleanup
--disable_warnings
-DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t1;
--enable_warnings
--echo # Begin tests
--echo #
--echo # Bug#2005 Long decimal comparison bug.
--echo #
-
-CREATE TABLE t1 (a decimal(64, 20));
+CREATE TABLE t1 (a DECIMAL(64, 20));
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
("0987654321098765432109876543210987654321");
--exec $MYSQL_DUMP --compact test t1 > $mysqldumpfile
@@ -53,15 +53,11 @@ let $table_name = test.t1;
--echo #
--echo # Bug#3361 mysqldump quotes DECIMAL values inconsistently
--echo #
-
CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
-
-# check at first how mysql work with quoted decimal
-
+# Check at first how mysql work with quoted decimal
INSERT INTO t1 VALUES (1.2345, 2.3456);
INSERT INTO t1 VALUES ('1.2345', 2.3456);
INSERT INTO t1 VALUES ("1.2345", 2.3456);
-
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI_QUOTES';
INSERT INTO t1 VALUES (1.2345, 2.3456);
INSERT INTO t1 VALUES ('1.2345', 2.3456);
@@ -78,7 +74,6 @@ let $table_name = test.t1;
--echo # Bug#1994 mysqldump does not correctly dump UCS2 data
--echo # Bug#4261 mysqldump 10.7 (mysql 4.1.2) --skip-extended-insert drops NULL from inserts
--echo #
-
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
--exec $MYSQL_DUMP --skip-comments --skip-extended-insert test t1 > $mysqldumpfile
@@ -88,9 +83,8 @@ let $table_name = test.t1;
--echo #
--echo # WL#2319 Exclude Tables from dump
--echo #
-
-CREATE TABLE t1 (a int);
-CREATE TABLE t2 (a int);
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t2 VALUES (4),(5),(6);
--exec $MYSQL_DUMP --skip-comments --ignore-table=test.t1 test > $mysqldumpfile
@@ -101,15 +95,12 @@ DROP TABLE t1;
--echo #
--echo # Bug#8830 mysqldump --skip-extended-insert causes --hex-blob to dump wrong values
--echo #
-
CREATE TABLE t1 (`b` blob);
INSERT INTO `t1` VALUES (0x602010000280100005E71A);
--exec $MYSQL_DUMP --skip-extended-insert --hex-blob test --skip-comments t1 > $mysqldumpfile
let $table_name = test.t1;
--source include/mysqldump.inc
-
-
--echo # End tests
--echo # Cleanup