SQLite

Check-in [d2ab24f59d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a harmless compiler warning.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d2ab24f59d92527fe503fa7dc2128078fbc4dd2d2c1148effa9ea1957ab19940
User & Date: drh 2018-04-20 20:09:22.155
Context
2018-04-20
20:37
Enhance the "rbu" command line utility a bit. (check-in: 61eb516f83 user: dan tags: trunk)
20:09
Fix a harmless compiler warning. (check-in: d2ab24f59d user: drh tags: trunk)
19:46
Avoid the use of statement journals on DELETEs of a single row without triggers or foreign keys. (check-in: 20bf580080 user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/update.c.
387
388
389
390
391
392
393
394

395
396
397
398
399
400
401
387
388
389
390
391
392
393

394
395
396
397
398
399
400
401







-
+







    updateVirtualTable(pParse, pTabList, pTab, pChanges, pRowidExpr, aXRef,
                       pWhere, onError);
    goto update_cleanup;
  }
#endif

  /* Jump to labelBreak to abandon further processing of this UPDATE */
  labelBreak = sqlite3VdbeMakeLabel(v);
  labelContinue = labelBreak = sqlite3VdbeMakeLabel(v);

  /* Not an UPSERT.  Normal processing.  Begin by
  ** initialize the count of updated rows */
  if( (db->flags&SQLITE_CountRows)!=0
   && !pParse->pTriggerTab
   && !pParse->nested
   && pUpsert==0
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
424
425
426
427
428
429
430

431
432
433
434
435
436
437







-







    /* If this is an UPSERT, then all cursors have already been opened by
    ** the outer INSERT and the data cursor should be pointing at the row
    ** that is to be updated.  So bypass the code that searches for the
    ** row(s) to be updated.
    */
    pWInfo = 0;
    eOnePass = ONEPASS_SINGLE;
    labelContinue = labelBreak;
    sqlite3ExprIfFalse(pParse, pWhere, labelBreak, SQLITE_JUMPIFNULL);
  }else{
    /* Begin the database scan. 
    **
    ** Do not consider a single-pass strategy for a multi-row update if
    ** there are any triggers or foreign keys to process, or rows may
    ** be deleted as a result of REPLACE conflict handling. Any of these
522
523
524
525
526
527
528
529

530
531
532
533
534
535
536
537
538
521
522
523
524
525
526
527

528


529
530
531
532
533
534
535







-
+
-
-







    /* Top of the update loop */
    if( eOnePass!=ONEPASS_OFF ){
      if( !isView && aiCurOnePass[0]!=iDataCur && aiCurOnePass[1]!=iDataCur ){
        assert( pPk );
        sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, labelBreak, regKey,nKey);
        VdbeCoverageNeverTaken(v);
      }
      if( eOnePass==ONEPASS_SINGLE ){
      if( eOnePass!=ONEPASS_SINGLE ){
        labelContinue = labelBreak;
      }else{
        labelContinue = sqlite3VdbeMakeLabel(v);
      }
      sqlite3VdbeAddOp2(v, OP_IsNull, pPk ? regKey : regOldRowid, labelBreak);
      VdbeCoverageIf(v, pPk==0);
      VdbeCoverageIf(v, pPk!=0);
    }else if( pPk ){
      labelContinue = sqlite3VdbeMakeLabel(v);