From: Jakob Cornell Date: Sat, 16 Apr 2022 22:03:20 +0000 (-0500) Subject: Verify tool: add column lists to DB insert statements X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=53f40f027668af659be8eed0c81a9a0ea2927d4e;p=eros.git Verify tool: add column lists to DB insert statements --- diff --git a/disk_jumble/src/disk_jumble/verify.py b/disk_jumble/src/disk_jumble/verify.py index a11a789..f5db002 100644 --- a/disk_jumble/src/disk_jumble/verify.py +++ b/disk_jumble/src/disk_jumble/verify.py @@ -342,7 +342,10 @@ def _do_verify(conn, disk_id: int, block_ranges: Optional[List[range]], disk_fil for result in merge_results(generate_results()): if isinstance(result, Pass): cursor.execute( - "insert into diskjumble.verify_pass values (default, %s, %s, %s)", + """ + insert into diskjumble.verify_pass (verify_pass_id, at, disk_id, disk_sectors) + values (default, %s, %s, %s) + """, (ts, disk_id, result.blocks) ) else: @@ -352,18 +355,18 @@ def _do_verify(conn, disk_id: int, block_ranges: Optional[List[range]], disk_fil """ with new_piece as ( - insert into diskjumble.verify_piece + insert into diskjumble.verify_piece (verify_id, at, entity_id, piece) values (default, %(ts)s, %(entity_id)s, %(piece_num)s) returning verify_id ), _ as ( - insert into diskjumble.verify_piece_content + insert into diskjumble.verify_piece_content (verify_id, seq, disk_id, disk_sectors) select verify_id, ordinality - 1, %(disk_id)s, block_range from new_piece, unnest(%(ranges)) with ordinality as block_range ) - insert into diskjumble.verify_piece_fail + insert into diskjumble.verify_piece_fail (verify_id) select verify_id from new_piece """, {