Project

General

Profile

Actions

Bug #21268

closed

Caching framework does not work with DBAL on Oracle

Added by Patrick Broens about 15 years ago. Updated about 15 years ago.

Status:
Closed
Priority:
Must have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2009-10-14
Due date:
% Done:

0%

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

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

core_12231.diff (1.19 KB) core_12231.diff Administrator Admin, 2009-10-27 17:47
dbal_12231.diff (1.81 KB) dbal_12231.diff Administrator Admin, 2009-10-27 17:47
t3lib_cache_backend_dbbackend.diff (658 Bytes) t3lib_cache_backend_dbbackend.diff Administrator Admin, 2009-11-03 17:28
Actions #1

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.

Actions #2

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.

Actions #3

Updated by Xavier Perseguers about 15 years ago

I confirm that "lifetime" field is not quoted

Actions #4

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.

Actions #5

Updated by Xavier Perseguers about 15 years ago

Committed to trunk with changeset 26115.

Actions #6

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.

Actions #7

Updated by Oliver Hader about 15 years ago

t3lib_cache_backend_dbbackend.diff
Committed to SVN Trunk (rev. 6361)

Actions

Also available in: Atom PDF