fix: register MySQL UDFs once per database - #469
Merged
Conversation
leon-ape
approved these changes
Aug 22, 2026
leon-ape
left a comment
Collaborator
There was a problem hiding this comment.
Independent source review of exact signed head 1babe03 (parent 9767800, tree d29c8bf7c003aa9876b3ab4ca62603d60477218c): no findings. The per-pool sync.Once matches DuckDB catalog-level UDF lifetime, Reset reinitializes the state for a fresh connector, and regression coverage exercises multiple physical connections, churn, reset, both UDFs, and the first real MySQL query.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
mysql_randandmysql_random_bytesDuckDB scalar UDFs once per shared database catalog instead of once per pooled physical connectionReproduction
On exact main
9767800a, the new multi-connection regression failed on the second physical connection with:Verification
go test -race ./catalog -run '^TestConnectionPoolRegistersMySQLUDFsOnce$' -count=1 -vgo test ./catalog -count=1go test ./pgserver -run '^TestIssue280RepeatedConnectMySQLDatabase$' -count=1go test ./pgserver -run '^TestIssue341PgAuthRejectsWrongPassword$' -count=1go test ./backend ./transpiler -count=1go test ./charset ./harness ./flightsqltest -count=1go vet ./cataloggo build ./...