SQLite

Check-in [d8d0bdcb40]
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
Timelines: family | ancestors | descendants | both | zonefile
Files: files | file ages | folders
SHA3-256: d8d0bdcb405610978393bb8f3ef30ee868fddda0d129036f8d0102012fe0d5d4
User & Date: dan 2018-02-20 19:25:49.291
Context
2018-02-20
20:57
Update README.md in ext/zonefile. (check-in: a13b2b3813 user: dan tags: zonefile)
19:25
Fix a problem with reading the "file" column of a zonefile virtual table. (check-in: d8d0bdcb40 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: 56801c461c user: dan tags: zonefile)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/zonefile/zonefile.c.
2308
2309
2310
2311
2312
2313
2314
2315


2316

2317

2318
2319
2320
2321
2322
2323
2324
  switch( i ){
    case 0: /* k */
      sqlite3_result_value(pCtx, sqlite3_column_value(pCsr->pSelect, 0));
      break;
    case 1: /* v */
      rc = zonefileGetValue(pCtx, pCsr);
      break;
    case 2: /* file */


      sqlite3_result_value(pCtx, sqlite3_column_value(pCsr->pSelect, 1));

      break;

    default: { /* sz */
      int iCol;
      if( sqlite3_column_type(pCsr->pSelect, 5)==SQLITE_NULL ){
        iCol = 3;
      }else{
        iCol = 5;
      }







|
>
>
|
>

>







2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
  switch( i ){
    case 0: /* k */
      sqlite3_result_value(pCtx, sqlite3_column_value(pCsr->pSelect, 0));
      break;
    case 1: /* v */
      rc = zonefileGetValue(pCtx, pCsr);
      break;
    case 2: { /* file */
      const char *zFile = 0;
      rc = zonefileGetFile(pCtx, pCsr, &zFile);
      sqlite3_result_text(pCtx, zFile, -1, SQLITE_TRANSIENT);
      zonefileReleaseFile(pCsr);
      break;
    }
    default: { /* sz */
      int iCol;
      if( sqlite3_column_type(pCsr->pSelect, 5)==SQLITE_NULL ){
        iCol = 3;
      }else{
        iCol = 5;
      }
Changes to ext/zonefile/zonefile1.test.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
do_execsql_test 1.4 { SELECT count(*) FROM z1_shadow_idx } 3

do_execsql_test 1.5.1 { SELECT k FROM z1 } {1 2 3}
do_execsql_test 1.5.2 { SELECT file FROM z1 } {
  test.zonefile test.zonefile test.zonefile
}
do_execsql_test 1.5.4 { SELECT sz FROM z1 } {100 100 100}
exit

do_execsql_test 1.5.5 {
  SELECT zz.v==z1.v FROM zz, z1 WHERE zz.k=z1.k
} {1 1 1}

do_execsql_test 1.5 {
  DELETE FROM z1_files;







<







47
48
49
50
51
52
53

54
55
56
57
58
59
60
do_execsql_test 1.4 { SELECT count(*) FROM z1_shadow_idx } 3

do_execsql_test 1.5.1 { SELECT k FROM z1 } {1 2 3}
do_execsql_test 1.5.2 { SELECT file FROM z1 } {
  test.zonefile test.zonefile test.zonefile
}
do_execsql_test 1.5.4 { SELECT sz FROM z1 } {100 100 100}


do_execsql_test 1.5.5 {
  SELECT zz.v==z1.v FROM zz, z1 WHERE zz.k=z1.k
} {1 1 1}

do_execsql_test 1.5 {
  DELETE FROM z1_files;