From 7539454052be0edf374d1802b81b2e5aafc1555a Mon Sep 17 00:00:00 2001 From: Tomasz Golinski Date: Mon, 14 Sep 2020 21:30:31 +0200 Subject: [PATCH] SQL: fix previous commits by adding missing to_string Removed part concerning the commit not picked --- ocdb.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocdb.cpp b/ocdb.cpp index b9950d9..e24e83e 100644 --- a/ocdb.cpp +++ b/ocdb.cpp @@ -321,9 +321,9 @@ Caches OCdb::get_user_caches_not_found(const std::string& uuid) const { Caches cc; sql = "SELECT code, location, region FROM caches WHERE status = "; - sql += ok; + sql += std::to_string(ok); sql += " AND NOT EXISTS (SELECT cache_code FROM logs WHERE cache_code = code AND type = "; - sql += found; + sql += std::to_string(found); sql += " and user = ?1) AND owner != ?1;"; res = sqlite3_prepare_v2(db, sql.c_str(), sql.length() + 1, &stmt, NULL); @@ -359,7 +359,7 @@ Caches OCdb::get_user_caches(const std::string& uuid, __attribute__((unused)) in //code TEXT PRIMARY KEY, name TEXT, location TEXT, type TEXT, status INTEGER, size TEXT, difficulty INTEGER, terrain INTEGER, country TEXT, region TEXT, owner TEXT) sql = "SELECT code, location, type, size, difficulty, terrain, country, region, owner, status, name FROM caches WHERE EXISTS (SELECT cache_code FROM logs WHERE cache_code = code AND type = "; - sql += found; + sql += std::to_string(found); sql += " and user = ?);"; res = sqlite3_prepare_v2(db, sql.c_str(), sql.length() + 1, &stmt, NULL); @@ -453,7 +453,7 @@ std::map OCdb::get_region_stats() { //code TEXT PRIMARY KEY, name TEXT, location TEXT, type TEXT, status INTEGER, size TEXT, difficulty INTEGER, terrain INTEGER, country TEXT, region TEXT, owner TEXT) sql = "SELECT COUNT(code) FROM caches WHERE status = "; - sql += ok; + sql += std::to_string(ok); sql += " AND region = ?;"; res = sqlite3_prepare_v2(db, sql.c_str(), sql.length() + 1, &stmt, NULL);