Fossil

Check-in [0047370c]
Login

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

Overview
Comment:Rebuild ticket tables when modifications are made using 'fossil config'.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:0047370ce670cd77ab756826a4445c2ef8e84106
User & Date: joel 2013-11-29 06:10:29
Context
2013-11-29
11:26
When configuring fossil using "--disable-internal-sqlite" (having SQLite 3.8.1 installed), "./fossil version -v" gives: "SQLite 3.8.2 2013-11-27 14:50:51 c75f561f33", which was not the SQLite version compiled with, neither the SQLite version actually running (3.8.1). check-in: d7806931 user: jan.nijtmans tags: trunk
06:10
Rebuild ticket tables when modifications are made using 'fossil config'. check-in: 0047370c user: joel tags: trunk
2013-11-27
15:55
Import the latest SQLite 3.8.2 beta from upstream, including Cygwin fixes and performance enhancements. check-in: 38c02b77 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/configure.c.

398
399
400
401
402
403
404















405
406
407
408
409
410
411
...
564
565
566
567
568
569
570

571
572
573
574
575
576
577
...
946
947
948
949
950
951
952

953
954
955
956
957

958
    @ DELETE FROM reportfmt;
    @ INSERT INTO reportfmt SELECT * FROM _xfer_reportfmt;
    @ DROP TABLE _xfer_user;
    @ DROP TABLE _xfer_reportfmt;
  ;
  db_multi_exec(zSQL);
}
















/*
** Return true if z[] is not a "safe" SQL token.  A safe token is one of:
**
**   *   A string literal
**   *   A blob literal
**   *   An integer literal  (no floating point)
................................................................................
        blob_appendf(&sql, ", %s=%s", azToken[jj], azToken[jj+1]);
      }
      blob_appendf(&sql, " WHERE %s=%s AND mtime<%s",
                   aType[ii].zPrimKey, azToken[1], azToken[0]);
      db_multi_exec("%s", blob_str(&sql));
    }
    blob_reset(&sql);

  }else{
    /* Otherwise, the old format */
    if( (configure_is_exportable(zName) & groupMask)==0 ) return;
    if( fossil_strcmp(zName, "logo-image")==0 ){
      Stmt ins;
      db_prepare(&ins,
        "REPLACE INTO config(name, value, mtime) VALUES(:name, :value, now())"
................................................................................
        db_multi_exec(zRepositorySchemaDefaultReports);
      }
    }
    db_end_transaction(0);
    fossil_print("Configuration reset to factory defaults.\n");
    fossil_print("To recover, use:  %s %s import %s\n",
            g.argv[0], g.argv[1], zBackup);

  }else
  {
    fossil_fatal("METHOD should be one of:"
                 " export import merge pull push reset");
  }

}







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







 







>





>

398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
...
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
...
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
    @ DELETE FROM reportfmt;
    @ INSERT INTO reportfmt SELECT * FROM _xfer_reportfmt;
    @ DROP TABLE _xfer_user;
    @ DROP TABLE _xfer_reportfmt;
  ;
  db_multi_exec(zSQL);
}

/*
** Mask of modified configuration sets
*/
static int rebuildMask = 0;

/*
** Rebuild auxiliary tables as required by configuration changes.
*/
void configure_rebuild(void){
  if( rebuildMask & CONFIGSET_TKT ){
    ticket_rebuild();
  }
  rebuildMask = 0;
}

/*
** Return true if z[] is not a "safe" SQL token.  A safe token is one of:
**
**   *   A string literal
**   *   A blob literal
**   *   An integer literal  (no floating point)
................................................................................
        blob_appendf(&sql, ", %s=%s", azToken[jj], azToken[jj+1]);
      }
      blob_appendf(&sql, " WHERE %s=%s AND mtime<%s",
                   aType[ii].zPrimKey, azToken[1], azToken[0]);
      db_multi_exec("%s", blob_str(&sql));
    }
    blob_reset(&sql);
    rebuildMask |= thisMask;
  }else{
    /* Otherwise, the old format */
    if( (configure_is_exportable(zName) & groupMask)==0 ) return;
    if( fossil_strcmp(zName, "logo-image")==0 ){
      Stmt ins;
      db_prepare(&ins,
        "REPLACE INTO config(name, value, mtime) VALUES(:name, :value, now())"
................................................................................
        db_multi_exec(zRepositorySchemaDefaultReports);
      }
    }
    db_end_transaction(0);
    fossil_print("Configuration reset to factory defaults.\n");
    fossil_print("To recover, use:  %s %s import %s\n",
            g.argv[0], g.argv[1], zBackup);
    rebuildMask |= mask;
  }else
  {
    fossil_fatal("METHOD should be one of:"
                 " export import merge pull push reset");
  }
  configure_rebuild();
}

Changes to src/xfer.c.

1265
1266
1267
1268
1269
1270
1271

1272
1273
1274
1275
1276
1277
1278
  ** to use up a significant fraction of our time window.
  */
  zNow = db_text(0, "SELECT strftime('%%Y-%%m-%%dT%%H:%%M:%%S', 'now')");
  @ # timestamp %s(zNow)
  free(zNow);

  db_end_transaction(0);

}

/*
** COMMAND: test-xfer
**
** This command is used for debugging the server.  There is a single
** argument which is the uncompressed content of an "xfer" message







>







1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
  ** to use up a significant fraction of our time window.
  */
  zNow = db_text(0, "SELECT strftime('%%Y-%%m-%%dT%%H:%%M:%%S', 'now')");
  @ # timestamp %s(zNow)
  free(zNow);

  db_end_transaction(0);
  configure_rebuild();
}

/*
** COMMAND: test-xfer
**
** This command is used for debugging the server.  There is a single
** argument which is the uncompressed content of an "xfer" message