Connection::quote() can only quote strings#3488
Merged
Ocramius merged 3 commits intodoctrine:developfrom Mar 16, 2019
Merged
Conversation
Ocramius
approved these changes
Mar 16, 2019
Member
|
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
Member
Author
I thought it was due to some implementations of Those issues are still to be reported and address later. |
morozov
pushed a commit
that referenced
this pull request
Mar 18, 2019
Connection::quote() can only quote strings
morozov
pushed a commit
that referenced
this pull request
Apr 16, 2019
Connection::quote() can only quote strings
morozov
pushed a commit
that referenced
this pull request
May 6, 2019
Connection::quote() can only quote strings
morozov
pushed a commit
that referenced
this pull request
May 23, 2019
Connection::quote() can only quote strings
morozov
pushed a commit
to morozov/dbal
that referenced
this pull request
May 31, 2019
Connection::quote() can only quote strings
This was referenced Jun 6, 2019
morozov
pushed a commit
that referenced
this pull request
Jun 13, 2019
Connection::quote() can only quote strings
morozov
pushed a commit
that referenced
this pull request
Jun 27, 2019
Connection::quote() can only quote strings
morozov
pushed a commit
that referenced
this pull request
Jun 27, 2019
Connection::quote() can only quote strings
morozov
pushed a commit
that referenced
this pull request
Jun 27, 2019
Connection::quote() can only quote strings
morozov
pushed a commit
to morozov/dbal
that referenced
this pull request
Aug 26, 2019
Connection::quote() can only quote strings
morozov
pushed a commit
that referenced
this pull request
Nov 2, 2019
Connection::quote() can only quote strings
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The signature of
Connection::quote()allowsmixed $inputandint $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
mixedtype, the method acceptsnullbut implicitly converts it to astringwhich is unacceptable in the SQL context. Enforcing the accepted type tostringhelped 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.