* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2007-02-04 13:35]: > "A. Pagaltzis" <[EMAIL PROTECTED]> wrote: > > It's a pity that INSERT OR IGNORE (apparently?) does not set > > last_insert_id properly regardless of outcome, > > Consider this case: > > CREATE TABLE t1(x INTEGER PRIMARY KEY, y UNIQUE, z UNIQUE); > INSERT INTO t1 VALUES(1,'a','b'); > INSERT INTO t1 VALUES(2,'x','y'); > > INSERT OR IGNORE INTO t1 VALUES(NULL, 'a','y'); > > For the INSERT OR IGNORE statement, does the last_insert_rowid > get set to 1 or 2?
Yeah, good point. Silly I didn’t think that far as we’ve just had this in another thread. Out of curiosity, though – does SQLite find both rows in this case, or does it abort as soon as it sees any one constraint violation before it knows there would be more? Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------