Skip to content

Commit

Permalink
Merge pull request #7054 from tomponline/tp-storage-ceph
Browse files Browse the repository at this point in the history
DB: Tweaks LEFT JOIN to just JOIN in NodeIsEmpty()
  • Loading branch information
freeekanayaka committed Mar 18, 2020
2 parents 67714cb + f46db35 commit 2209851
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lxd/db/node.go
Expand Up @@ -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)
Expand Down

0 comments on commit 2209851

Please sign in to comment.