Skip to content

Try refactor wp db query --defaults handling, fix #237 #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lkraav
Copy link

@lkraav lkraav commented Jun 26, 2025

Try fix #237

Code change is all Copilot.

I reviewed it for general sanity, but I simply don't know enough wp db internals to know whether this direction is where we want to go.

But I'll file this anyway to get movement and directional discussion going.

I feel like currently wp db query just doing --no-defaults basically hard-coded is overly naive for many real world use cases, and needs to be refactored no matter what. If you can't even connect to remote SSL-secured databases, I'm not sure how we can ignore this in 2025.

My Copilot strategy session can be reviewed at lkraav#2

EDIT I've now also tested it, and this PR does make at least --defaults and/or --ssl-verify-server-cert work.

Copilot AI and others added 3 commits June 26, 2025 15:33
Co-authored-by: lkraav <147228+lkraav@users.noreply.github.com>
- Replace empty foreach loop in get_current_sql_modes() with proper MySQL argument preservation using get_mysql_args()
- Add ssl-verify-server-cert to allowed MySQL options list
- Add test case to verify connection arguments are preserved during SQL mode discovery
- Fixes issue where connection flags like --ssl-verify-server-cert were lost during SQL mode discovery

Co-authored-by: lkraav <147228+lkraav@users.noreply.github.com>
@lkraav lkraav requested a review from a team as a code owner June 26, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

query with "--default"-flag fails when discovering the SQL mode
2 participants