The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7054

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
So that NULL handling isn't needed.

As discussed in https://github.com/lxc/lxd/pull/7049

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>


From f46db35b159043847020cb84dabc58017d5889a8 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Wed, 18 Mar 2020 10:02:07 +0000
Subject: [PATCH] lxd/db/node: Tweaks LEFT JOIN to just JOIN in NodeIsEmpty()

So that NULL handling isn't needed.

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/db/node.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/db/node.go b/lxd/db/node.go
index ed80dd3313..bf743d0828 100644
--- a/lxd/db/node.go
+++ b/lxd/db/node.go
@@ -508,7 +508,7 @@ SELECT fingerprint, node_id FROM images JOIN images_nodes 
ON images.id=images_no
 
        // Check if the node has any custom volumes.
        volumes, err := query.SelectStrings(
-               c.tx, "SELECT storage_volumes.name FROM storage_volumes LEFT 
JOIN storage_pools ON storage_volumes.storage_pool_id=storage_pools.id WHERE 
storage_volumes.node_id=? AND storage_volumes.type=? AND storage_pools.driver 
NOT IN ('ceph', 'cephfs')",
+               c.tx, "SELECT storage_volumes.name FROM storage_volumes JOIN 
storage_pools ON storage_volumes.storage_pool_id=storage_pools.id WHERE 
storage_volumes.node_id=? AND storage_volumes.type=? AND storage_pools.driver 
NOT IN ('ceph', 'cephfs')",
                id, StoragePoolVolumeTypeCustom)
        if err != nil {
                return "", errors.Wrapf(err, "Failed to get custom volumes for 
node %d", id)
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to