Bug #56390
closedCould not parse where clause
100%
Description
The Upgrade Wizard in Install Tool crashes with "Could not parse where clause" using DBAL.
DBAL's DatabaseConnection.php has a method "quoteWhereClause()" which calls "parseWhereClause()" in core/Classes/Database/SqlParser.
The method "nextPart" returns an empty string parsing the part
CAST(CAST(media AS DECIMAL) AS CHAR) <> media OR (CType = 'uploads' AND select_key != '')because it cannot find a field using the following regular expression:
^([[:alnum:]._]+)([[:space:]]+|&|\+|-|\*|\/|%|<=|>=|<|>|=|!=|IS)
Updated by Andreas Fernandez over 10 years ago
The failing condition is in line 1074 in SqlParser.php.
Updated by Markus Klein over 10 years ago
- Category changed from Install Tool to 999
Updated by Jigal van Hemert over 10 years ago
- Status changed from New to Accepted
Problem:
- the query that is used is already cross DBMS regarding the expressions
- the TYPO3 query parser cannot handle the CAST constructions (expression should start with a column name)
Suggestion for a solution:
- build query without executing it
- look up any DBAL mapping for the tt_content table
- replace table/column names with those in the mapping AND enclose them in double quotes (this last bit must also happen if there is no mapping, but when there is a non-MySQL DBMS used)
- execute query
It was discussed with Xavier for the DBAl support and it was agreed that the simplest solution would be to have some DBAL-related code in this Upgrade Wizard.
Updated by Gerrit Code Review over 10 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27996
Updated by Gerrit Code Review over 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27996
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27996
Updated by Gerrit Code Review over 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27996
Updated by Gerrit Code Review over 10 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27996
Updated by Xavier Perseguers over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 99efb03b8e2b69dfeaa2ec94cb989f1b8b125dc1.