From a2eccde5e1e83f77bd015990279f75f8b3c7db4a Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 24 Mar 2019 07:25:38 +0100 Subject: table buildreqeusts should have an explicit id We rely on the id being constant. However, sqlite does not guarantee that the implicit rowid stays constant across vacuum. Making the rowid explicit fixes that. --- build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'build.py') diff --git a/build.py b/build.py index 6a40dd3..3ede7f1 100755 --- a/build.py +++ b/build.py @@ -46,7 +46,7 @@ def main(): db = sqlite3.connect("db", detect_types=sqlite3.PARSE_DECLTYPES) with contextlib.closing(db.cursor()) as cur: cur.execute(""" - SELECT d.source, d.version, d.architecture, r.rowid + SELECT d.source, d.version, d.architecture, r.id FROM depstate AS d JOIN buildrequests AS r ON d.architecture = ifnull(r.architecture, d.architecture) @@ -80,7 +80,7 @@ def main(): (source, version, architecture, success, timestamp, filename)) if requestid is not None: - cur.execute("DELETE FROM buildrequests WHERE rowid = ?;", + cur.execute("DELETE FROM buildrequests WHERE id = ?;", (requestid,)) if giveback: cur.execute("UPDATE depcheck SET giveback = 1 WHERE architecture = ?;", -- cgit v1.2.3