Message421

Author reinhard
Recipients johannesV
Date 2007-07-18.13:32:27
Content
Currently, primary keys may only be changed in a backend trigger if the database
supports a rowid - otherwise there would be no possibility to re-read the
correct record.

However, some backends (at least MySQL) seem to return the sequence value used
for the primary key on the INSERT statement.

The curernt solution of defining these kinds of primary keys as "rowid" in the
datasource definition is not good because it's not portable: the correct
definition of the datasource depends on whether the backend supports real rowids
or not.

A better solution might be to test whether the INSERT statement returns any
value, and if yes, AND the backend doesn't have rowids, AND the primary key is a
single field AND the primary key was NULL for the inserted record, assume the
return value of the INSERT statement as the new value of the primary key.

This would need testing on the different backends.
History
Date User Action Args
2007-07-18 13:32:28reinhardsetmessageid: <1184765548.79.0.0618539073224.issue179@gnuenterprise.org>
2007-07-18 13:32:28reinhardsetrecipients: + johannesV
2007-07-18 13:32:28reinhardlinkissue179 messages
2007-07-18 13:32:27reinhardcreate