-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support true VARCHAR binding to prevent implicit conversions? #4263
Comments
I believe it would be a valuable addition. Note that the direct usage of PDO with DBAL is deprecated (see |
Started working on this here @morozov: https://github.com/doctrine/dbal/pull/4270/files#diff-0abfe812e47f01473ac9b172da2d2c3cR87 Please let me know if this is close to what you had in mind. |
I didn't know it could be tested like this but this way looks good. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
Summary
PHP 7.2 added support for specifying different bind types for unicode and non-unicode string data: https://wiki.php.net/rfc/extended-string-types-for-pdo
This is a major improvement over the default (PDO::PARAM_STR) which binds strings as unicode data. In the past, the inability for PHP to handle this has led to performance problems in certain cases. For example if we have something like:
If there's an index on
myVarcharColumn
SQL won't be able to use the index effectively since the binding will be an NVARCHAR string and force an implicit conversation.Does the team have a plan to support this binding in the future? We actually implemented this internally in a wrapper we have DBAL. I'm happy to open a PR if the team supports this feature:
The text was updated successfully, but these errors were encountered: