diff options
| author | Tristan Riehs <tristan.riehs@inria.fr> | 2025-11-14 20:19:16 +0100 |
|---|---|---|
| committer | Tristan Riehs <tristan.riehs@inria.fr> | 2025-11-14 20:19:16 +0100 |
| commit | 9a36e20e16757df824dfb8cca9284c45d3a2b52e (patch) | |
| tree | 11e6b11dc788dd49c4aa94d83258e5e2ed866a96 | |
| parent | e8378d575dd77cf1436ee147920b7c775ee3b7af (diff) | |
Query was not working because tag ID was bad
| -rw-r--r-- | src/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -408,10 +408,11 @@ static void ftag_query_join(sqlite3 *db, char *sql, int max_len, strncat(sql, prefix, max_len - strlen(sql)); assert(strlen(sql) <= max_len); ftag_query_join(db, sql, max_len, tags, tag_count-1); + int tag_id = get_id_by_col(db, "tags", "name", tags[tag_count-1]); char suffix[128]; memset(suffix, 0, sizeof(suffix)); snprintf(suffix, sizeof(suffix)-1, - "\t\tON id = file\n\t\tWHERE tag = %d)\n", tag_count-1); + "\t\tON id = file\n\t\tWHERE tag = %d)\n", tag_id); strncat(sql, suffix, max_len - strlen(sql)); assert(strlen(sql) <= max_len); } |
