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
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to