summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysqldump.test
diff options
context:
space:
mode:
authorunknown <brian@zim.(none)>2005-11-24 09:56:40 -0800
committerunknown <brian@zim.(none)>2005-11-24 09:56:40 -0800
commitb0b86ec10bd885744a9e968784e564fdbe2373ea (patch)
tree8f75754c4a3d76cf6e524d860fe5dd2ded08ff46 /mysql-test/t/mysqldump.test
parent817ee181c34d53caf2179a978c35c685437fb756 (diff)
downloadmariadb-git-b0b86ec10bd885744a9e968784e564fdbe2373ea.tar.gz
Its funny, I am reading through the forums and someone asks "Can I please have a REPLACE INTO, instead an INSERT INTO?" and I remember how often I have used a sed script to modify MySQL dumps to have exactly that.
So, use --replace and instead of getting INSERT INTO you will INSTEAD get REPLACE INTO. Buyer beward, REPLACE is a MySQL SQL, so you will not end up with a dump that can be used for other databases. Though I hear you could just use a sed line to modify it back :) client/client_priv.h: New option for --replace client/mysqldump.c: Added option for REPLACE INTO instead of INSERT INTO mysql-test/r/mysqldump.result: Updated REsultes for replace into mysql-test/t/mysqldump.test: Added new test for --replace
Diffstat (limited to 'mysql-test/t/mysqldump.test')
-rw-r--r--mysql-test/t/mysqldump.test14
1 files changed, 13 insertions, 1 deletions
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 83085823729..55bc29d6c59 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -994,8 +994,20 @@ create view v2 as select * from v0;
select * from v2;
--exec $MYSQL_DUMP -x --skip-comments --databases test
-
drop view v2;
drop view v0;
drop view v1;
drop table t1;
+
+# Check new --replace option
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+CREATE TABLE t1(a int, b int);
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (2,3);
+INSERT INTO t1 VALUES (3,4), (4,5);
+--exec $MYSQL_DUMP --replace --skip-comments test t1
+DROP TABLE t1;