From 062cd5bb34d0aa02e42467f04dad50af2a3abd24 Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 3 Sep 2008 06:40:03 +0000 Subject: Fixed invalid select statement when no widgets exists in the macro. --- server/src/database.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server') diff --git a/server/src/database.cc b/server/src/database.cc index d5221f4..9cdbb7f 100644 --- a/server/src/database.cc +++ b/server/src/database.cc @@ -167,10 +167,14 @@ Values Database::getValues(std::string cpr, first = false; i++; } - query << ")"; + if(fields.size() > 0) query << ")"; query << " ORDER BY transactions.timestamp"; +#ifdef WITH_DEBUG + printf("%s\n", query.str().c_str()); +#endif/*WITH_DEBUG*/ + #ifndef WITHOUT_DB pqxx::result R = W.exec(query.str()); @@ -191,10 +195,6 @@ Values Database::getValues(std::string cpr, ri++; } #endif/*WITHOUT_DB*/ - -#ifdef WITH_DEBUG - printf("%s\n", query.str().c_str()); -#endif/*WITH_DEBUG*/ return values; } -- cgit v1.2.3