1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

New test cases with corresponding bug fixes.

FossilOrigin-Name: f22c21a94ca4cad0217f91c1a5a275bc348cb6ba0f3a54c927533bc8d8c96a90
This commit is contained in:
drh
2020-12-12 00:28:15 +00:00
parent 58b18a47df
commit 255c1c159b
6 changed files with 53 additions and 27 deletions

View File

@@ -1804,7 +1804,7 @@ void sqlite3GenerateConstraintChecks(
if( pUpsert->pUpsertTarget==0 ){
/* There is just on ON CONFLICT clause and it has no constraint-target */
assert( pUpsert->pNextUpsert==0 );
if( pUpsert->pUpsertSet==0 ){
if( pUpsert->isDoUpdate==0 ){
/* A single ON CONFLICT DO NOTHING clause, without a constraint-target.
** Make all unique constraint resolution be OE_Ignore */
overrideError = OE_Ignore;
@@ -1918,7 +1918,7 @@ void sqlite3GenerateConstraintChecks(
if( pUpsert ){
pUpsertClause = sqlite3UpsertOfIndex(pUpsert,0);
if( pUpsertClause!=0 ){
if( pUpsertClause->pUpsertSet==0 ){
if( pUpsertClause->isDoUpdate==0 ){
onError = OE_Ignore; /* DO NOTHING is the same as INSERT OR IGNORE */
}else{
onError = OE_Update; /* DO UPDATE */
@@ -2140,7 +2140,7 @@ void sqlite3GenerateConstraintChecks(
/* Figure out if the upsert clause applies to this index */
if( pUpsertClause ){
if( pUpsertClause->pUpsertSet==0 ){
if( pUpsertClause->isDoUpdate==0 ){
onError = OE_Ignore; /* DO NOTHING is the same as INSERT OR IGNORE */
}else{
onError = OE_Update; /* DO UPDATE */