]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Clarify the behavior of sqlite3_last_insert_rowid() when using
authordrh <drh@noemail.net>
Sat, 27 Oct 2007 16:25:16 +0000 (16:25 +0000)
committerdrh <drh@noemail.net>
Sat, 27 Oct 2007 16:25:16 +0000 (16:25 +0000)
INSERT OR IGNORE. (CVS 4515)

FossilOrigin-Name: c0fa0c8ba80f4cd60bd06da7a032c6424ffd16f8

manifest
manifest.uuid
src/sqlite.h.in

index 6733771b41ad17a59ef02202aab8533a6f6511a8..4953ab78e3c836f20fde063c691d6991d277b7ec 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Be\sa\sbit\smore\ssusicious\sof\sinvalid\sresults\sfrom\sthe\stokenizer.\s(CVS\s4514)
-D 2007-10-24T23:24:22
+C Clarify\sthe\sbehavior\sof\ssqlite3_last_insert_rowid()\swhen\susing\nINSERT\sOR\sIGNORE.\s(CVS\s4515)
+D 2007-10-27T16:25:16
 F Makefile.in 30c7e3ba426ddb253b8ef037d1873425da6009a8
 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -131,7 +131,7 @@ F src/random.c 4a22746501bf36b0a088c66e38dde5daba6a35da
 F src/select.c 4706a6115da1bdc09a2be5991168a6cc2c0df267
 F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
 F src/shell.c 82089379833e361ba8a2ae65316a2173785300c0
-F src/sqlite.h.in 06c1bbf810800ad11313e646df99b35d90d1c7df
+F src/sqlite.h.in 430a26215c164a2d4236dcbce4730a704b455271
 F src/sqlite3ext.h a93f59cdee3638dc0c9c086f80df743a4e68c3cb
 F src/sqliteInt.h 7fd5cfa357d7aefe22cd2bcdfabcca4e7d5ab5b2
 F src/sqliteLimit.h 1bcbbdfa856f8b71b561abb31edb864b0eca1d12
@@ -584,7 +584,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P a3b82548cb51431569aafacf38e3391a8a1b697b
-R 9840b2a2e4a7e399d42f951e7101b4e6
-U shess
-Z c626a985c57b5c6f7a3cfe6568c0f1ce
+P deb8f56d3adea0025d28b8effabec7c7b7fe3026
+R 27a5740f77270c1f94cbbc07f45db7e7
+U drh
+Z 09d045b0cf9283304b9f062260162563
index 4ccf98f3a2e7c3d80b937cb8e26257d5ee9b39d7..52ad2d8271fecb11cd39e246ff54d3172507f21b 100644 (file)
@@ -1 +1 @@
-deb8f56d3adea0025d28b8effabec7c7b7fe3026
\ No newline at end of file
+c0fa0c8ba80f4cd60bd06da7a032c6424ffd16f8
\ No newline at end of file
index a044f882ef732e31cbb76ff65359d4f0a5acd0c5..c2cce7e34f5d06f2745c8a7e48437e08b3ebe87d 100644 (file)
@@ -30,7 +30,7 @@
 ** the version number) and changes its name to "sqlite3.h" as
 ** part of the build process.
 **
-** @(#) $Id: sqlite.h.in,v 1.267 2007/10/12 18:30:13 drh Exp $
+** @(#) $Id: sqlite.h.in,v 1.268 2007/10/27 16:25:16 drh Exp $
 */
 #ifndef _SQLITE3_H_
 #define _SQLITE3_H_
@@ -748,9 +748,9 @@ int sqlite3_extended_result_codes(sqlite3*, int onoff);
 ** type INTEGER PRIMARY KEY then that column is another an alias for the
 ** rowid.
 **
-** This routine returns the rowid of the most recent INSERT into
+** This routine returns the rowid of the most recent successful INSERT into
 ** the database from the database connection given in the first 
-** argument.  If no inserts have ever occurred on this database
+** argument.  If no successful inserts have ever occurred on this database
 ** connection, zero is returned.
 **
 ** If an INSERT occurs within a trigger, then the rowid of the
@@ -759,6 +759,16 @@ int sqlite3_extended_result_codes(sqlite3*, int onoff);
 ** by this routine reverts to the last value inserted before the
 ** trigger fired.
 **
+** An INSERT that fails due to a constraint violation is not a
+** successful insert and does not change the value returned by this
+** routine.  Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK,
+** and INSERT OR ABORT make no changes to the return value of this
+** routine when their insertion fails.  When INSERT OR REPLACE 
+** encounters a constraint violation, it does not fail.  The
+** INSERT continues to completion after deleting rows that caused
+** the constraint problem so INSERT OR REPLACE will always change
+** the return value of this interface.
+**
 ** If another thread does a new insert on the same database connection
 ** while this routine is running and thus changes the last insert rowid,
 ** then the return value of this routine is undefined.