diff options
author | Werner Koch <wk@gnupg.org> | 2020-01-07 17:12:25 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-01-07 17:12:25 +0100 |
commit | 41a882443622fe08ebaa75bf358e83630bbb8631 (patch) | |
tree | f1b4edbc3d4a7e73f7e9708a6c33396bfca647c2 /kbx/backend-sqlite.c | |
parent | scd: Minor fix for readibility. (diff) | |
download | gnupg2-41a882443622fe08ebaa75bf358e83630bbb8631.tar.xz gnupg2-41a882443622fe08ebaa75bf358e83630bbb8631.zip |
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.
Diffstat (limited to 'kbx/backend-sqlite.c')
-rw-r--r-- | kbx/backend-sqlite.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kbx/backend-sqlite.c b/kbx/backend-sqlite.c index e5fda9458..5f716e22c 100644 --- a/kbx/backend-sqlite.c +++ b/kbx/backend-sqlite.c @@ -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, |