Refinement to [3f9887d4a58cbfdb]: The SQLITE_CONSTRAINT error should only

be returned if the prepared statement came from sqlite3_prepare_v2().  The
legacy sqlite3_prepare() is documented to return only SQLITE_ERROR.

FossilOrigin-Name: f2d9262e4427ab37ba26c004fc7a4790c86c1856d695a6b4ec3e72732ea54c09
This commit is contained in:
drh 2022-03-31 11:12:56 +00:00
parent 7e62146b13
commit 89cf958c00
3 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C Faster\sand\sslightly\ssmaller\simplementation\sof\ssqlite3Step().
D 2022-03-30T17:56:27.350
C Refinement\sto\s[3f9887d4a58cbfdb]:\s\sThe\sSQLITE_CONSTRAINT\serror\sshould\sonly\nbe\sreturned\sif\sthe\sprepared\sstatement\scame\sfrom\ssqlite3_prepare_v2().\s\sThe\nlegacy\ssqlite3_prepare()\sis\sdocumented\sto\sreturn\sonly\sSQLITE_ERROR.
D 2022-03-31T11:12:56.506
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -628,7 +628,7 @@ F src/vdbe.c af4a5e9d64dbcc484be1fa4609b655577f81ee2cd40b61e96bece6d43718ae91
F src/vdbe.h a1d0e3b934e835e73edd146f2e7c4eadb711b5c9875c18159a57483fd78e550e
F src/vdbeInt.h 8dd91427155a38ec06e9ecbde07e33f21bc02e101625191e7613f883e379a363
F src/vdbeapi.c d41dedcf05f4b0ee3f0a2ce4f8316631fef5391c2d5705b4a0b48156b8061c0b
F src/vdbeaux.c 1de06d17a1af1bf5cc776e60afcc01c49438df90863fc4db0a0516060e7b959a
F src/vdbeaux.c c3818106ffdb09e8c8cce4edad4fdb1e741bc56c94edca03a8cfd21981087831
F src/vdbeblob.c 5e61ce31aca17db8fb60395407457a8c1c7fb471dde405e0cd675974611dcfcd
F src/vdbemem.c 512499e51eb7cbe1d886031f19ab6f3e05655a0b25655991af01b61a631a78f7
F src/vdbesort.c 43756031ca7430f7aec3ef904824a7883c4ede783e51f280d99b9b65c0796e35
@ -1945,8 +1945,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 9248ce50f57fb9c4ba67949fdf9c9567c3e626cd9dd1b41b71c602d29c77c43e
R d211f80e25abf1520d1ba8916168f07f
P c6901a8c78838228f8135c9346b214e638b72086fd85367b9ff482273e62ece6
R 4dff1665eca1a56c0e1c4858159903e1
U drh
Z 7ecb30a0193ebe95381527545dca992e
Z ac3ad774d954660a814205deffa61713
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
c6901a8c78838228f8135c9346b214e638b72086fd85367b9ff482273e62ece6
f2d9262e4427ab37ba26c004fc7a4790c86c1856d695a6b4ec3e72732ea54c09

View File

@ -2999,6 +2999,7 @@ int sqlite3VdbeCheckFk(Vdbe *p, int deferred){
p->rc = SQLITE_CONSTRAINT_FOREIGNKEY;
p->errorAction = OE_Abort;
sqlite3VdbeError(p, "FOREIGN KEY constraint failed");
if( (p->prepFlags & SQLITE_PREPARE_SAVESQL)==0 ) return SQLITE_ERROR;
return SQLITE_CONSTRAINT_FOREIGNKEY;
}
return SQLITE_OK;