/ Check-in [d8d0bdcb]
Login

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

Overview
Comment:Fix a problem with reading the "file" column of a zonefile virtual table.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | zonefile
Files: files | file ages | folders
SHA3-256: d8d0bdcb405610978393bb8f3ef30ee868fddda0d129036f8d0102012fe0d5d4
User & Date: dan 2018-02-20 19:25:49
Context
2018-02-20
20:57
Update README.md in ext/zonefile. check-in: a13b2b38 user: dan tags: zonefile
19:25
Fix a problem with reading the "file" column of a zonefile virtual table. check-in: d8d0bdcb user: dan tags: zonefile
18:47
Instead of just the frame number, store frame sizes and offsets in zonefile shadow table %_shadow_idx. check-in: 56801c46 user: dan tags: zonefile
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/zonefile/zonefile.c.

  2308   2308     switch( i ){
  2309   2309       case 0: /* k */
  2310   2310         sqlite3_result_value(pCtx, sqlite3_column_value(pCsr->pSelect, 0));
  2311   2311         break;
  2312   2312       case 1: /* v */
  2313   2313         rc = zonefileGetValue(pCtx, pCsr);
  2314   2314         break;
  2315         -    case 2: /* file */
  2316         -      sqlite3_result_value(pCtx, sqlite3_column_value(pCsr->pSelect, 1));
         2315  +    case 2: { /* file */
         2316  +      const char *zFile = 0;
         2317  +      rc = zonefileGetFile(pCtx, pCsr, &zFile);
         2318  +      sqlite3_result_text(pCtx, zFile, -1, SQLITE_TRANSIENT);
         2319  +      zonefileReleaseFile(pCsr);
  2317   2320         break;
         2321  +    }
  2318   2322       default: { /* sz */
  2319   2323         int iCol;
  2320   2324         if( sqlite3_column_type(pCsr->pSelect, 5)==SQLITE_NULL ){
  2321   2325           iCol = 3;
  2322   2326         }else{
  2323   2327           iCol = 5;
  2324   2328         }

Changes to ext/zonefile/zonefile1.test.

    47     47   do_execsql_test 1.4 { SELECT count(*) FROM z1_shadow_idx } 3
    48     48   
    49     49   do_execsql_test 1.5.1 { SELECT k FROM z1 } {1 2 3}
    50     50   do_execsql_test 1.5.2 { SELECT file FROM z1 } {
    51     51     test.zonefile test.zonefile test.zonefile
    52     52   }
    53     53   do_execsql_test 1.5.4 { SELECT sz FROM z1 } {100 100 100}
    54         -exit
    55     54   
    56     55   do_execsql_test 1.5.5 {
    57     56     SELECT zz.v==z1.v FROM zz, z1 WHERE zz.k=z1.k
    58     57   } {1 1 1}
    59     58   
    60     59   do_execsql_test 1.5 {
    61     60     DELETE FROM z1_files;