# HG changeset patch # User Alain Mazy # Date 1768477081 -3600 # Node ID 15f949790d842e0467786c7a3464dec471e54a76 # Parent 048240f671d286791a2013f7cdeb2e7b45c7e90c# Parent 3031d83a09e56f087c8ff9589ad2fc96a5b5f993 merge diff -r 3031d83a09e5 -r 15f949790d84 Framework/Plugins/ISqlLookupFormatter.cpp --- a/Framework/Plugins/ISqlLookupFormatter.cpp Fri Jan 02 13:04:14 2026 +0100 +++ b/Framework/Plugins/ISqlLookupFormatter.cpp Thu Jan 15 12:38:01 2026 +0100 @@ -811,6 +811,10 @@ where.push_back("(SELECT COUNT(1) FROM Labels AS selectedLabels WHERE selectedLabels.id = " + FormatLevel(queryLevel) + ".internalId AND selectedLabels.label IN (" + Join(formattedLabels, "", ", ") + ")) " + condition); } + else if (labelsConstraint == LabelsConstraint_None) // from 1.12.11, 'None' with an empty labels list means "list all resources without any labels" + { + where.push_back("(SELECT COUNT(1) FROM Labels WHERE id = " + FormatLevel(queryLevel) + ".internalId) = 0"); + } sql += joins + Join(where, " WHERE ", " AND "); @@ -1126,6 +1130,10 @@ where.push_back("(SELECT COUNT(1) FROM Labels AS selectedLabels WHERE selectedLabels.id = " + strQueryLevel + ".internalId AND selectedLabels.label IN (" + Join(formattedLabels, "", ", ") + ")) " + condition); } + else if (request.labels_constraint() == LabelsConstraint_None) // from 1.12.11, 'None' with an empty labels list means "list all resources without any labels" + { + where.push_back("(SELECT COUNT(1) FROM Labels WHERE id = " + FormatLevel(queryLevel) + ".internalId) = 0"); + } sql += joins + orderingJoins + Join(where, " WHERE ", " AND "); @@ -1245,6 +1253,11 @@ ") AS temp " " WHERE labelsCount " + condition + ")"); } + else if (labelsConstraint == LabelsConstraint_None) // from 1.12.11, 'None' with an empty labels list means "list all resources without any labels" + { + sql += (" AND (SELECT COUNT(1) FROM Labels WHERE id = internalId) = 0"); + } + if (limit != 0) { diff -r 3031d83a09e5 -r 15f949790d84 Framework/Plugins/IndexBackend.cpp --- a/Framework/Plugins/IndexBackend.cpp Fri Jan 02 13:04:14 2026 +0100 +++ b/Framework/Plugins/IndexBackend.cpp Thu Jan 15 12:38:01 2026 +0100 @@ -2356,9 +2356,8 @@ ISqlLookupFormatter::GetLookupLevels(lowerLevel, upperLevel, queryLevel, lookup); std::string sql; - bool enableNewStudyCode = true; - - if (enableNewStudyCode && lowerLevel == queryLevel && upperLevel == queryLevel) + + if (lowerLevel == queryLevel && upperLevel == queryLevel) { ISqlLookupFormatter::ApplySingleLevel(sql, formatter, lookup, queryLevel, labels, labelsConstraint, limit); diff -r 3031d83a09e5 -r 15f949790d84 PostgreSQL/NEWS --- a/PostgreSQL/NEWS Fri Jan 02 13:04:14 2026 +0100 +++ b/PostgreSQL/NEWS Thu Jan 15 12:38:01 2026 +0100 @@ -1,3 +1,11 @@ +Pending changes in the mainline +=============================== + +Changes: +* In tools/find, filtering against "LabelsConstraint": "None" with an empty "Labels" list + now returns all resources that do not have any labels attached instead of returning all resources. + + Release 10.0 (2025-12-02) =========================