store functional components in database

This commit is contained in:
Andreas Steffen
2011-11-28 21:20:23 +01:00
parent 17f69fbcb5
commit 40cfe6db6a
4 changed files with 94 additions and 63 deletions
+6 -6
View File
@@ -74,13 +74,13 @@ METHOD(pts_database_t, create_comp_evid_enumerator, enumerator_t*,
{
enumerator_t *e;
/* look for all entries belonging to a product in the files table */
/* look for all entries belonging to a product in the components table */
e = this->db->query(this->db,
"SELECT f.path FROM files AS f "
"JOIN product_file AS pf ON f.id = pf.file "
"JOIN products AS p ON p.id = pf.product "
"WHERE p.name = ? AND f.component = 1",
DB_TEXT, product, DB_TEXT);
"SELECT c.vendor_id, c.name, c.qualifier FROM components AS c "
"JOIN product_component AS pc ON c.id = pc.component "
"JOIN products AS p ON p.id = pc.product "
"WHERE p.name = ? ORDER BY pf.order",
DB_TEXT, product, DB_INT, DB_INT, DB_INT);
return e;
}