Skip to content
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

driver leaks bad $@ #51

Open
ralphiebaby opened this issue Mar 28, 2024 · 0 comments
Open

driver leaks bad $@ #51

ralphiebaby opened this issue Mar 28, 2024 · 0 comments

Comments

@ralphiebaby
Copy link

ralphiebaby commented Mar 28, 2024

Whenever the driver can't require a specific driver subclass, it sets "$@" to report this.
"$@" then leaks out, which creates a pitfall for any subsequent client code that is looking for errors.
in pre-0.42 DBIx::Connector, subsequent operations would usually clear the "$@" variable "accidentally" - but since 0.42, "$@" has been localised inside the try* subroutine's new TRY block which prevents them from accidentally unbuggering the global one.

I would recommend having the driver constructor unset $@ before returning, as this "error" resulting from falling back to the default driver is not something that calling code ever really needs to see (and if it needs to know its on the default driver, there are better ways to find out).

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

No branches or pull requests

1 participant