Bug #21268
closedCaching framework does not work with DBAL on Oracle
0%
Description
Problems:
When looking in the DBAL debug module, a lot of errors are produced, which all point to the new caching framework. This error message is "ORA-00904: "LIFETIME": invalid identifier".
This error is produced by t3lib/cache/backend/class.t3lib_cache_backend_dbbackend, on line 96:
. 'AND (crdate + lifetime >= ' . time() . ' OR lifetime = 0)'
and probably in the same file on line 120:
. 'AND crdate + lifetime >= ' . time()
At these lines an addition (+) calculation is done, which is converted to an Oracle BITAND bitwise operation in the file typo3/sysext/dbal/class.ux_t3lib_sqlengine in function compileWhereClause().
First of all this function does not check Bitwise operations at all, but makes a BITAND for all calculations, like +/-/%/* and divisions. The check on the variable '$functionMapping' is worthless, because it's always TRUE.
Secondly, two fields are used in the addition; crdate + lifetime. Lifetime is not recognized as a fieldname and therefor not quoted with double quotes (")
The query ends up like:
SELECT "content"
FROM "cache_hash"
WHERE
"identifier" = 'abbbabaf2d4b3f9a63e8dde781f1c106' AND (BITAND >= 1255507193 OR "lifetime" = 0)
which should be:
SELECT "content"
FROM "cache_hash"
WHERE
"identifier" = 'abbbabaf2d4b3f9a63e8dde781f1c106' AND ("crdate"+"lifetime" >= 1255507193 OR "lifetime" = 0)
How to reproduce:
Use the latest trunk of the TYPO3 core - 4.3-dev
Use Oracle
Turn on sql debug in the install tool
Go to the DBAL debug module
It will show the error at the top of the module when calling this module
(issue imported from #M12231)
Files
Updated by Xavier Perseguers about 15 years ago
Hi, I tried to set up a small website and activated new caching framework but I don't see any error in DBAL module. Furthermore, I checked the use of BITADD and I do not understand why it's used for all calc for you as there is an explicit test to use it for the '&' operator only.
Updated by Xavier Perseguers about 15 years ago
OK. I'm currently working on #12354. I found that it is possible to have BITAND used for all operators. This is a bug in class.ux_t3lib_sqlengine.php which was not updated to reflect changes in class.ux_t3lib_sqlparser.php.
I suggest to update DBAL to use the version in trunk. Thanks for your understanding.
Updated by Xavier Perseguers about 15 years ago
I confirm that "lifetime" field is not quoted
Updated by Xavier Perseguers about 15 years ago
DBAL patch will be committed as soon as the "core" part of the patch gets committed to trunk. Thanks for reviewing it.
Updated by Xavier Perseguers about 15 years ago
Committed to trunk with changeset 26115.
Updated by Xavier Perseguers about 15 years ago
Hi,
Could you please see whether you don't still get parsing errors? And then try to apply patch t3lib_cache_backend_dbbackend.diff. Please give your +1 in Core list for this RFC.
Updated by Oliver Hader about 15 years ago
t3lib_cache_backend_dbbackend.diff
Committed to SVN Trunk (rev. 6361)