Bug #19582 » 11022_v3.diff
t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php (working copy) | ||
---|---|---|
'content',
|
||
$this->cacheTable,
|
||
'identifier = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($entryIdentifier, $this->cacheTable) . ' '
|
||
. 'AND ((crdate + lifetime) >= ' . time() . ' OR lifetime = 0)'
|
||
. 'AND (crdate + lifetime >= ' . time() . ' OR lifetime = 0)'
|
||
);
|
||
if (count($cacheEntries) == 1) {
|
||
... | ... | |
'content',
|
||
$this->cacheTable,
|
||
'identifier = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($entryIdentifier, $this->cacheTable) . ' '
|
||
. 'AND (crdate + lifetime) >= ' . time()
|
||
. 'AND crdate + lifetime >= ' . time()
|
||
);
|
||
if (count($cacheEntries) == 1) {
|
||
... | ... | |
$cacheEntryIdentifierRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
|
||
'identifier',
|
||
$this->cacheTable,
|
||
$this->getListQueryForTag($tag) . ' AND ((crdate + lifetime) >= ' . time() . ' OR lifetime = 0)'
|
||
$this->getListQueryForTag($tag) . ' AND (crdate + lifetime >= ' . time() . ' OR lifetime = 0)'
|
||
);
|
||
foreach ($cacheEntryIdentifierRows as $cacheEntryIdentifierRow) {
|
||
... | ... | |
foreach ($tags as $tag) {
|
||
$whereClause[] = $this->getListQueryForTag($tag);
|
||
}
|
||
$whereClause[] = '((crdate + lifetime) >= ' . time() . ' OR lifetime = 0)';
|
||
$whereClause[] = '(crdate + lifetime >= ' . time() . ' OR lifetime = 0)';
|
||
$cacheEntryIdentifierRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
|
||
'identifier',
|
||
... | ... | |
public function collectGarbage() {
|
||
$GLOBALS['TYPO3_DB']->exec_DELETEquery(
|
||
$this->cacheTable,
|
||
'(crdate + lifetime) < ' . time()
|
||
'crdate + lifetime < ' . time()
|
||
);
|
||
}
|
||
... | ... | |
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php']);
|
||
}
|
||
?>
|
||
?>
|
t3lib/class.t3lib_sqlparser.php (working copy) | ||
---|---|---|
// Find "modifyer", eg. "NOT or !"
|
||
$stack[$level][$pnt[$level]]['modifier'] = trim($this->nextPart($parseString,'^(!|NOT[[:space:]]+)'));
|
||
// Support calculated value only for:
|
||
// - "&" (boolean AND)
|
||
// - "+" (addition)
|
||
// - "-" (substraction)
|
||
// - "*" (multiplication)
|
||
// - "/" (division)
|
||
// - "%" (modulo)
|
||
$calcOperators = '&|\+|-|\*|\/|%';
|
||
// Fieldname:
|
||
if ($fieldName = $this->nextPart($parseString,'^([[:alnum:]._]+)([[:space:]]+|&|<=|>=|<|>|=|!=|IS)')) {
|
||
if ($fieldName = $this->nextPart($parseString, '^([[:alnum:]._]+)([[:space:]]+|' . $calcOperators . '|<=|>=|<|>|=|!=|IS)')) {
|
||
// Parse field name into field and table:
|
||
$tableField = explode('.',$fieldName,2);
|
||
... | ... | |
return $this->parseError('No field name found as expected in parseWhereClause()',$parseString);
|
||
}
|
||
// See if the value is calculated. Support only for "&" (boolean AND) at the moment:
|
||
$stack[$level][$pnt[$level]]['calc'] = $this->nextPart($parseString,'^(&)');
|
||
// See if the value is calculated:
|
||
$stack[$level][$pnt[$level]]['calc'] = $this->nextPart($parseString, '^(' . $calcOperators . ')');
|
||
if (strlen($stack[$level][$pnt[$level]]['calc'])) {
|
||
// Finding value for calculation:
|
||
$stack[$level][$pnt[$level]]['calc_value'] = $this->getValue($parseString);
|
||
... | ... | |
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_sqlparser.php']);
|
||
}
|
||
?>
|
||
?>
|
typo3/sysext/dbal/class.ux_t3lib_sqlparser.php (working copy) | ||
---|---|---|
/**
|
||
* Implodes an array of WHERE clause configuration into a WHERE clause.
|
||
*
|
||
* DBAL-specific: The only(!) handled "calc" operator supported by parseWhereClause() is the bitwise
|
||
* logical and (&), and only this one is supported here!
|
||
* DBAL-specific: The only(!) handled "calc" operators supported by parseWhereClause() are:
|
||
* - the bitwise logical and (&)
|
||
* - the addition (+)
|
||
* - the substraction (-)
|
||
* - the multiplication (*)
|
||
* - the division (/)
|
||
* - the modulo (%)
|
||
*
|
||
* @param array WHERE clause configuration
|
||
* @return string WHERE clause as string.
|
||
... | ... | |
$output.=' '.trim($v['modifier']).' ';
|
||
// DBAL-specific: Set calculation, if any:
|
||
if ($v['calc'] && $functionMapping) {
|
||
if ($v['calc'] === '&' && $functionMapping) {
|
||
switch(true) {
|
||
case $GLOBALS['TYPO3_DB']->runningADOdbDriver('oci8'):
|
||
// Oracle only knows BITAND(x,y) - sigh
|
||
... | ... | |
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dbal/class.ux_t3lib_sqlparser.php']);
|
||
}
|
||
?>
|
||
?>
|