2003-09-19 14:02:49 +05:00
|
|
|
|
--disable_warnings
|
2005-01-03 21:04:33 +02:00
|
|
|
|
DROP TABLE IF EXISTS t1, `"t"1`, t1aa,t2aa;
|
2004-12-31 17:59:43 +01:00
|
|
|
|
drop database if exists mysqldump_test_db;
|
2003-09-19 14:02:49 +05:00
|
|
|
|
--enable_warnings
|
|
|
|
|
|
|
|
|
|
# XML output
|
|
|
|
|
|
|
|
|
|
CREATE TABLE t1(a int);
|
|
|
|
|
INSERT INTO t1 VALUES (1), (2);
|
2004-04-27 15:33:40 +03:00
|
|
|
|
--exec $MYSQL_DUMP --skip-create --skip-comments -X test t1
|
2003-09-24 16:13:47 +05:00
|
|
|
|
DROP TABLE t1;
|
2003-12-09 17:33:29 +04:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Bug #2005
|
|
|
|
|
#
|
|
|
|
|
|
2005-02-09 02:50:45 +04:00
|
|
|
|
CREATE TABLE t1 (a decimal(64, 20));
|
2003-12-11 17:37:45 +04:00
|
|
|
|
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
|
|
|
|
|
("0987654321098765432109876543210987654321");
|
2004-04-27 15:33:40 +03:00
|
|
|
|
--exec $MYSQL_DUMP --compact test t1
|
2003-12-11 17:37:45 +04:00
|
|
|
|
DROP TABLE t1;
|
2003-12-09 17:33:29 +04:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Bug #2055
|
|
|
|
|
#
|
|
|
|
|
|
2003-12-11 17:37:45 +04:00
|
|
|
|
CREATE TABLE t1 (a double);
|
2004-10-07 16:18:27 +03:00
|
|
|
|
INSERT INTO t1 VALUES ('-9e999999');
|
2003-12-14 21:31:02 +01:00
|
|
|
|
# The following replaces is here because some systems replaces the above
|
|
|
|
|
# double with '-inf' and others with MAX_DOUBLE
|
|
|
|
|
--replace_result (-1.79769313486232e+308) (RES) (NULL) (RES)
|
2004-04-27 15:33:40 +03:00
|
|
|
|
--exec $MYSQL_DUMP --compact test t1
|
2003-12-11 17:37:45 +04:00
|
|
|
|
DROP TABLE t1;
|
2004-04-05 23:18:16 +05:00
|
|
|
|
|
|
|
|
|
#
|
2004-04-27 15:33:40 +03:00
|
|
|
|
# Bug #3361 mysqldump quotes DECIMAL values inconsistently
|
2004-04-05 23:18:16 +05:00
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
|
|
|
|
|
|
|
|
|
|
# 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);
|
|
|
|
|
|
2004-04-26 15:53:31 +03:00
|
|
|
|
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);
|
|
|
|
|
--error 1054
|
|
|
|
|
INSERT INTO t1 VALUES ("1.2345", 2.3456);
|
|
|
|
|
SET SQL_MODE=@OLD_SQL_MODE;
|
2004-04-05 23:18:16 +05:00
|
|
|
|
|
|
|
|
|
# check how mysqldump make quoting
|
2004-04-27 15:33:40 +03:00
|
|
|
|
--exec $MYSQL_DUMP --compact test t1
|
|
|
|
|
--exec $MYSQL_DUMP --compact --skip-create test t1
|
|
|
|
|
--exec $MYSQL_DUMP --skip-create --skip-comments test t1
|
|
|
|
|
--exec $MYSQL_DUMP --skip-opt --extended-insert --skip-comments test t1
|
2003-09-19 14:02:49 +05:00
|
|
|
|
DROP TABLE t1;
|
2003-10-31 11:29:57 +04:00
|
|
|
|
|
2003-11-03 16:49:39 +04:00
|
|
|
|
CREATE TABLE t1(a int, b text, c varchar(3));
|
|
|
|
|
INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
|
2004-04-27 15:33:40 +03:00
|
|
|
|
--exec $MYSQL_DUMP --skip-create --compact -X test t1
|
2003-11-03 16:49:39 +04:00
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
|
2003-10-31 11:29:57 +04:00
|
|
|
|
#
|
|
|
|
|
# Bug #1707
|
|
|
|
|
#
|
|
|
|
|
|
2003-11-05 12:06:03 +04:00
|
|
|
|
CREATE TABLE t1 (`a"b"` char(2));
|
|
|
|
|
INSERT INTO t1 VALUES ("1\""), ("\"2");
|
2004-04-27 15:33:40 +03:00
|
|
|
|
--exec $MYSQL_DUMP --compact --skip-create -X test t1
|
2003-11-05 12:06:03 +04:00
|
|
|
|
DROP TABLE t1;
|
2003-12-09 15:28:58 +04:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Bug #1994
|
2004-06-23 21:46:17 +02:00
|
|
|
|
# Bug #4261
|
2003-12-09 15:28:58 +04:00
|
|
|
|
#
|
|
|
|
|
|
2003-12-10 15:27:33 +04:00
|
|
|
|
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
|
2004-06-23 21:46:17 +02:00
|
|
|
|
INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
|
|
|
|
|
--exec $MYSQL_DUMP --skip-comments --skip-extended-insert test t1
|
2003-12-09 15:28:58 +04:00
|
|
|
|
DROP TABLE t1;
|
2004-02-05 02:30:28 +00:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Bug #2634
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a int) ENGINE=MYISAM;
|
|
|
|
|
INSERT INTO t1 VALUES (1), (2);
|
|
|
|
|
--exec $MYSQL_DUMP --skip-comments --compatible=mysql40 test t1
|
|
|
|
|
--exec $MYSQL_DUMP --skip-comments --compatible=mysql323 test t1
|
|
|
|
|
DROP TABLE t1;
|
2004-02-10 18:56:43 +04:00
|
|
|
|
|
|
|
|
|
#
|
2004-04-27 15:33:40 +03:00
|
|
|
|
# Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
|
2004-02-07 02:22:12 +04:00
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
create table ```a` (i int);
|
2004-04-27 15:33:40 +03:00
|
|
|
|
--exec $MYSQL_DUMP --compact test
|
2004-02-10 18:44:27 +04:00
|
|
|
|
drop table ```a`;
|
2004-02-14 01:21:46 +04:00
|
|
|
|
|
2004-03-11 18:46:27 +04:00
|
|
|
|
#
|
|
|
|
|
# Bug #2591 "mysqldump quotes names inconsistently"
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
create table t1(a int);
|
|
|
|
|
--exec $MYSQL_DUMP --comments=0 test
|
|
|
|
|
--exec $MYSQL_DUMP --comments=0 --compatible=ansi test
|
|
|
|
|
set global sql_mode='ANSI_QUOTES';
|
|
|
|
|
--exec $MYSQL_DUMP --comments=0 test
|
|
|
|
|
--exec $MYSQL_DUMP --comments=0 --compatible=ansi test
|
|
|
|
|
set global sql_mode='';
|
|
|
|
|
drop table t1;
|
2004-03-11 22:01:25 +04:00
|
|
|
|
|
2004-02-14 01:21:46 +04:00
|
|
|
|
#
|
|
|
|
|
# Bug #2705 'mysqldump --tab extra output'
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
create table t1(a int);
|
|
|
|
|
insert into t1 values (1),(2),(3);
|
|
|
|
|
--exec $MYSQL_DUMP --skip-comments --tab=$MYSQL_TEST_DIR/var/tmp/ test
|
|
|
|
|
--exec cat $MYSQL_TEST_DIR/var/tmp/t1.sql
|
|
|
|
|
--exec cat $MYSQL_TEST_DIR/var/tmp/t1.txt
|
|
|
|
|
--exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql
|
|
|
|
|
--exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt
|
|
|
|
|
--exec $MYSQL_DUMP --tab=$MYSQL_TEST_DIR/var/tmp/ test
|
|
|
|
|
--exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql
|
|
|
|
|
--exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt
|
|
|
|
|
drop table t1;
|
2004-09-26 19:00:55 +03:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# dump of view
|
|
|
|
|
#
|
|
|
|
|
create table t1(a int);
|
|
|
|
|
create view v1 as select * from t1;
|
2004-09-28 12:31:33 +03:00
|
|
|
|
--exec $MYSQL_DUMP --skip-comments test
|
2004-09-26 19:00:55 +03:00
|
|
|
|
drop view v1;
|
|
|
|
|
drop table t1;
|
2004-11-30 10:10:40 -08:00
|
|
|
|
|
2004-10-19 11:00:44 +05:00
|
|
|
|
#
|
|
|
|
|
# Bug #6101: create database problem
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
--exec $MYSQL_DUMP --skip-comments --databases test
|
2004-11-30 13:19:35 +04:00
|
|
|
|
|
|
|
|
|
create database mysqldump_test_db character set latin2 collate latin2_bin;
|
|
|
|
|
--exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db;
|
|
|
|
|
drop database mysqldump_test_db;
|
2004-12-22 16:02:27 +04:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Bug #7020
|
|
|
|
|
# Check that we don't dump in UTF8 in compatible mode by default,
|
|
|
|
|
# but use the default compiled values, or the values given in
|
|
|
|
|
# --default-character-set=xxx. However, we should dump in UTF8
|
|
|
|
|
# if it is explicitely set.
|
|
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a CHAR(10));
|
|
|
|
|
INSERT INTO t1 VALUES (_latin1 '<27><><EFBFBD><EFBFBD>');
|
2004-12-23 13:52:25 +04:00
|
|
|
|
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
|
2005-03-03 15:43:00 +04:00
|
|
|
|
#
|
|
|
|
|
# Bug#8063: make test mysqldump [ fail ]
|
|
|
|
|
# We cannot tes this command because its output depends
|
|
|
|
|
# on --default-character-set incompiled into "mysqldump" program.
|
|
|
|
|
# If the future we can move this command into a separate test with
|
|
|
|
|
# checking that "mysqldump" is compiled with "latin1"
|
|
|
|
|
#
|
|
|
|
|
#--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 test t1
|
2004-12-23 13:52:25 +04:00
|
|
|
|
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1
|
|
|
|
|
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1
|
|
|
|
|
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1
|
2004-12-22 16:02:27 +04:00
|
|
|
|
DROP TABLE t1;
|
2004-12-27 19:10:30 +01:00
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# WL #2319: Exclude Tables from dump
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
DROP TABLE t2;
|