[TYPO3-dev] Raising Mysql requirements to 4.1?

Dmitry Dulepov [typo3] dmitry at typo3.org
Mon Oct 1 15:09:43 CEST 2007


Hi!

Steffen Kamper wrote:
> i thought about the double cache entry problem - could be solved in mysql 
> using that syntax (see in BT), other db's may have simular function for 
> that.

I did similar thing in pre-release version of realurl (available from by blog). It is a bit dirty but works and I could not find better solution. Code snippet:

---------------
if (get_resource_type($GLOBALS['TYPO3_DB']->link) == 'mysql link') {
	$query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_realurl_urlencodecache', $insertFields);
	$query .= ' ON DUPLICATE KEY UPDATE tstamp=' . $insertFields['tstamp'];
	$GLOBALS['TYPO3_DB']->sql_query($query);
}
else {
	$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_realurl_urlencodecache', 'url_hash='.intval($hash));
	$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_realurl_urlencodecache', $insertFields);
}
---------------

Another alternative is using transaction syntax, which is portable but will work only with InnoDb on mysql, which is a problem again... I decided to go with mysql-specific extensions because most typo3 users use mysql.

-- 
Dmitry Dulepov
TYPO3 freelancer / TYPO3 core team member
Web: http://typo3bloke.net/
Skype: callto:liels_bugs




More information about the TYPO3-dev mailing list