summaryrefslogtreecommitdiff
path: root/misc/cdcollect/files/patch-src_DBsql.cs
blob: 1fabeaf615678aced2d5971974ab4b7bd96def3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- src/DBsql.cs.orig
+++ src/DBsql.cs
@@ -958,10 +958,10 @@
 	private int sql_command_id (string comm)
 	{	
 		IDbCommand command = sqlite_connection.CreateCommand ();
-		command.CommandText = comm;
-		command.ExecuteScalar ();
+		command.CommandText = comm + "; SELECT last_insert_rowid() AS [ID]";
+		string s = command.ExecuteScalar ().ToString ();
 		command.Dispose ();
-		return (((SqliteConnection)sqlite_connection).LastInsertRowId);
+		return Int32.Parse (s);
 	}
 	
 	private void sql_command (string comm)