Repository navigation
Conversation
…ntegers AbstractPlatform no longer declares quoteValue(), so the base carries no driver concept and cannot pretend a driver may be absent. PlatformInterface already requires the method, so every platform states its own policy: the three drivers ask their driver, Sql92 states that it cannot quote and throws. That also removes the guard's real defect. quoteValue() fell back to dialect-agnostic backslash escaping whenever the driver could not answer, which is what happens before a connection is opened, so an untrusted value silently received the weaker treatment. Select rendered limit and offset through quoteValue(), producing LIMIT '10'. A limit is a non-negative integer, not a value: MySQL, PostgreSQL and SQLite accept the quoted form only by coercing an unknown literal, while SQL Server's OFFSET and Oracle's OFFSET and FETCH take an integer constant or bind parameter and reject a string. The prepared path already binds them as integers, so the unprepared path now renders the same integer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Nov 28, 2026
This was referenced Nov 30, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Makes value quoting a decision each platform states, and stops quoting limit and offset.
AbstractPlatformno longer declaresquoteValue(). The base carried no driver property, only a@propertyclaim, and the method's guard tested for a driver object rather than for a driver that can quote.PlatformInterfacealready requires the method, so every platform now states its own policy: the drivers ask their driver,Sql92throws.Select::processLimit()andprocessOffset()render the bare integer instead of passing it throughquoteValue().Why the limit change is not cosmetic: a limit is a non-negative integer, not a value.
LIMIT '10'is accepted by MySQL, PostgreSQL and SQLite only because they coerce an unknown literal, and rejected by SQL Server'sOFFSET n ROWSand Oracle'sOFFSET/FETCH, which take an integer constant or a bind parameter. The prepared path already binds these asParameterContainer::TYPE_INTEGER, so the unprepared path was the only place they were treated as strings. The defect is old and recorded: zendframework/zendframework#6221, whereralphschindlernotedLIMIT '1'is invalid on some servers.Why the guard removal matters: with no driver,
quoteValue()fell back to dialect-agnostic backslash escaping rather than refusing. A platform with an idle connection hits exactly that path, so an untrusted value silently received the weaker treatment. Rendering a statement that carries values against a connection that is not open now throws instead.Depends on #258, which is where the statement factory and the
Sql92@internaltag landed. The three driver packages follow in referencing pull requests.Existing drivers (mysql, pgsql, sqlite) pass their suites apart from the sqlite fixes tracked in phpdb-sqlite#45.
Tracked in #260.