Add comprehensive tests for MySQL password special character handling #632
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses issue #246 regarding special symbols in MySQL database passwords. After thorough investigation, I discovered that the issue has already been resolved in the current codebase.
Investigation Results
The original issue reported that the MySQL connector failed when database passwords contained special symbols like spaces. The suggested fix was to manually add quotes around passwords:
However, the current implementation already uses a superior approach:
The
utils.get_escaped_command_arg()function wraps Python'sshlex.quote(), which properly handles all edge cases including:"my password"→'my password'"pass!@#$%^&*()"→ properly escaped"pass'word\"test"→ safely quoted to handle internal quotes"pass;word&command"→ properly escapedChanges Made
Since the core issue was already resolved, this PR adds comprehensive test coverage to prevent regression:
_create_dumpand_restore_dumpmethods with various special character scenariosAll 270 tests pass, confirming that the current implementation correctly handles passwords with special characters throughout the entire processing flow.
Fixes #246.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.