[Rpm-maint] [rpm-software-management/rpm] Fix --querybynumber on non-existent record, add test (#911)

Panu Matilainen notifications at github.com
Wed Oct 23 07:59:31 UTC 2019


RPMDBI_PACKAGES differs from the indexes in how record searches behave, indexes return NULL for non-existent values but with RPMDBI_PACKAGES (and the pseudo index LABEL) we always get an iterator which we need to walk to determine whether there's data or not. Use the newly introduced helper to get the query return right.
    
One could argue that this should be done in the database code, but then the behavior is kinda consistent other iteration over RPMDBI_PACKAGES: you don't know how many, if any, matches there are until you walk it.

You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/911

-- Commit Summary --

  * Refactor query match counting to a helper function
  * Fix --querybynumber on non-existent record, add test

-- File Changes --

    M lib/query.c (31)
    M tests/rpmdb.at (31)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/911.patch
https://github.com/rpm-software-management/rpm/pull/911.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/911
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20191023/cb45c24f/attachment.html>


More information about the Rpm-maint mailing list