grabMariaDBClient reused global.MARIADB_CLIENT whenever the requested
config matched global.CONFIG. It never checked that the client was made
from that config or was still open. init() sets global.CONFIG before
creating the client, so a re-init after a close, or a config change, got
back a closed or wrong client.
- Remember the cache key each client was created with, and compare that
- Wrapping close() drops the client from the cache and unsets
global.MARIADB_CLIENT, so the next grab or ensureInit makes a new one
- resolveClient goes through grabMariaDBClient instead of repeating the
global.CONFIG comparison
- Remove the queue test's workaround for this
Co-Authored-By: Claude Opus 5.5 <[email protected]>