From d2b3d826bba6522e69d214023d16070287b9da15 Mon Sep 17 00:00:00 2001 From: crozzy Date: Mon, 3 Jul 2023 15:32:29 -0700 Subject: [PATCH] clairctl: Scan the pointer to the pointer of the bool I believe that even though ok is a *bool type, we still need to pass it's address to Scan() otherwise it's akin to ok := bool; Scan(&ok), which I believe only supports binary values and not nullable bools. Signed-off-by: crozzy --- cmd/clairctl/admin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/clairctl/admin.go b/cmd/clairctl/admin.go index 5d9e3bb5e3..c5b4b84030 100644 --- a/cmd/clairctl/admin.go +++ b/cmd/clairctl/admin.go @@ -120,7 +120,7 @@ func adminPre470(c *cli.Context) error { const mkindex = `CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_manifest_index_manifest_id ON manifest_index(manifest_id);` const reindex = `REINDEX INDEX CONCURRENTLY idx_manifest_index_manifest_id;` var ok *bool - if err := conn.QueryRow(ctx, checkindex).Scan(ok); err != nil { + if err := conn.QueryRow(ctx, checkindex).Scan(&ok); err != nil { if !errors.Is(err, pgx.ErrNoRows) { zlog.Info(ctx). AnErr("index_check", err).