[BUGFIX] dbal: Cast field to CHAR for FIND_IN_SET()
Implement explicit casting of fields to a character representation. Most DBMS are stricter in regard to data type checking and emit an error when trying to use FIND_IN_SET() on non-text field types. On the DBAL side of things the DBMS specifics are used to define that an explicit cast is required for FIND_IN_SET() so that a query including the CAST() statement gets generated. A PostgreSQL Specific has been added to enable the explicit casting in conjuction with DBAL. To avoid checking repeatedly if a DBMS has defined specific requirements a NullSpecific has been implemented that gets used as a default. In the DatabaseTreeDataProvider the listFieldQuery() function has been changed to use an explicit CAST() instead of relying on the implicit cast done by MySQL when comparing it to an empty string. The SqlParser has been extended with the support for CAST(). Resolves: #67155 Resolves: #67172 Resolves: #46271 Releases: master, 6.2 Change-Id: Ic77d1700e0fb4e3723c90b34e131dafb456038e0 Reviewed-on: http://review.typo3.org/39779 Reviewed-by:Andreas Fernandez <typo3@scripting-base.de> Tested-by:
Andreas Fernandez <typo3@scripting-base.de> Reviewed-by:
Markus Klein <markus.klein@typo3.org> Tested-by:
Markus Klein <markus.klein@typo3.org>
Showing
- typo3/sysext/core/Classes/Database/SqlParser.php 34 additions, 6 deletionstypo3/sysext/core/Classes/Database/SqlParser.php
- typo3/sysext/core/Classes/Tree/TableConfiguration/DatabaseTreeDataProvider.php 1 addition, 1 deletion...sses/Tree/TableConfiguration/DatabaseTreeDataProvider.php
- typo3/sysext/core/Tests/Unit/Database/SqlParserTest.php 15 additions, 0 deletionstypo3/sysext/core/Tests/Unit/Database/SqlParserTest.php
- typo3/sysext/dbal/Classes/Database/DatabaseConnection.php 11 additions, 1 deletiontypo3/sysext/dbal/Classes/Database/DatabaseConnection.php
- typo3/sysext/dbal/Classes/Database/Specifics/AbstractSpecifics.php 1 addition, 0 deletions...ext/dbal/Classes/Database/Specifics/AbstractSpecifics.php
- typo3/sysext/dbal/Classes/Database/Specifics/PostgresSpecifics.php 9 additions, 0 deletions...ext/dbal/Classes/Database/Specifics/PostgresSpecifics.php
- typo3/sysext/dbal/Tests/Unit/Database/DatabaseConnectionPostgresqlTest.php 1 addition, 1 deletion.../Tests/Unit/Database/DatabaseConnectionPostgresqlTest.php
- typo3/sysext/dbal/Tests/Unit/Database/SqlParserTest.php 25 additions, 0 deletionstypo3/sysext/dbal/Tests/Unit/Database/SqlParserTest.php
Please register or sign in to comment