xelabs / go-mydumper

A multi-threaded MySQL backup and restore tool, faster than mysqldump
GNU General Public License v3.0
346 stars 100 forks source link

Add option to dump with "INSERT IGNORE" #21

Closed palicao closed 4 years ago

palicao commented 5 years ago

Add an option, similar to the one available in mydumper, to dump the content using INSERT IGNORE instead of INSERT.

codecov[bot] commented 5 years ago

Codecov Report

Merging #21 into master will decrease coverage by 0.41%. The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
- Coverage   95.56%   95.15%   -0.42%     
==========================================
  Files           5        5              
  Lines         451      454       +3     
==========================================
+ Hits          431      432       +1     
- Misses         10       11       +1     
- Partials       10       11       +1
Impacted Files Coverage Δ
src/common/common.go 86.36% <ø> (ø) :arrow_up:
src/common/dumper.go 96% <60%> (-1.55%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update af49192...c401f19. Read the comment docs.

BohuTANG commented 5 years ago

Hi @palicao ,

Welcome~ This patch needs test cases to make the travis CI happy.

palicao commented 5 years ago

Yes, I wanted to add some but I realized that it would have needed some refactoring to do it efficiently. What do you think? Should I just run the same test twice, with and without the "ignore" flag? Or maybe is it worth to add some unit tests only for specific parts?

BohuTANG commented 5 years ago

Hi palicao, Feel free to write your test suite here. The test suite aims to coverage this patch around.