kopia lustrzana https://gitlab.com/tomaszg/geostat
SQL: fix previous commits by adding missing to_string
Removed part concerning the commit not pickedmaster
rodzic
c7d8d8ee53
commit
7539454052
8
ocdb.cpp
8
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<std::string, int> 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);
|
||||
|
|
Ładowanie…
Reference in New Issue