Skip to content

Commit

Permalink
pkgdb query: really fix duplicated rquery
Browse files Browse the repository at this point in the history
Fixes: #2164
  • Loading branch information
bapt committed Aug 23, 2023
1 parent 5b5ebca commit 413ac72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions libpkg/pkgdb_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pkgdb_query_cond(struct pkgdb *db, const char *cond, const char *pattern, match_
" LEFT JOIN annotation tag ON pkg_annotation.tag_id = tag.annotation_id "
" LEFT JOIN annotation value ON pkg_annotation.value_id = value.annotation_id "
" WHERE tag.annotation = 'flavor') "
"SELECT DISTINCT p.id, origin, p.name, p.name as uniqueid, "
"SELECT DISTINCT(p.id), origin, p.name, p.name as uniqueid, "
" version, comment, desc, "
" message, arch, maintainer, www, "
" prefix, flatsize, licenselogic, automatic, "
Expand All @@ -165,7 +165,7 @@ pkgdb_query_cond(struct pkgdb *db, const char *cond, const char *pattern, match_
comp, pattern == NULL ? "WHERE" : "AND", cond + 7);
} else if (match == MATCH_INTERNAL) {
sqlite3_snprintf(sizeof(sql), sql,
"SELECT DISTINCT p.id, origin, p.name, p.name as uniqueid, "
"SELECT DISTINCT(p.id), origin, p.name, p.name as uniqueid, "
"version, comment, desc, "
"message, arch, maintainer, www, "
"prefix, flatsize, licenselogic, automatic, "
Expand All @@ -180,7 +180,7 @@ pkgdb_query_cond(struct pkgdb *db, const char *cond, const char *pattern, match_
" LEFT JOIN annotation tag ON pkg_annotation.tag_id = tag.annotation_id "
" LEFT JOIN annotation value ON pkg_annotation.value_id = value.annotation_id "
" WHERE tag.annotation = 'flavor') "
"SELECT DISTINCT p.id, origin, p.name, p.name as uniqueid, "
"SELECT DISTINCT(p.id), origin, p.name, p.name as uniqueid, "
"version, comment, desc, "
"message, arch, maintainer, www, "
"prefix, flatsize, licenselogic, automatic, "
Expand Down
4 changes: 2 additions & 2 deletions libpkg/repo/binary/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pkg_repo_binary_query(struct pkg_repo *repo, const char *cond, const char *patte
char *sql = NULL;
const char *comp = NULL;
char basesql_quick[] = ""
"SELECT p.id, origin, p.name, p.name as uniqueid, version, comment, "
"SELECT DISTINCT(p.id), origin, p.name, p.name as uniqueid, version, comment, "
"prefix, desc, arch, maintainer, www, "
"licenselogic, flatsize, pkgsize, "
"cksum, manifestdigest, path AS repopath, '%s' AS dbname "
Expand All @@ -120,7 +120,7 @@ pkg_repo_binary_query(struct pkg_repo *repo, const char *cond, const char *patte
" LEFT JOIN annotation value ON pkg_annotation.value_id = value.annotation_id "
" WHERE tag.annotation = 'flavor') "

"SELECT p.id, origin, p.name, p.name as uniqueid, version, comment, "
"SELECT DISTINCT(p.id), origin, p.name, p.name as uniqueid, version, comment, "
"prefix, desc, arch, maintainer, www, "
"licenselogic, flatsize, pkgsize, "
"cksum, manifestdigest, path AS repopath, '%s' AS dbname "
Expand Down

0 comments on commit 413ac72

Please sign in to comment.