-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
odbc_pconnect fails with DSN and username/password with special characters #12251
Comments
Hi. I was able to set up the environment with docker and reproduce it. This problem occurs not only in 8.2 but also in 8.3 and master. It will take a little more time to determine the full cause, but it's very likely a side effect of the changes you mentioned. I'll write again if there is any progress. |
Code like the following will not generate any warnings and will connect:
I can't understand why it's designed like this. And even though the password I gave in the example doesn't require quotes, they are added and it appears that the authentication fails. |
Setting aside the fundamental spec issues for the moment, I made a pull request for a really small change for PHP-8.2 to fix the connection issue. |
It turns out that this phenomenon is most likely caused by FreeTDS, not php. |
FreeTDS fixed it. |
Going to close this as it seems to be a third party issue. Please open a new issue if neeeded. Thanks for looking into this @SakiTakamachi ! |
Thanks for the investigation @SakiTakamachi. 😄 I'll try to get around to testing it for our environment later this week or the next. |
Description
Hello, we're trying to upgrade from PHP 8.1 to PHP 8.2.10. We integrate with an MSSQL server using FreeTDS/unixODBC and ext/odbc. After upgrading, the same code that worked on PHP 8.1 now fails on PHP 8.2.
I assume that Quote when appending username and password to the ODBC connection string is the cause of my issue.
The following code:
Resulted in this output:
But I expected this output instead:
I can workaround the issue in my local development setup by creating an entry in
/etc/odbc.ini
and then only passing the section name to the$dsn
parrameter ofodbc_pconnect
like so:Ideally, it would help me the most if I can make it work as-is without any workaround. It's not practical (but not impossible) to apply the
/etc/odbc.ini
workaround in my infrastructure. It would delay our upgrade significantly though.Thank you in advance!
PHP Version
PHP 8.2.10
Operating System
RHEL 8.8, Debian Bullseye
The text was updated successfully, but these errors were encountered: