You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`CREATE TABLE `user` (
`email` varchar(255) NOT NULL,
`name` varchar(60) NOT NULL,
UNIQUE KEY `email` (`email`)
);
insert into user (email, name) values ("a","a");
insert into user (email, name) values ("b","b");
insert into user (email, name) values ("c","c");
---
rewrite:
user:
email: "bah"
name: '"foo"'
./bin/mtk-dump -h localhost -u root -padmin --config="mtk-local.yml" temp1
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
Getting table list...
Dumping structure for table user
--
-- Structure for table `user`
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`email` varchar(255) NOT NULL,
`name` varchar(60) NOT NULL,
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Data for table `user` -- 3 rows
--
LOCK TABLES `user` WRITE;
Dumping data for table user
UNLOCK TABLES;
SET FOREIGN_KEY_CHECKS = 1;
The rewrite rule is discarded because it create invalid SQL (ie unique key constraint).
Ideal would be to exit(1) with errors because I dont want to try and sanitize if its not going to fully sanitize.
It should be safe because the email is just concat but I am quite sure over the past year or so there have been numerous times where the rewrites weren't done and we had to manually run an update command afterwards. This is risky cause it also didn't update the other fields also (eg doemail=0).
Interestingly in my test above when it fails it seems to exclude the table data but again I dont think this is the behaviour I have seen when it fails above.
Thanks, this tool is fantastic.
The text was updated successfully, but these errors were encountered:
hi @nickschuch
The rewrite rule is discarded because it create invalid SQL (ie unique key constraint).
Ideal would be to exit(1) with errors because I dont want to try and sanitize if its not going to fully sanitize.
Currently we use this rule for example
It should be safe because the email is just concat but I am quite sure over the past year or so there have been numerous times where the rewrites weren't done and we had to manually run an update command afterwards. This is risky cause it also didn't update the other fields also (eg doemail=0).
Interestingly in my test above when it fails it seems to exclude the table data but again I dont think this is the behaviour I have seen when it fails above.
Thanks, this tool is fantastic.
The text was updated successfully, but these errors were encountered: