Re: [gnome-db] A small question.



On Fri, 2002-11-01 at 17:00, Ricardo Cervera Navarro wrote:
> El vie, 01-11-2002 a las 19:35, Rodrigo Moya escribió:
> > On Fri, 2002-11-01 at 19:27, Ricardo Cervera Navarro wrote:
> > > Hi.
> > > 
> > > 	I wonder if this is the correct place to ask this. If not, sorry.
> > > 
> > > 	I am starting to use libgda (running the code of the examples in the
> > > manual) and having a small problem. My little programs compile cleanly
> > > but when I run them and try to do a query, I get this:
> > > 
> > > 
> > > 
> > > ** (TestGDA:1642): CRITICAL **: file gda-connection.c: line 642
> > > (gda_connection_execute_command): assertion `GDA_IS_CONNECTION (cnc)'
> > > failed
> > > 
> > > 
> > this error is because you're passing an incorrect GdaConnection to that
> > function. Could you show us the code of your program?
> 
> 	Sure. It is based on the examples in the manual:
> 
> 	http://ns.zonasiete.org/~ricardo/command.c
> 
> 	Thanks again.

Hi Rodrigo,
Hi all,

I was playing with libgda today and also have problems getting a valid
connection returned. I did a bit of debugging, and found what appears to
be the offending (missing) code.

The MYSQL connection structure is not being initialized as mandated by
the mysql API. As a bonus, take a patch! :-)

After that, I was able to successfully connect.

Cheers.
-- 
Cleber Rodrigues <cleberjr at terra dot com dot br>
? mysql_init_bug.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libgda/ChangeLog,v
retrieving revision 1.399
diff -u -r1.399 ChangeLog
--- ChangeLog	30 Oct 2002 19:35:39 -0000	1.399
+++ ChangeLog	1 Nov 2002 20:58:20 -0000
@@ -1,3 +1,7 @@
+2002-11-01  Cleber Rodrigues <cleber gnome-db org>
+	* providers/mysql/gda-mysql-provider.c: added missing mysql_init()
+	on the initialization of the connection structure.
+
 2002-10-30  Holger Thon <holger thon gnome-db org>
 
 	* configure.in: added library collision check against freetds ct,
Index: providers/mysql/gda-mysql-provider.c
===================================================================
RCS file: /cvs/gnome/libgda/providers/mysql/gda-mysql-provider.c,v
retrieving revision 1.36
diff -u -r1.36 gda-mysql-provider.c
--- providers/mysql/gda-mysql-provider.c	29 Oct 2002 01:40:40 -0000	1.36
+++ providers/mysql/gda-mysql-provider.c	1 Nov 2002 20:58:26 -0000
@@ -224,8 +224,9 @@
 		if (!t_host)
 			t_host = "localhost";
 	}
-
+	
 	mysql = g_new0 (MYSQL, 1);
+	mysql_init (mysql);
 	mysql = mysql_real_connect (mysql, t_host, t_user, t_password,
 #if MYSQL_VERSION_ID >= 32200
 				    t_db,


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