From 28c1f8800b1cee13dc1d12c66a457675e6364561 Mon Sep 17 00:00:00 2001 From: regnat Date: Wed, 9 Jun 2021 18:47:39 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20list=20known=20absent=20attribu?= =?UTF-8?q?tes=20in=20listChildren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libexpr/tree-cache.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libexpr/tree-cache.cc b/src/libexpr/tree-cache.cc index 2b7f783fb..e8e43b8ce 100644 --- a/src/libexpr/tree-cache.cc +++ b/src/libexpr/tree-cache.cc @@ -63,7 +63,7 @@ struct AttrDb "select id, type, value, context from Attributes where parent = ? and name = ?"); state->queryAttributes.create(state->db, - "select name from Attributes where parent = ?"); + "select name, type from Attributes where parent = ?"); state->txn = std::make_unique(state->db); } @@ -198,8 +198,10 @@ struct AttrDb auto queryAttributes(state->queryAttributes.use()(parentId)); - while (queryAttributes.next()) + while (queryAttributes.next()) { + if (queryAttributes.getInt(1) != AttrType::Missing) res.push_back(queryAttributes.getStr(0)); + } return res; }