Re: [gnome-db] libgda/providers/freetds



Hi Rodrigo,

	Here is the uncompressed patch file. I think the one I uploaded to
bugzilla was gzip'ed.

-Seth

On Mon, 15 Sep 2003, Rodrigo Moya wrote:

> On Mon, 2003-09-15 at 09:17 -0400, Seth Remington wrote:
> > The bug you are describing has to do with some freeTDS API changes to 
> > the tds_connect() routine that didn't get properly updated in the gda 
> > provider. I submitted a patch, but I don't think anything has been 
> > done with it yet.
> > 
> > http://bugzilla.gnome.org/show_bug.cgi?id=117202
> > 
> hmm, right, I totally missed it. Could you please re-submit it here, on
> the list? The bugzilla attachment seems to be corrupt, or at least it
> seems so for me.
> 
> cheers
> 
> 

-- 
Seth Remington
SaberLogic, LLC
661-B Weber Drive
Wadsworth, Ohio 44281
Phone: (330)335-6442
Fax: (330)336-8559
Index: providers/freetds/gda-freetds-provider.c
===================================================================
RCS file: /cvs/gnome/libgda/providers/freetds/gda-freetds-provider.c,v
retrieving revision 1.27
diff -u -r1.27 gda-freetds-provider.c
--- providers/freetds/gda-freetds-provider.c	9 Mar 2003 18:55:34 -0000	1.27
+++ providers/freetds/gda-freetds-provider.c	11 Jul 2003 12:37:40 -0000
@@ -243,6 +243,9 @@
 	tds_set_library(tds_cnc->login, "TDS-Library");
 	if (t_host)
 		tds_set_server(tds_cnc->login, (char *) t_host);
+
+	if (t_port)
+		tds_set_port(tds_cnc->login, atoi(t_port));
 	
 	tds_set_charset(tds_cnc->login, "iso_1");
 	tds_set_language(tds_cnc->login, "us_english");
@@ -267,7 +270,21 @@
 #if defined(HAVE_FREETDS_VER0_60)
 	tds_cnc->tds = tds_connect(tds_cnc->login, tds_cnc->ctx, NULL);
 #elif defined(HAVE_FREETDS_VER0_6X)
-	tds_connect (tds_cnc->tds, tds_cnc->config);
+	tds_cnc->tds = tds_alloc_socket(tds_cnc->ctx, 512);
+	if (! tds_cnc->tds) {
+		gda_log_error (_("Allocating tds socket failed."));
+		gda_freetds_free_connection_data (tds_cnc);
+		gda_connection_add_error_string (cnc, _("Allocating tds socket failed."));
+		return FALSE;
+	}
+	tds_set_parent (tds_cnc->tds, NULL);
+	tds_cnc->config = tds_read_config_info (NULL, tds_cnc->login, tds_cnc->ctx->locale);
+	if (tds_connect (tds_cnc->tds, tds_cnc->config) != TDS_SUCCEED) {
+		gda_log_error (_("Establishing connection failed."));
+		//gda_freetds_free_connection_data (tds_cnc);
+		gda_connection_add_error_string (cnc, _("Establishing connection failed."));
+		return FALSE;
+	}
 #else
 	tds_cnc->tds = tds_connect(tds_cnc->login, NULL);
 #endif
Index: providers/freetds/gda-freetds-provider.h
===================================================================
RCS file: /cvs/gnome/libgda/providers/freetds/gda-freetds-provider.h,v
retrieving revision 1.13
diff -u -r1.13 gda-freetds-provider.h
--- providers/freetds/gda-freetds-provider.h	9 Mar 2003 18:55:34 -0000	1.13
+++ providers/freetds/gda-freetds-provider.h	11 Jul 2003 12:37:40 -0000
@@ -66,7 +66,7 @@
 #ifdef HAVE_FREETDS_VER0_6X
 	TDSCONNECTINFO *config;    /* tds connect struct */
 #else
-	TDSCONFIGINFO  *config     /* tds config struct */
+	TDSCONFIGINFO  *config;     /* tds config struct */
 #endif
 
 	/* Data just got at connection beginning */


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