-
-
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
Connection::quote() can only quote strings #3488
Conversation
Patch looks good, but CI is still unhappy with it |
22b36a9
to
6d24a3b
Compare
1. The argument is always available since the method is only called from listTableIndexes() which requires a table name. 2. The argument itself seems a workaround and only needed to bypass the fact that the SQLiteSchemaManager violates the method contract: instead of reformatting the provided data it fetches more data from the DB schema which requires a table name. This argument should be dropped completely later.
6d24a3b
to
9a70b30
Compare
I thought it was due to some implementations of Those issues are still to be reported and address later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 🚢
Connection::quote() can only quote strings
Connection::quote() can only quote strings
Connection::quote() can only quote strings
Connection::quote() can only quote strings
Connection::quote() can only quote strings
Connection::quote() can only quote strings
Connection::quote() can only quote strings
Connection::quote() can only quote strings
Connection::quote() can only quote strings
Connection::quote() can only quote strings
Connection::quote() can only quote strings
The signature of
Connection::quote()
allowsmixed $input
andint $type
. On the one hand, not all drivers support all existing types, on the other hand, from the SQL perspective, it doesn't make any sense to quote anything else than a string.As part of the
mixed
type, the method acceptsnull
but implicitly converts it to astring
which is unacceptable in the SQL context. Enforcing the accepted type tostring
helped reveal a few bugs (to be reported later, see the test failures).The wrapper connection also supports DBAL types which in the absence of the sense in driver-level types in the escaping context boils down to just converting the value to a PHP value which may not even be a string. Besides being redundant, this functionality doesn't have any test coverage.
It's proposed to keep
Connection::quote()
responsible only for quoting strings.