[Typo3-dev] t3lib_db::sql_insert_id portable?

Martin-no$pam-Kutschker "Martin-no$pam-Kutschker" at blackbox.n0spam.net
Tue Apr 27 00:17:16 CEST 2004


Hi!

AFAIK every db other than Mysql uses sequences for the generation of 
unique row ids. So this function call doesn't look portable to me.

Besides the minor point the name is Mysql-centric it lacks a 
sequence/table argument. The real query must use the name of the 
sequence, but dbal could create a sequence with a derived name for every 
table, so it'd be ok to use a table name as argument.

Mind that it has also been suggested to retrieve a sequence prior the 
insert to avoid false results when getting the current value of a 
sequence after an insert (assuming the able has a unique key with a 
default generated by a sequence). The problem is that another process 
may have altered the sequence between the insert and the select.

I don't think there is a quick solution, so I vote for removing the 
function from the API as it certainly will have to change anyway.

Masi





More information about the TYPO3-dev mailing list