[rygel] db: Fix exec to run multiple queries at once
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] db: Fix exec to run multiple queries at once
- Date: Thu, 3 Sep 2015 20:55:33 +0000 (UTC)
commit 9cc38dbd7c0a4016e8399796f0422c26018b34e7
Author: Jens Georg <mail jensge org>
Date: Thu Sep 3 22:52:05 2015 +0200
db: Fix exec to run multiple queries at once
Signed-off-by: Jens Georg <mail jensge org>
src/librygel-db/database.vala | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/librygel-db/database.vala b/src/librygel-db/database.vala
index e931c55..94d915c 100644
--- a/src/librygel-db/database.vala
+++ b/src/librygel-db/database.vala
@@ -195,6 +195,16 @@ public class Rygel.Database.Database : Object {
public void exec (string sql,
GLib.Value[]? arguments = null)
throws DatabaseError {
+ if (arguments == null) {
+ this.db.exec (sql);
+ if (this.db.errcode () != Sqlite.OK) {
+ var msg = "Failed to run query %s: %s";
+ throw new DatabaseError.SQLITE_ERROR (msg, sql, this.db.errmsg ());
+ }
+
+ return;
+ }
+
var cursor = this.exec_cursor (sql, arguments);
while (cursor.has_next ()) {
cursor.next ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]