[lxc-devel] [lxd/master] lxd/db: Adds boolean support to doDbQueryScan

tomponline on Github lxc-bot at linuxcontainers.org
Thu Sep 24 13:16:17 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200924/2ae4cb02/attachment.bin>
-------------- next part --------------
From d0e58fa8cc9cea7c7e1f6b2119ef607d72e3d83f Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Tue, 15 Sep 2020 13:02:05 +0100
Subject: [PATCH] lxd/db: Adds boolean support to doDbQueryScan

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 lxd/db/db.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lxd/db/db.go b/lxd/db/db.go
index c0519e8e31..232c0d531f 100644
--- a/lxd/db/db.go
+++ b/lxd/db/db.go
@@ -494,6 +494,9 @@ func doDbQueryScan(c *Cluster, q string, args []interface{}, outargs []interface
 					case int64:
 						integer := int64(0)
 						ptrargs[i] = &integer
+					case bool:
+						boolean := bool(false)
+						ptrargs[i] = &boolean
 					default:
 						return fmt.Errorf("Bad interface type: %s", t)
 					}
@@ -511,6 +514,8 @@ func doDbQueryScan(c *Cluster, q string, args []interface{}, outargs []interface
 						newargs[i] = *ptrargs[i].(*int)
 					case int64:
 						newargs[i] = *ptrargs[i].(*int64)
+					case bool:
+						newargs[i] = *ptrargs[i].(*bool)
 					default:
 						return fmt.Errorf("Bad interface type: %s", t)
 					}


More information about the lxc-devel mailing list