kbx: Make sure the tables are joined in a select.

* kbx/backend-sqlite.c (run_select_statement): Join the tables.
--

For whatever reasons that part was missing or got lost before
committing.
This commit is contained in:
Werner Koch 2020-01-07 17:12:25 +01:00
parent c0625c15c1
commit 41a8824436
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 3 additions and 3 deletions

View File

@ -775,7 +775,7 @@ run_select_statement (be_sqlite_local_t ctx,
if (!ctx->select_stmt)
err = run_sql_prepare ("SELECT p.ubid, p.type, p.keyblob"
" FROM pubkey as p, fingerprint as f"
" WHERE f.kid = ?1",
" WHERE p.ubid = f.ubid AND f.kid = ?1",
&ctx->select_stmt);
if (!err)
err = run_sql_bind_int64 (ctx->select_stmt, 1,
@ -786,7 +786,7 @@ run_select_statement (be_sqlite_local_t ctx,
if (!ctx->select_stmt)
err = run_sql_prepare ("SELECT p.ubid, p.type, p.keyblob"
" FROM pubkey as p, fingerprint as f"
" WHERE f.fpr = ?1",
" WHERE p.ubid = f.ubid AND f.fpr = ?1",
&ctx->select_stmt);
if (!err)
err = run_sql_bind_blob (ctx->select_stmt, 1,
@ -797,7 +797,7 @@ run_select_statement (be_sqlite_local_t ctx,
if (!ctx->select_stmt)
err = run_sql_prepare ("SELECT p.ubid, p.type, p.keyblob"
" FROM pubkey as p, fingerprint as f"
" WHERE f.keygrip = ?1",
" WHERE p.ubid = f.ubid AND f.keygrip = ?1",
&ctx->select_stmt);
if (!err)
err = run_sql_bind_blob (ctx->select_stmt, 1,