summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authordeva <deva>2008-09-03 06:40:03 +0000
committerdeva <deva>2008-09-03 06:40:03 +0000
commit062cd5bb34d0aa02e42467f04dad50af2a3abd24 (patch)
treef24401b6e9ad165f0b71d2f49ce013251907ea88 /server
parentc2be175d8f3e6cc471d53d3918423b3a3eabbc30 (diff)
Fixed invalid select statement when no widgets exists in the macro.
Diffstat (limited to 'server')
-rw-r--r--server/src/database.cc10
1 files changed, 5 insertions, 5 deletions
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;
}