Skip to content

Instantly share code, notes, and snippets.

@morgo
Created October 10, 2018 14:20
Show Gist options
  • Save morgo/38b7562fcea4f9839433afd7503d8099 to your computer and use it in GitHub Desktop.
Save morgo/38b7562fcea4f9839433afd7503d8099 to your computer and use it in GitHub Desktop.
mydumper-test-case
MySQL [test]> create table t1 (a int not null primary key auto_increment, b char(255));
Query OK, 0 rows affected (0.51 sec)
MySQL [test]> create table t2 (a char(255) not null primary key, b char(255));
Query OK, 0 rows affected (0.51 sec)
MySQL [test]> INSERT INTO t1 values (1, 'aaa');
Query OK, 1 row affected (0.15 sec)
MySQL [test]> INSERT INTO t2 values ('aaa', 'aaa');
Query OK, 1 row affected (0.09 sec)
tocker@penguin:~/go/src/github.com/pingcap/mydumper$ ./mydumper
tocker@penguin:~/go/src/github.com/pingcap/mydumper$ cd export-20181010-141831/
tocker@penguin:~/go/src/github.com/pingcap/mydumper/export-20181010-141831$ more test.t1.sql
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO `t1` VALUES
(1,"aaa");
tocker@penguin:~/go/src/github.com/pingcap/mydumper/export-20181010-141831$ more test.t2.sql
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO `t2` (`a`,`b`,`_tidb_rowid`) VALUES
("aaa","aaa",1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment