Fossil

Check-in [83789c6e]
Login

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

Overview
Comment:Fix a bug in the pivot-finder introduced by check-in [917f1c21e52a29904] from 5 days ago.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:83789c6e53416241cfacfe51999a3eeb5adb4d436c8b2c6109b5a925880dcbd8
User & Date: drh 2018-06-05 23:06:21
Context
2018-06-06
17:55
Fix an XSS problem in the chng= query parameter to /timeline. check-in: 30f60a58 user: drh tags: trunk
10:39
Merged trunk Leaf check-in: a253fba0 user: mjanssen tags: commonmark-markdown
2018-06-05
23:06
Fix a bug in the pivot-finder introduced by check-in [917f1c21e52a29904] from 5 days ago. check-in: 83789c6e user: drh tags: trunk
2018-06-04
19:52
Update the built-in SQLite to the 3.24.0 release. check-in: f39d0a72 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pivot.c.

    36     36   **
    37     37   ** The act of setting the primary resets the pivot-finding algorithm.
    38     38   */
    39     39   void pivot_set_primary(int rid){
    40     40     /* Set up table used to do the search */
    41     41     db_multi_exec(
    42     42       "CREATE TEMP TABLE IF NOT EXISTS aqueue("
    43         -    "  rid INTEGER PRIMARY KEY,"  /* The record id for this version */
           43  +    "  rid INTEGER,"              /* The record id for this version */
    44     44       "  mtime REAL,"               /* Time when this version was created */
    45     45       "  pending BOOLEAN,"          /* True if we have not check this one yet */
    46         -    "  src BOOLEAN"               /* 1 for primary.  0 for others */
    47         -    ");"
           46  +    "  src BOOLEAN,"               /* 1 for primary.  0 for others */
           47  +    "  PRIMARY KEY(rid,src)"
           48  +    ") WITHOUT ROWID;"
    48     49       "DELETE FROM aqueue;"
    49     50       "CREATE INDEX IF NOT EXISTS aqueue_idx1 ON aqueue(pending, mtime);"
    50     51     );
    51     52   
    52     53     /* Insert the primary record */
    53     54     db_multi_exec(
    54     55       "INSERT INTO aqueue(rid, mtime, pending, src)"