Add necessary type casts to verify DML
authorJakob Cornell <jakob+gpg@jcornell.net>
Sun, 17 Apr 2022 19:06:14 +0000 (14:06 -0500)
committerJakob Cornell <jakob+gpg@jcornell.net>
Sun, 17 Apr 2022 19:06:14 +0000 (14:06 -0500)
disk_jumble/src/disk_jumble/verify.py

index f5db00287fadfa5d69d816c6385ab77ab672957c..60a53e5dd12891a6b2067f3034504d3abdb7368e 100644 (file)
@@ -85,7 +85,7 @@ def _get_v1_worklist(conn, disk_id: int, block_ranges: List[NumericRange]) -> Li
                                diskjumble.slab
                                left join bittorrent.torrent_info on digest(info, 'sha1') = entity_id
                        )
-                       where disk_id = %s and disk_blocks && any (%s)
+                       where disk_id = %s and disk_blocks && any (%s::int8range[])
                """,
                (disk_id, block_ranges)
        )
@@ -221,7 +221,7 @@ def _get_v2_worklist(conn, disk_id: int, block_ranges: List[NumericRange]) -> Li
                                        from filtered
                                )
                        select * from exploded
-                       where block <@ any (%(block_ranges)s)
+                       where block <@ any (%(block_ranges)s::int8range[])
                        order by block
                """,
                {