[Typo3-dev] t3lib_db::sql_insert_id portable?

Kasper Skårhøj kasper at typo3.com
Mon Apr 26 18:27:57 CEST 2004


On Tue, 2004-04-27 at 00:17, Martin-no$pam-Kutschker wrote:
> 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.

Read the comment: "MysQL Wrapper function".

It doesn't promise anything more. But it gives us opportunities.

For most other databases it means that we can simulate the value! Thats
teh point of an API!


> 
> Besides the minor point the name is Mysql-centric it lacks a 
> sequence/table argument. 

That sounds like a good idea actually. I will discuss that with Karsten
D. later.


>
> 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.

We are in the start of implementing DBAL, so if your issues are rooted
in reality we will of course fix these things.

- kasper






More information about the TYPO3-dev mailing list