Fossil SCM
Fix a bug in the pivot-finder introduced by check-in [917f1c21e52a29904] from 5 days ago.
Commit
83789c6e53416241cfacfe51999a3eeb5adb4d436c8b2c6109b5a925880dcbd8
Parent
f39d0a729075e4e…
1 file changed
+4
-3
+4
-3
| --- src/pivot.c | ||
| +++ src/pivot.c | ||
| @@ -38,15 +38,16 @@ | ||
| 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 |
| --- src/pivot.c | |
| +++ src/pivot.c | |
| @@ -38,15 +38,16 @@ | |
| 38 | */ |
| 39 | void pivot_set_primary(int rid){ |
| 40 | /* Set up table used to do the search */ |
| 41 | db_multi_exec( |
| 42 | "CREATE TEMP TABLE IF NOT EXISTS aqueue(" |
| 43 | " rid INTEGER PRIMARY KEY," /* The record id for this version */ |
| 44 | " mtime REAL," /* Time when this version was created */ |
| 45 | " pending BOOLEAN," /* True if we have not check this one yet */ |
| 46 | " src BOOLEAN" /* 1 for primary. 0 for others */ |
| 47 | ");" |
| 48 | "DELETE FROM aqueue;" |
| 49 | "CREATE INDEX IF NOT EXISTS aqueue_idx1 ON aqueue(pending, mtime);" |
| 50 | ); |
| 51 | |
| 52 | /* Insert the primary record */ |
| 53 |
| --- src/pivot.c | |
| +++ src/pivot.c | |
| @@ -38,15 +38,16 @@ | |
| 38 | */ |
| 39 | void pivot_set_primary(int rid){ |
| 40 | /* Set up table used to do the search */ |
| 41 | db_multi_exec( |
| 42 | "CREATE TEMP TABLE IF NOT EXISTS aqueue(" |
| 43 | " rid INTEGER," /* The record id for this version */ |
| 44 | " mtime REAL," /* Time when this version was created */ |
| 45 | " pending BOOLEAN," /* True if we have not check this one yet */ |
| 46 | " src BOOLEAN," /* 1 for primary. 0 for others */ |
| 47 | " PRIMARY KEY(rid,src)" |
| 48 | ") WITHOUT ROWID;" |
| 49 | "DELETE FROM aqueue;" |
| 50 | "CREATE INDEX IF NOT EXISTS aqueue_idx1 ON aqueue(pending, mtime);" |
| 51 | ); |
| 52 | |
| 53 | /* Insert the primary record */ |
| 54 |