/ Check-in [38d23888]
Login

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

Overview
Comment:In zonefile, change the "file TEXT" column back to "fileid INTEGER". The fileid can be used as a key with the associated zonefile_files table, which contains more information than just the filename.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | zonefile
Files: files | file ages | folders
SHA3-256: 38d23888cf5a7117c51bd9211bd93ec52a30360f7eb2bc83a13910c5d85fe739
User & Date: dan 2018-02-21 10:43:19
Context
2018-02-21
16:36
Have zonefile store encryption keys in a hash-table instead of a linked list. Add extra tests for key management. check-in: 3a63ea65 user: dan tags: zonefile
10:43
In zonefile, change the "file TEXT" column back to "fileid INTEGER". The fileid can be used as a key with the associated zonefile_files table, which contains more information than just the filename. check-in: 38d23888 user: dan tags: zonefile
2018-02-20
20:57
Update README.md in ext/zonefile. check-in: a13b2b38 user: dan tags: zonefile
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/zonefile/zonefile.c.

   499    499   
   500    500   
   501    501   
   502    502   #define ZONEFILE_SCHEMA          \
   503    503     "CREATE TABLE z1("             \
   504    504     "  k INTEGER PRIMARY KEY,"     \
   505    505     "  v BLOB,"                    \
   506         -  "  file TEXT,"                 \
          506  +  "  fileid INTEGER,"            \
   507    507     "  sz INTEGER"                 \
   508    508     ")"
   509    509   
   510    510   #define ZONEFILE_FILES_SCHEMA    \
   511    511     "CREATE TABLE z2("             \
   512    512     "  filename TEXT,"             \
   513    513     "  ekey BLOB,"                 \
................................................................................
  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         -      const char *zFile = 0;
  2317         -      rc = zonefileGetFile(pCtx, pCsr, &zFile);
  2318         -      sqlite3_result_text(pCtx, zFile, -1, SQLITE_TRANSIENT);
  2319         -      zonefileReleaseFile(pCsr);
         2315  +    case 2: /* fileid */
         2316  +      sqlite3_result_value(pCtx, sqlite3_column_value(pCsr->pSelect, 1));
  2320   2317         break;
  2321         -    }
  2322   2318       default: { /* sz */
  2323   2319         int iCol;
  2324   2320         if( sqlite3_column_type(pCsr->pSelect, 5)==SQLITE_NULL ){
  2325   2321           iCol = 3;
  2326   2322         }else{
  2327   2323           iCol = 5;
  2328   2324         }

Changes to ext/zonefile/zonefile1.test.

    43     43            json_extract(header, '$.numKeys')
    44     44            FROM z1_files;
    45     45   } {test.zonefile 1179332920 1 3}
    46     46   
    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         -do_execsql_test 1.5.2 { SELECT file FROM z1 } {
    51         -  test.zonefile test.zonefile test.zonefile
    52         -}
           50  +do_execsql_test 1.5.2 { SELECT fileid FROM z1 } {1 1 1}
    53     51   do_execsql_test 1.5.4 { SELECT sz FROM z1 } {100 100 100}
    54     52   
    55     53   do_execsql_test 1.5.5 {
    56     54     SELECT zz.v==z1.v FROM zz, z1 WHERE zz.k=z1.k
    57     55   } {1 1 1}
    58     56   
    59     57   do_execsql_test 1.5 {