Project

General

Profile

Actions

Bug #56390

closed

Could not parse where clause

Added by Andreas Fernandez about 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2014-02-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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)
Actions #1

Updated by Andreas Fernandez about 10 years ago

The failing condition is in line 1074 in SqlParser.php.

Actions #2

Updated by Markus Klein about 10 years ago

  • Category changed from Install Tool to 999
Actions #3

Updated by Jigal van Hemert about 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.

Actions #4

Updated by Gerrit Code Review about 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

Actions #5

Updated by Gerrit Code Review about 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

Actions #6

Updated by Gerrit Code Review about 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

Actions #7

Updated by Gerrit Code Review about 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

Actions #8

Updated by Gerrit Code Review about 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

Actions #9

Updated by Xavier Perseguers about 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF