yannh / redis-dump-go

Backup & Restore your Redis server - FAST
MIT License
274 stars 58 forks source link

fixed cmd join bug and hset bug #17

Closed boolw closed 2 years ago

yannh commented 3 years ago

Hi @boolw :wave: Seems promising, could you maybe make a different PR for just the HSET/HMSET fix and explain a bit what the bug was? Same for the Join bug? I would probably want to add a test for those before merging, though once I understand what the fixes do I can write those ;)

Thanks a lot!

boolw commented 3 years ago

test: redis-cli hmset "test map" "key name1" "key value 1" "key name2" "key value 2"

./redis-dump-go -output commands > commands.output redis-cli < commands.output

yannh commented 3 years ago

Hi @boolw, I've pushed out a fix and a test that is derived from your PR: https://github.com/yannh/redis-dump-go/blob/5723398d075a8ac46fd0c5deb0191ebb9730430a/redisdump/redisdump_test.go#L129

It only adds quotes when the field key/value contains a space... Otherwise I'm not sure it would play well everywhere. LMK what you think, and thanks a lot for the bug report :rocket: