Repository navigation
Conversation
The caching_sha2_password scramble function was concatenating bytes in the wrong order when computing SHA256(SHA256(SHA256(password)) + nonce). The MySQL protocol requires SHA256(digest2 || nonce), but the code was computing SHA256(nonce || digest2), causing "Access denied" errors for users on MySQL 8.0+ with caching_sha2_password authentication. Fixes #26195 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Updated 8:34 AM PT - Jan 17th, 2026
❌ Your commit
🧪 To try this PR locally: bunx bun-pr 26196That installs a local version of the PR into your bun-26196 --bun |
WalkthroughFixes MySQL 8.0 caching_sha2_password authentication by changing the concatenation order in the scramble routine so the second digest is copied before the nonce, and adds a regression test verifying caching_sha2_password logins against a containerized MySQL instance. Changes
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@test/regression/issue/26195.test.ts`:
- Around line 21-28: The test double-closes the SQL instance: when using the
"await using sql = new SQL(...)" pattern the resource is automatically disposed
at scope end, so remove the explicit "await sql.end()" calls (references:
variable "sql" and method "end()" in this test) and rely on "await using" only;
update the other occurrences that match the same pattern (the blocks around
lines with the same pattern, e.g., the sections noted 33-42 and 45-48) to avoid
calling "end()" after "await using".
The `await using` syntax automatically disposes resources at scope end, making explicit `await sql.end()` calls unnecessary. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
I've tested this locally with but it doesn't fix #26195. |
|
Closing this PR because it has been inactive for more than 90 days. |
Summary
caching_sha2_passwordscramble functionSHA256(nonce || digest2)toSHA256(digest2 || nonce)per MySQL protocolTest plan
test/regression/issue/26195.test.tsthat testscaching_sha2_passwordauthentication on MySQL 8.0+caching_sha2_passwordby default) with both empty password and password-protected usersFixes #26195
🤖 Generated with Claude Code