/ Check-in [ef9e088290]
Login

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

Overview
Comment:Merge latest trunk changes into this branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | alter-table-rename-column
Files: files | file ages | folders
SHA3-256: ef9e088290efa9d0fc36bcdef710cadfef37c8a33f4685dad4ce113807e1cc75
User & Date: dan 2018-09-04 18:23:59
Context
2018-09-05
08:28
Fix minor code issues in alter.c. check-in: 18ba35b86f user: dan tags: alter-table-rename-column
2018-09-04
18:23
Merge latest trunk changes into this branch. check-in: ef9e088290 user: dan tags: alter-table-rename-column
2018-09-03
20:05
Improve the error messages emitted by RENAME TABLE. check-in: 6805b5900d user: dan tags: alter-table-rename-column
17:11
Ensure that FTS5 queries of the form "WHERE rowid BETWEEN ? AND ? AND tbl MATCH ? ORDER BY rank" do rowid filtering before sorting. check-in: f1138a38bd user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts5/fts5_main.c.

  1201   1201       ** return results to the user for this query. The current cursor 
  1202   1202       ** (pCursor) is used to execute the query issued by function 
  1203   1203       ** fts5CursorFirstSorted() above.  */
  1204   1204       assert( pRowidEq==0 && pRowidLe==0 && pRowidGe==0 && pRank==0 );
  1205   1205       assert( nVal==0 && pMatch==0 && bOrderByRank==0 && bDesc==0 );
  1206   1206       assert( pCsr->iLastRowid==LARGEST_INT64 );
  1207   1207       assert( pCsr->iFirstRowid==SMALLEST_INT64 );
         1208  +    if( pTab->pSortCsr->bDesc ){
         1209  +      pCsr->iLastRowid = pTab->pSortCsr->iFirstRowid;
         1210  +      pCsr->iFirstRowid = pTab->pSortCsr->iLastRowid;
         1211  +    }else{
         1212  +      pCsr->iLastRowid = pTab->pSortCsr->iLastRowid;
         1213  +      pCsr->iFirstRowid = pTab->pSortCsr->iFirstRowid;
         1214  +    }
  1208   1215       pCsr->ePlan = FTS5_PLAN_SOURCE;
  1209   1216       pCsr->pExpr = pTab->pSortCsr->pExpr;
  1210   1217       rc = fts5CursorFirst(pTab, pCsr, bDesc);
  1211   1218     }else if( pMatch ){
  1212   1219       const char *zExpr = (const char*)sqlite3_value_text(apVal[0]);
  1213   1220       if( zExpr==0 ) zExpr = "";
  1214   1221   

Changes to ext/fts5/test/fts5rank.test.

   144    144     );
   145    145     INSERT INTO VTest (Title, Author) VALUES ('wrinkle in time', 'Bill Smith');
   146    146   
   147    147     SELECT * FROM VTest WHERE 
   148    148     VTest MATCH 'wrinkle in time OR a wrinkle in time' ORDER BY rank;
   149    149   } {{wrinkle in time} {Bill Smith}}
   150    150   
   151         -
          151  +#-------------------------------------------------------------------------
          152  +reset_db
          153  +do_execsql_test 5.0 {
          154  +  CREATE VIRTUAL TABLE ttt USING fts5(a);
          155  +  WITH s(i) AS (
          156  +    SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<100
          157  +  )
          158  +  INSERT INTO ttt SELECT 'word ' || i FROM s;
          159  +}
   152    160   
          161  +do_execsql_test 5.1 {
          162  +  SELECT rowid FROM ttt('word') WHERE rowid BETWEEN 30 AND 40 ORDER BY rank;
          163  +} {30 31 32 33 34 35 36 37 38 39 40}
   153    164   
   154    165   finish_test
          166  +