/ Check-in [eade355f]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Reformat some code to make it easier to merge with sessions. No logic changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: eade355fafec558fc13dc4b08ca0b07713a2cd84
User & Date: drh 2015-09-15 13:42:16
Context
2015-09-15
14:39
Add test cases to cover fts5 integrity-check code. check-in: 1d018c35 user: dan tags: trunk
13:42
Reformat some code to make it easier to merge with sessions. No logic changes. check-in: eade355f user: drh tags: trunk
11:58
Fix a problem with fts5 "ORDER BY rowid DESC" queries and large terms. check-in: b26d8f79 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/delete.c.

   357    357     }
   358    358   
   359    359   #ifndef SQLITE_OMIT_TRUNCATE_OPTIMIZATION
   360    360     /* Special case: A DELETE without a WHERE clause deletes everything.
   361    361     ** It is easier just to erase the whole table. Prior to version 3.6.5,
   362    362     ** this optimization caused the row change count (the value returned by 
   363    363     ** API function sqlite3_count_changes) to be set incorrectly.  */
   364         -  if( rcauth==SQLITE_OK && pWhere==0 && !bComplex && !IsVirtual(pTab) ){
          364  +  if( rcauth==SQLITE_OK
          365  +   && pWhere==0
          366  +   && !bComplex
          367  +   && !IsVirtual(pTab)
          368  +  ){
   365    369       assert( !isView );
   366    370       sqlite3TableLock(pParse, iDb, pTab->tnum, 1, pTab->zName);
   367    371       if( HasRowid(pTab) ){
   368    372         sqlite3VdbeAddOp4(v, OP_Clear, pTab->tnum, iDb, memCnt,
   369    373                           pTab->zName, P4_STATIC);
   370    374       }
   371    375       for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){

Changes to src/insert.c.

  1345   1345             pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
  1346   1346           }
  1347   1347           if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){
  1348   1348             sqlite3MultiWrite(pParse);
  1349   1349             sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur,
  1350   1350                                      regNewData, 1, 0, OE_Replace,
  1351   1351                                      ONEPASS_SINGLE, -1);
  1352         -        }else if( pTab->pIndex ){
  1353         -          sqlite3MultiWrite(pParse);
  1354         -          sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur, 0, -1);
         1352  +        }else{
         1353  +          if( pTab->pIndex ){
         1354  +            sqlite3MultiWrite(pParse);
         1355  +            sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur,0,-1);
         1356  +          }
  1355   1357           }
  1356   1358           seenReplace = 1;
  1357   1359           break;
  1358   1360         }
  1359   1361         case OE_Ignore: {
  1360   1362           /*assert( seenReplace==0 );*/
  1361   1363           sqlite3VdbeGoto(v, ignoreDest);