[gnome-db] [PATCH] SQLite provider



The SQLite provider has some problems in its open_connection function.
The attached patch fixes them.  gda_sqlite_provider_single_command is
called before scnc is set up properly, and thus fails, reporting an
error using gda_log_error() which hangs waiting on my machine (dunno
why).
	nikolai

--
::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Index: gda-sqlite-provider.c
===================================================================
RCS file: /cvs/gnome/libgda/providers/sqlite/gda-sqlite-provider.c,v
retrieving revision 1.24
diff -u -r1.24 gda-sqlite-provider.c
--- gda-sqlite-provider.c	16 Jan 2003 00:13:28 -0000	1.24
+++ gda-sqlite-provider.c	28 Dec 2003 19:55:00 -0000
@@ -215,13 +215,11 @@
 		return FALSE;
 	}
 
+	g_object_set_data (G_OBJECT (cnc), OBJECT_DATA_SQLITE_HANDLE, scnc);
+
 	/* set SQLite library options */
 	if (!gda_sqlite_provider_single_command (sqlite_prv, cnc, "PRAGMA empty_result_callbacks = ON"))
-		gda_log_error (_("Could not set empty_result_callbacks SQLite option"));
-
-	g_object_set_data (G_OBJECT (cnc),
-			   OBJECT_DATA_SQLITE_HANDLE,
-			   scnc);
+		gda_connection_add_error_string (cnc, _("Could not set empty_result_callbacks SQLite option"));
 
 	return TRUE;
 }
@@ -547,7 +545,7 @@
 	gboolean result;
 	gint status;
 	gchar *errmsg = NULL;
-
+	
 	scnc = g_object_get_data (G_OBJECT (cnc), OBJECT_DATA_SQLITE_HANDLE);
 
 	if (!scnc) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]