Re: [gnome-db] Firebird driver



Hi Vivien,

Sorry for the late response.

Here is my patch file so far for the firebird provider.

It only run select statements. Your feedback and guidance will be
appreciated.

There is still quite a bit missing, but at least I can now select data
from a firebird database :-). Please note that it does not do the input,
parameters for statements.....mainly cause I never use it :-)

If there is some interest I'll work some more on it ;-)

Please ignore the changes to the files needed for compilation, I was
just messing with it to get it to compile.

Regards,
Faghmie




On Thu, 2011-11-24 at 20:49 +0100, Vivien Malerba wrote:
> 
> 
> On 24 November 2011 18:58, Faghmie Davids <faghmie aquasoftware co za>
> wrote:
>         Hi,
>         
>         My name is Faghmie and I have been doing some work on the
>         firebird driver for libgda. I got it returning recordsets and
>         would like to commit this code back to the project.
> 
> Great, thanks!
>  
> 
>         
>         Can someone please assist me in doing this?
> 
> Of course!
> 
> The best way is that you send me the modifications you made as a
> patch.
> 
> If you have worked on Libgda using a git clone, then this is very
> easy, as you only need to run "git diff > PATCH" to generate the patch
> file. If you did not use a git clone and got Libgda's source code from
> a tarball, then you can use the diff command on the original an
> modified versions of Libgda's code and generate the patch.
> 
> If you're not sure, you can send me a complete tarball of your working
> copy (via email or a file hosting site).
> 
> Anyway, if you plan to make more improvements to the Firebird provider
> and don't use git, I suggest you create your local clone using git as
> mentionned at the bottom of the  http://git.gnome.org/browse/libgda/
> page.
> 
> If you have any difficulty generating the patch or a tarball, please
> let me know.
> 
> Best regards,
> 
> Vivien
> 
diff --git a/configure.ac b/configure.ac
old mode 100644
new mode 100755
index dfa63d4..d196713
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +10,7 @@ m4_include(m4/mdbtools.m4)
 m4_include(m4/bdb.m4)
 m4_include(m4/mysql.m4)
 m4_include(m4/postgresql.m4)
+m4_include(m4/firebird.m4)
 m4_include(m4/oracle.m4)
 m4_include(m4/java.m4)
 m4_include(m4/ldap.m4)
@@ -603,23 +604,26 @@ dnl Test for LDAP
 LDAP_CHECK($lib)
 
 dnl test for FireBird
+FIREBIRD_CHECK($lib)
+
 try_firebird=true
 AC_ARG_WITH(firebird,
 [  --with-firebird=<directory>	use FireBird backend in <directoty>],[
 if test $withval = no
 then
-	try_firebird=false
+	try_firebird=true
 elif test $withval = yes
 then
-	dir="/usr/local"
+	dir="/usr/lib"
 else
-	dir=$withval
+	dir="/usr/lib"
+	dnl dir=$withval
 fi
 ])
-if test $try_firebird = true
-then
+dnl if test $try_firebird = true
+dnl then
 	AC_MSG_CHECKING(for FireBird installation)
-	for d in $dir /usr/local/firebird /usr/local /usr /opt/firebird
+	for d in $dir /usr/local/firebird /usr/local /usr /opt/firebird /usr/lib
 	do
 		if test -f $d/include/ibase.h
 		then
@@ -646,7 +650,9 @@ then
 			fi
 		fi
 	fi
-fi
+dnl fi
+
+echo "Faghmie >>>>> [$firebirddir]"
 
 AM_CONDITIONAL(FIREBIRD, test x$firebirddir != x)
 
@@ -895,6 +901,8 @@ providers/oracle/Makefile
 providers/oracle/libgda-oracle-5.0.pc
 providers/postgres/Makefile
 providers/postgres/libgda-postgres-5.0.pc
+providers/firebird/Makefile
+providers/firebird/libgda-firebird-5.0.pc
 providers/sqlite/Makefile
 providers/sqlite/libgda-sqlite-5.0.pc
 providers/jdbc/Makefile
diff --git a/libgda.spec.in b/libgda.spec.in
index 6fc4eff..be4479f 100644
--- a/libgda.spec.in
+++ b/libgda.spec.in
@@ -24,7 +24,7 @@
 %define           SYBASE   0
 %define 	  MDB	   0
 %define		  LDAP	   0
-%define		  FIREBIRD 0
+%define		  FIREBIRD 1
 
 %{?_with_tds:%define FREETDS 	1}
 %{?_with_db2:%define IBMDB2 	1}
diff --git a/providers/Makefile.am b/providers/Makefile.am
index b8fa6fe..d19338c 100644
--- a/providers/Makefile.am
+++ b/providers/Makefile.am
@@ -6,9 +6,9 @@ if BDBSQL
 GDA_BDBSQL_SERVER=bdbsql
 endif
 
-if FIREBIRD
+#if FIREBIRD
 GDA_FIREBIRD_SERVER=firebird
-endif
+#endif
 
 if MDB
 GDA_MDB_SERVER=mdb
@@ -55,6 +55,6 @@ SUBDIRS = \
 	$(GDA_ORACLE_SERVER) \
 	$(GDA_WEB_SERVER) \
 	$(GDA_SQLCIPHER_SERVER) \
-	$(GDA_LDAP_SERVER)
-#	$(GDA_FIREBIRD_SERVER) 
+	$(GDA_LDAP_SERVER) \
+	$(GDA_FIREBIRD_SERVER) 
 
diff --git a/providers/firebird/Makefile.am b/providers/firebird/Makefile.am
index c9fcd82..12d4bc7 100644
--- a/providers/firebird/Makefile.am
+++ b/providers/firebird/Makefile.am
@@ -8,7 +8,7 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir) \
 	-I$(top_srcdir)/libgda \
 	-I$(top_builddir) \
-	$(COREDEPS_CFLAGS) $(COREDEPS_WFLAGS) #$(FIREBIRD_CFLAGS) 
+	$(COREDEPS_CFLAGS) $(COREDEPS_WFLAGS) $(FIREBIRD_CFLAGS) 
 
 # parser generation
 parser.c parser.h: parser.y $(top_builddir)/libgda/sql-parser/lemon$(EXEEXT_FOR_BUILD)
@@ -23,14 +23,14 @@ firebird_token_types.h: gen_def$(EXEEXT_FOR_BUILD) parser.h
 $(OBJECTS) $(libgda_firebird_la_OBJECTS): firebird_token_types.h
 
 libgda_firebird_la_SOURCES = \
+	gda-firebird-provider.c \
+	gda-firebird-provider.h \
 	gda-firebird-blob-op.c \
 	gda-firebird-blob-op.h \
 	gda-firebird-ddl.c \
 	gda-firebird-ddl.h \
 	gda-firebird-parser.c \
 	gda-firebird-parser.h \
-	gda-firebird-provider.c \
-	gda-firebird-provider.h \
 	gda-firebird-pstmt.h \
 	gda-firebird-pstmt.c \
 	gda-firebird-meta.c \
@@ -42,13 +42,13 @@ libgda_firebird_la_SOURCES = \
 	gda-firebird.h \
 	libmain.c \
 	parser.h \
-        parser.c \
-        firebird_token_types.h
+	parser.c \
+	firebird_token_types.h
 
 libgda_firebird_la_LDFLAGS = -export-dynamic -module -avoid-version $(NO_UNDEFINED) $(LIBTOOL_PROV_EXPORT_OPTIONS)
 libgda_firebird_la_LIBADD = \
 	$(top_builddir)/libgda/libgda-5.0.la \
-	$(COREDEPS_LIBS) #$(FIREBIRD_LIBS)
+	$(COREDEPS_LIBS) $(FIREBIRD_LIBS)
 
 xmldir   = $(datadir)/libgda-5.0
 xml_in_files = \
diff --git a/providers/firebird/gda-firebird-blob-op.c b/providers/firebird/gda-firebird-blob-op.c
index 34dcb48..492003c 100644
--- a/providers/firebird/gda-firebird-blob-op.c
+++ b/providers/firebird/gda-firebird-blob-op.c
@@ -25,7 +25,7 @@
 
 struct _GdaFirebirdBlobOpPrivate {
 	GdaConnection *cnc;
-	/* TO_ADD: specific information describing a Blob in the C API */
+	//TO_ADD: specific information describing a Blob in the C API
 };
 
 static void gda_firebird_blob_op_class_init (GdaFirebirdBlobOpClass *klass);
@@ -45,8 +45,10 @@ static GObjectClass *parent_class = NULL;
 GType
 gda_firebird_blob_op_get_type (void)
 {
+	return 0;
+	/*
 	static GType type = 0;
-
+	
 	if (G_UNLIKELY (type == 0)) {
 		static GStaticMutex registering = G_STATIC_MUTEX_INIT;
 		static const GTypeInfo info = {
@@ -65,24 +67,29 @@ gda_firebird_blob_op_get_type (void)
 			type = g_type_register_static (GDA_TYPE_BLOB_OP, "GdaFirebirdBlobOp", &info, 0);
 		g_static_mutex_unlock (&registering);
 	}
+	
 	return type;
+	*/
 }
 
 static void
 gda_firebird_blob_op_init (GdaFirebirdBlobOp *op,
 			   GdaFirebirdBlobOpClass *klass)
 {
+	/*
 	g_return_if_fail (GDA_IS_FIREBIRD_BLOB_OP (op));
 
 	op->priv = g_new0 (GdaFirebirdBlobOpPrivate, 1);
 
-	/* initialize specific structure */
-	TO_IMPLEMENT;
+	// initialize specific structure
+	//TO_IMPLEMENT;
+	*/
 }
 
 static void
 gda_firebird_blob_op_class_init (GdaFirebirdBlobOpClass *klass)
 {
+	/*
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 	GdaBlobOpClass *blob_class = GDA_BLOB_OP_CLASS (klass);
 
@@ -92,27 +99,32 @@ gda_firebird_blob_op_class_init (GdaFirebirdBlobOpClass *klass)
 	blob_class->get_length = gda_firebird_blob_op_get_length;
 	blob_class->read = gda_firebird_blob_op_read;
 	blob_class->write = gda_firebird_blob_op_write;
+	*/
 }
 
 static void
 gda_firebird_blob_op_finalize (GObject * object)
 {
+	/*
 	GdaFirebirdBlobOp *pgop = (GdaFirebirdBlobOp *) object;
 
 	g_return_if_fail (GDA_IS_FIREBIRD_BLOB_OP (pgop));
 
-	/* free specific information */
-	TO_IMPLEMENT;
+	// free specific information
+	//TO_IMPLEMENT;
 
 	g_free (pgop->priv);
 	pgop->priv = NULL;
 
 	parent_class->finalize (object);
+	*/
 }
 
 GdaBlobOp *
 gda_firebird_blob_op_new (GdaConnection *cnc)
 {
+	return NULL;
+	/*
 	GdaFirebirdBlobOp *pgop;
 
 	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), NULL);
@@ -121,6 +133,8 @@ gda_firebird_blob_op_new (GdaConnection *cnc)
 	pgop->priv->cnc = cnc;
 	
 	return GDA_BLOB_OP (pgop);
+	*/
+	
 }
 
 /*
@@ -129,6 +143,7 @@ gda_firebird_blob_op_new (GdaConnection *cnc)
 static glong
 gda_firebird_blob_op_get_length (GdaBlobOp *op)
 {
+	/*
 	GdaFirebirdBlobOp *pgop;
 
 	g_return_val_if_fail (GDA_IS_FIREBIRD_BLOB_OP (op), -1);
@@ -136,7 +151,8 @@ gda_firebird_blob_op_get_length (GdaBlobOp *op)
 	g_return_val_if_fail (pgop->priv, -1);
 	g_return_val_if_fail (GDA_IS_CONNECTION (pgop->priv->cnc), -1);
 
-	TO_IMPLEMENT;
+	//TO_IMPLEMENT;
+	*/
 	return -1;
 }
 
@@ -146,6 +162,8 @@ gda_firebird_blob_op_get_length (GdaBlobOp *op)
 static glong
 gda_firebird_blob_op_read (GdaBlobOp *op, GdaBlob *blob, glong offset, glong size)
 {
+	return -1;
+	/*
 	GdaFirebirdBlobOp *pgop;
 	GdaBinary *bin;
 
@@ -163,10 +181,11 @@ gda_firebird_blob_op_read (GdaBlobOp *op, GdaBlob *blob, glong offset, glong siz
 	bin->data = g_new0 (guchar, size);
 	bin->binary_length = 0;
 
-	/* fetch blob data using C API into bin->data, and set bin->binary_length */
-	TO_IMPLEMENT;
+	// fetch blob data using C API into bin->data, and set bin->binary_length
+	//TO_IMPLEMENT;
 
 	return bin->binary_length;
+	*/
 }
 
 /*
@@ -175,6 +194,7 @@ gda_firebird_blob_op_read (GdaBlobOp *op, GdaBlob *blob, glong offset, glong siz
 static glong
 gda_firebird_blob_op_write (GdaBlobOp *op, GdaBlob *blob, glong offset)
 {
+	/*
 	GdaFirebirdBlobOp *pgop;
 	GdaBinary *bin;
 
@@ -184,9 +204,10 @@ gda_firebird_blob_op_write (GdaBlobOp *op, GdaBlob *blob, glong offset)
 	g_return_val_if_fail (GDA_IS_CONNECTION (pgop->priv->cnc), -1);
 	g_return_val_if_fail (blob, -1);
 
-	/* write blob using bin->data and bin->binary_length */
+	// write blob using bin->data and bin->binary_length
 	bin = (GdaBinary *) blob;
-	TO_IMPLEMENT;
+	*/
+	//TO_IMPLEMENT;
 
 	return -1;
 }
diff --git a/providers/firebird/gda-firebird-meta.c b/providers/firebird/gda-firebird-meta.c
index 3f15214..052b491 100644
--- a/providers/firebird/gda-firebird-meta.c
+++ b/providers/firebird/gda-firebird-meta.c
@@ -130,8 +130,8 @@ _gda_firebird_meta_udt (GdaServerProvider *prov, GdaConnection *cnc,
 	gboolean retval = TRUE;
 
 	/* set internal holder's values from the arguments */
-	gda_holder_set_value (gda_set_get_holder (i_set, "cat"), udt_catalog);
-	gda_holder_set_value (gda_set_get_holder (i_set, "schema"), udt_schema);
+	gda_holder_set_value (gda_set_get_holder (i_set, "cat"), udt_catalog, error);
+	gda_holder_set_value (gda_set_get_holder (i_set, "schema"), udt_schema, error);
 
 	TO_IMPLEMENT;
 	/* fill in @model, with something like:
diff --git a/providers/firebird/gda-firebird-provider.c b/providers/firebird/gda-firebird-provider.c
index 6dd008c..fa2936b 100644
--- a/providers/firebird/gda-firebird-provider.c
+++ b/providers/firebird/gda-firebird-provider.c
@@ -40,6 +40,7 @@
 #include "gda-firebird-recordset.h"
 #include "gda-firebird-ddl.h"
 #include "gda-firebird-meta.h"
+#include "gda-firebird-parser.h"
 #define _GDA_PSTMT(x) ((GdaPStmt*)(x))
 
 /*
@@ -54,10 +55,17 @@ static GObjectClass *parent_class = NULL;
  * GdaServerProvider's virtual methods
  */
 /* connection management */
-static gboolean            gda_firebird_provider_open_connection (GdaServerProvider *provider, GdaConnection *cnc,
-								  GdaQuarkList *params, GdaQuarkList *auth,
-								  guint *task_id, GdaServerProviderAsyncCallback async_cb, gpointer cb_data);
-static gboolean            gda_firebird_provider_close_connection (GdaServerProvider *provider, GdaConnection *cnc);
+static gboolean            gda_firebird_provider_open_connection (GdaServerProvider *provider
+										, GdaConnection *cnc
+										, GdaQuarkList *params
+										, GdaQuarkList *auth
+										, guint *task_id
+										, GdaServerProviderAsyncCallback async_cb
+										, gpointer cb_data
+							);
+static gboolean            gda_firebird_provider_close_connection (GdaServerProvider *provider
+										, GdaConnection *cnc
+							);
 static const gchar        *gda_firebird_provider_get_server_version (GdaServerProvider *provider, GdaConnection *cnc);
 static const gchar        *gda_firebird_provider_get_database (GdaServerProvider *provider, GdaConnection *cnc);
 
@@ -101,28 +109,54 @@ static GdaDataHandler     *gda_firebird_provider_get_data_handler (GdaServerProv
 static const gchar*        gda_firebird_provider_get_default_dbms_type (GdaServerProvider *provider, GdaConnection *cnc,
 									GType type);
 /* statements */
-static GdaSqlParser        *gda_firebird_provider_create_parser (GdaServerProvider *provider, GdaConnection *cnc);
-static gchar               *gda_firebird_provider_statement_to_sql  (GdaServerProvider *provider, GdaConnection *cnc,
-								     GdaStatement *stmt, GdaSet *params, 
-								     GdaStatementSqlFlag flags,
-								     GSList **params_used, GError **error);
-static gboolean             gda_firebird_provider_statement_prepare (GdaServerProvider *provider, GdaConnection *cnc,
-								     GdaStatement *stmt, GError **error);
-static GObject             *gda_firebird_provider_statement_execute (GdaServerProvider *provider, GdaConnection *cnc,
-								     GdaStatement *stmt, GdaSet *params,
-								     GdaStatementModelUsage model_usage, 
-								     GType *col_types, GdaSet **last_inserted_row, 
-								     guint *task_id, GdaServerProviderAsyncCallback async_cb, 
-								     gpointer cb_data, GError **error);
+static GdaSqlParser        *gda_firebird_provider_create_parser (GdaServerProvider *provider
+									, GdaConnection *cnc
+							);
+							
+static gchar               *gda_firebird_provider_statement_to_sql  (GdaServerProvider *provider
+									, GdaConnection *cnc
+									, GdaStatement *stmt
+									, GdaSet *params
+									, GdaStatementSqlFlag flags
+									, GSList **params_used
+									, GError **error
+							);
+							
+static gboolean             gda_firebird_provider_statement_prepare (GdaServerProvider *provider
+									, GdaConnection *cnc
+									, GdaStatement *stmt, GError **error
+							);
+							
+static GObject             *gda_firebird_provider_statement_execute (GdaServerProvider *provider
+									, GdaConnection *cnc
+									, GdaStatement *stmt
+									, GdaSet *params
+									, GdaStatementModelUsage model_usage
+									, GType *col_types
+									, GdaSet **last_inserted_row
+									, guint *task_id
+									, GdaServerProviderAsyncCallback async_cb
+									, gpointer cb_data, GError **error
+							);
 
 /* distributed transactions */
-static gboolean gda_firebird_provider_xa_start    (GdaServerProvider *provider, GdaConnection *cnc, 
-						   const GdaXaTransactionId *xid, GError **error);
-
-static gboolean gda_firebird_provider_xa_end      (GdaServerProvider *provider, GdaConnection *cnc, 
-						   const GdaXaTransactionId *xid, GError **error);
-static gboolean gda_firebird_provider_xa_prepare  (GdaServerProvider *provider, GdaConnection *cnc, 
-						   const GdaXaTransactionId *xid, GError **error);
+static gboolean gda_firebird_provider_xa_start    (GdaServerProvider *provider
+									, GdaConnection *cnc
+									, const GdaXaTransactionId *xid
+									, GError **error
+							);
+
+static gboolean gda_firebird_provider_xa_end      (GdaServerProvider *provider
+									, GdaConnection *cnc
+									,  const GdaXaTransactionId *xid
+									, GError **error
+							);
+							
+static gboolean gda_firebird_provider_xa_prepare  (GdaServerProvider *provider
+									, GdaConnection *cnc
+									, const GdaXaTransactionId *xid
+									, GError **error
+							);
 
 static gboolean gda_firebird_provider_xa_commit   (GdaServerProvider *provider, GdaConnection *cnc, 
 						   const GdaXaTransactionId *xid, GError **error);
@@ -138,6 +172,8 @@ static GList   *gda_firebird_provider_xa_recover  (GdaServerProvider *provider,
 static void gda_firebird_free_cnc_data (FirebirdConnectionData *cdata);
 
 
+static gchar	*fb_server_get_version (FirebirdConnectionData *fcnc);
+
 /*
  * Prepared internal statements
  * TO_ADD: any prepared statement to be used internally by the provider should be
@@ -187,10 +223,10 @@ gda_firebird_provider_class_init (GdaFirebirdProviderClass *klass)
         provider_class->rollback_savepoint = NULL /*gda_firebird_provider_rollback_savepoint*/;
         provider_class->delete_savepoint = NULL /*gda_firebird_provider_delete_savepoint*/;
 
-	provider_class->create_parser = NULL /*gda_firebird_provider_create_parser*/;
-	provider_class->statement_to_sql = NULL /*gda_firebird_provider_statement_to_sql*/;
-	provider_class->statement_prepare = NULL /*gda_firebird_provider_statement_prepare*/;
-	provider_class->statement_execute = NULL /*gda_firebird_provider_statement_execute*/;
+	provider_class->create_parser = gda_firebird_provider_create_parser;
+	provider_class->statement_to_sql = gda_firebird_provider_statement_to_sql;
+	provider_class->statement_prepare = gda_firebird_provider_statement_prepare;
+	provider_class->statement_execute = gda_firebird_provider_statement_execute;
 
 	provider_class->is_busy = NULL;
 	provider_class->cancel = NULL;
@@ -277,7 +313,7 @@ gda_firebird_provider_get_type (void)
 	static GType type = 0;
 
 	if (G_UNLIKELY (type == 0)) {
-		static GStaticMutex registering = G_STATIC_MUTEX_INIT;
+		//static GStaticMutex registering = G_STATIC_MUTEX_INIT;
 		static GTypeInfo info = {
 			sizeof (GdaFirebirdProviderClass),
 			(GBaseInitFunc) NULL,
@@ -330,6 +366,7 @@ gda_firebird_provider_open_connection (GdaServerProvider *provider, GdaConnectio
 				       GdaQuarkList *params, GdaQuarkList *auth,
 				       guint *task_id, GdaServerProviderAsyncCallback async_cb, gpointer cb_data)
 {
+	g_print("Attempting to open Firebird DB connection\n");
 	g_return_val_if_fail (GDA_IS_FIREBIRD_PROVIDER (provider), FALSE);
 	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
 
@@ -360,7 +397,7 @@ gda_firebird_provider_open_connection (GdaServerProvider *provider, GdaConnectio
 	cdata = g_new0 (FirebirdConnectionData, 1);
 
 	/* Initialize dpb_buffer */
-        dpb = fcnc->dpb_buffer;
+        dpb = cdata->dpb_buffer;
         *dpb++ = isc_dpb_version1;
 
         /* Set user name */
@@ -388,20 +425,22 @@ gda_firebird_provider_open_connection (GdaServerProvider *provider, GdaConnectio
         }
 
         /* Save dpb length */
-        fcnc->dpb_length = dpb - fcnc->dpb_buffer;
-
-	if (isc_attach_database (fcnc->status, strlen (fb_db), fb_db, &(fcnc->handle), fcnc->dpb_length,
-                                 fcnc->dpb_buffer)) {
-		gda_firebird_free_cnc_data (fcnc);
-		
+        cdata->dpb_length = dpb - cdata->dpb_buffer;
+
+	if (isc_attach_database (cdata->status, strlen (fb_db), fb_db, &(cdata->handle), cdata->dpb_length,
+                                 cdata->dpb_buffer)) {
+		gda_firebird_free_cnc_data (cdata);
+		gda_connection_add_event_string (cnc, 
+						 _("Failed to connect to the database"));
+		//g_print("Failed to connect to the database\n");
 		return FALSE;
 	}
 
 	/* connection is now opened */
 	gda_connection_internal_set_provider_data (cnc, cdata, (GDestroyNotify) gda_firebird_free_cnc_data);
 	 
-        fcnc->dbname = g_strdup (fb_db);
-        fcnc->server_version = fb_server_get_version (fcnc);
+	cdata->dbname = g_strdup (fb_db);
+	cdata->server_version = fb_server_get_version (cdata);
 
 	return TRUE;
 }
@@ -429,7 +468,7 @@ gda_firebird_provider_close_connection (GdaServerProvider *provider, GdaConnecti
 		return FALSE;
 
 	/* detach from database */
-        isc_detach_database (fcnc->status, &(fcnc->handle));
+	isc_detach_database (cdata->status, &(cdata->handle));
 
 	/* Free the FirebirdConnectionData structure and its contents*/
 	gda_firebird_free_cnc_data (cdata);
@@ -659,9 +698,11 @@ gda_firebird_provider_perform_operation (GdaServerProvider *provider, GdaConnect
  * Begin transaction request
  */
 static gboolean
-gda_firebird_provider_begin_transaction (GdaServerProvider *provider, GdaConnection *cnc,
-					 const gchar *name, GdaTransactionIsolation level,
-					 GError **error)
+gda_firebird_provider_begin_transaction (GdaServerProvider *provider
+					, GdaConnection *cnc
+					, const gchar *name
+					, GdaTransactionIsolation level
+					, GError **error)
 {
 	FirebirdConnectionData *cdata;
         static char tpb[] = {
@@ -688,20 +729,20 @@ gda_firebird_provider_begin_transaction (GdaServerProvider *provider, GdaConnect
 		return FALSE;
 	}
 
-        /* start the transaction */
-        cdata->ftr = g_new0 (isc_tr_handle, 1);
-        if (isc_start_transaction (cdata->status, cdata->ftr, 1, &(cdata->handle),
-                                   (unsigned short) sizeof (tpb), &tpb)) {
-                _gda_firebird_connection_make_error (cnc, 0);
-                g_free (cdata->ftr);
+	/* start the transaction */
+	cdata->ftr = g_new0 (isc_tr_handle, 1);
+	if (isc_start_transaction (cdata->status, (cdata->ftr), 1, &(cdata->handle),
+				(unsigned short) sizeof (tpb), &tpb)) {
+		_gda_firebird_connection_make_error (cnc, 0);
+		g_free (cdata->ftr);
 		cdata->ftr = NULL;
 
-                return FALSE;
-        }
+		return FALSE;
+	}
 
-        gda_connection_internal_transaction_started (cnc, NULL, name, level);
+	gda_connection_internal_transaction_started (cnc, NULL, name, level);
 
-        return TRUE;
+	return TRUE;
 }
 
 /*
@@ -712,7 +753,7 @@ gda_firebird_provider_commit_transaction (GdaServerProvider *provider, GdaConnec
 					  const gchar *name, GError **error)
 {
 	FirebirdConnectionData *cdata;
-        gboolean result;
+	gboolean result;
 
 	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
 	g_return_val_if_fail (gda_connection_get_provider (cnc) == provider, FALSE);
@@ -726,7 +767,7 @@ gda_firebird_provider_commit_transaction (GdaServerProvider *provider, GdaConnec
                 return FALSE;
         }
 
-        if (isc_commit_transaction (fcnc->status, cdata->ftr)) {
+        if (isc_commit_transaction (cdata->status, cdata->ftr)) {
 		_gda_firebird_connection_make_error (cnc, 0);
                 result = FALSE;
         }
@@ -749,7 +790,8 @@ gda_firebird_provider_rollback_transaction (GdaServerProvider *provider, GdaConn
 					    const gchar *name, GError **error)
 {
 	FirebirdConnectionData *cdata;
-
+	gboolean result = FALSE;
+	
 	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
 	g_return_val_if_fail (gda_connection_get_provider (cnc) == provider, FALSE);
 
@@ -757,9 +799,24 @@ gda_firebird_provider_rollback_transaction (GdaServerProvider *provider, GdaConn
 	if (!cdata) 
 		return FALSE;
 
-	TO_IMPLEMENT;
+	if (!cdata->ftr) {
+		gda_connection_add_event_string (cnc, _("Invalid transaction handle"));
+		return FALSE;
+	}
 
-	return FALSE;
+	if (isc_rollback_transaction (cdata->status, cdata->ftr)) {
+		_gda_firebird_connection_make_error (cnc, 0);
+		result = FALSE;
+	}
+	else {
+		gda_connection_internal_transaction_committed (cnc, name);
+		result = TRUE;
+	}
+
+	g_free (cdata->ftr);
+	cdata->ftr = NULL;
+
+	return result;
 }
 
 /*
@@ -959,8 +1016,8 @@ gda_firebird_provider_get_default_dbms_type (GdaServerProvider *provider, GdaCon
 static GdaSqlParser *
 gda_firebird_provider_create_parser (GdaServerProvider *provider, GdaConnection *cnc)
 {
-	TO_IMPLEMENT;
-	return NULL;
+	return (GdaSqlParser*) g_object_new (GDA_TYPE_FIREBIRD_PARSER, "tokenizer-flavour",
+                                             GDA_SQL_PARSER_FLAVOUR_STANDARD, NULL);
 }
 
 /*
@@ -997,26 +1054,213 @@ static gboolean
 gda_firebird_provider_statement_prepare (GdaServerProvider *provider, GdaConnection *cnc,
 					 GdaStatement *stmt, GError **error)
 {
-	GdaFirebirdPStmt *ps;
+	GdaFirebirdPStmt 		*ps;
+	FirebirdConnectionData	*cdata;
+	gboolean				result = FALSE;
+	
+	int            buffer[2048];
+
+	XSQLVAR         *var;
+	short           num_cols, i;
+	short           length, alignment, type, offset;
+	int            fetch_stat;
+	static char     stmt_info[] = { isc_info_sql_stmt_type };
+	char            info_buffer[20];
+	short           l;
 
 	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
 	g_return_val_if_fail (gda_connection_get_provider (cnc) == provider, FALSE);
 	g_return_val_if_fail (GDA_IS_STATEMENT (stmt), FALSE);
 
 	/* fetch prepares stmt if already done */
-	ps = gda_connection_get_prepared_statement (cnc, stmt);
+	ps = (GdaFirebirdPStmt *)gda_connection_get_prepared_statement (cnc, stmt);
 	if (ps)
 		return TRUE;
+	
+	/* render as SQL understood by Firebird */
+	GdaSet *params		= NULL;
+	gchar *sql			= NULL;
+	GSList *used_params	= NULL;
+	g_print("gda_statement_get_parameters\n\n");
+	if (!gda_statement_get_parameters (stmt, &params, error))
+		goto out_err;
+	
+	g_print("gda_firebird_provider_statement_to_sql\n");
+	sql = gda_firebird_provider_statement_to_sql (provider, NULL, stmt, params, GDA_STATEMENT_SQL_PARAMS_AS_COLON,
+						&used_params, error);
+	if (!sql)
+		goto out_err;
+
+	g_print("Now get the internal FB-connection\n");
+	/* get private connection data */
+	cdata = (FirebirdConnectionData *) gda_connection_internal_get_provider_data (cnc);
+	if (!cdata)
+		goto out_err;
+	
+	//CREATE THE STMT OBJECT
+	ps = (GdaFirebirdPStmt *) g_object_new (GDA_TYPE_FIREBIRD_PSTMT, NULL);
+	ps->stmt = NULL;
+	
+	g_print("isc_dsql_allocate_statement\n\n");
+	/* actually prepare statement */
+	if (isc_dsql_allocate_statement(cdata->status, &(cdata->handle), &(ps->stmt))) {
+		goto out_err;
+	}
+
+	g_print("Check if we have a transaction.\n\n");
+	if (NULL == cdata->ftr) {
+		g_print("Begin a transaction.\n");
+
+		if (!gda_firebird_provider_begin_transaction (provider
+					, cnc
+					, "prepare_tr"
+					, GDA_TRANSACTION_ISOLATION_UNKNOWN
+					, error)){
+			g_print("Could not start a transaction.\n");
+			isc_print_status(cdata->status);
+			g_print("\n");
+			goto out_err;
+		}
+	}
+	if (NULL == ps->sqlda){
+		/* 
+		* Allocate enough space for 20 fields.  
+		* If more fields get selected, re-allocate SQLDA later.
+		 */
+		ps->sqlda			= g_new0(XSQLDA, 1);
+		ps->sqlda->sqln		= 1;
+		ps->sqlda->version	= 1;
+	}
+	g_print("isc_dsql_prepare\n");
+	//NOW PREPARE THE FB STATEMENT
+	if (isc_dsql_prepare(cdata->status, (cdata->ftr), &(ps->stmt), 0, sql, SQL_DIALECT_V6, ps->sqlda)){
+		//gda_connection_add_event_string (cnc, _("Could not prepare the FB statement"));
+		g_print("Failed to prepare the statement.\n");
+		goto out_err;
+	}
 
+	/* What is the statement type of this statement? 
+    **
+    ** stmt_info is a 1 byte info request.  info_buffer is a buffer
+    ** large enough to hold the returned info packet
+    ** The info_buffer returned contains a isc_info_sql_stmt_type in the first byte, 
+    ** two bytes of length, and a statement_type token.
+    */
+
+    if (!isc_dsql_sql_info(cdata->status, &(ps->stmt), sizeof (stmt_info), stmt_info,
+        sizeof (info_buffer), info_buffer))
+    {
+        l = (short) isc_vax_integer((char *) info_buffer + 1, 2);
+        ps->statement_type = isc_vax_integer((char *) info_buffer + 3, l);
+    }
+	
+	ps->is_non_select = !ps->sqlda->sqld;
+	
+	if (!ps->is_non_select){
+		/*
+		 *    Process select statements.
+		 */
+
+		num_cols = ps->sqlda->sqld;
+
+		/* Need more room. */
+		if (ps->sqlda->sqln < num_cols)
+		{
+			g_free(ps->sqlda);
+			ps->sqlda			= g_new0(XSQLDA, num_cols);
+			ps->sqlda->sqln		= num_cols;
+			ps->sqlda->version	= 1;
+
+			if (isc_dsql_describe(cdata->status, &(ps->stmt), SQL_DIALECT_V6, ps->sqlda))
+			{
+				goto out_err;
+			}
+
+			num_cols = ps->sqlda->sqld;
+		}
+
+		/*
+		 *     Set up SQLDA.
+		 */
+		for (var = ps->sqlda->sqlvar, offset = 0, i = 0; i < num_cols; var++, i++)
+		{
+			length = alignment = var->sqllen;
+			type = var->sqltype & ~1;
+			var->sqlname[var->sqlname_length + 1] = '\0';
+			var->relname[var->relname_length + 1] = '\0';
+			var->ownname[var->ownname_length + 1] = '\0';
+			var->aliasname[var->aliasname_length + 1] = '\0';
+			
+			if (type == SQL_TEXT)
+				alignment = 1;
+			else if (type == SQL_VARYING)
+			{
+				length += sizeof (short) + 1;
+				alignment = sizeof (short);
+			}
+			/*  RISC machines are finicky about word alignment
+			**  So the output buffer values must be placed on
+			**  word boundaries where appropriate
+			*/
+			offset			= FB_ALIGN(offset, alignment);
+			var->sqldata	= (char *) buffer + offset;
+			offset			+= length;
+			offset			= FB_ALIGN(offset, sizeof (short));
+			var->sqlind		= (short*) ((char *) buffer + offset);
+			offset			+= sizeof  (short);
+		}
+	}
+	
 	/* prepare @stmt using the C API, creates @ps */
-	TO_IMPLEMENT;
-	if (!ps)
-		return FALSE;
-	else {
-		gda_connection_add_prepared_statement (cnc, stmt, ps);
-		g_object_unref (ps);
-		return TRUE;
+	/* make a list of the parameter names used in the statement */
+	GSList *param_ids = NULL;
+	if (used_params) {
+		GSList *list;
+		for (list = used_params; list; list = list->next) {
+				const gchar *cid;
+				cid = gda_holder_get_id (GDA_HOLDER (list->data));
+				if (cid) {
+					param_ids = g_slist_append (param_ids, g_strdup (cid));
+					//g_print ("PostgreSQL's PREPARATION: param ID: %s\n", cid);
+				}
+				else {
+					g_set_error (error, GDA_SERVER_PROVIDER_ERROR, GDA_SERVER_PROVIDER_PREPARE_STMT_ERROR,
+						"%s", _("Unnamed parameter is not allowed in prepared statements"));
+					g_slist_foreach (param_ids, (GFunc) g_free, NULL);
+					g_slist_free (param_ids);
+					goto out_err;
+				}
+		}
 	}
+	
+	g_print("Adding the prepared statement to GDA.\n");
+	//ps = (GdaFirebirdPStmt *) g_object_new (GDA_TYPE_FIREBIRD_PSTMT, NULL);
+	gda_pstmt_set_gda_statement (_GDA_PSTMT (ps), stmt);
+	_GDA_PSTMT (ps)->param_ids = param_ids;
+	_GDA_PSTMT (ps)->sql = sql;
+
+	gda_connection_add_prepared_statement (cnc, stmt, (GdaPStmt *) ps);
+	g_object_unref (ps);
+	
+	/* create a prepared statement */
+	
+	result  = TRUE;
+
+ out_err:
+ 	if (FALSE == result){
+		g_print("ERROR OCCURED!!!\n");
+		isc_print_status(cdata->status);
+		g_print("\n");
+		
+		if (used_params)
+			g_slist_free (used_params);
+		if (params)
+			g_object_unref (params);
+
+		g_free (sql);
+	
+	}
+	return result;
 }
 
 /*
@@ -1033,16 +1277,21 @@ gda_firebird_provider_statement_prepare (GdaServerProvider *provider, GdaConnect
  * actual inserted row
  */
 static GObject *
-gda_firebird_provider_statement_execute (GdaServerProvider *provider, GdaConnection *cnc,
-					 GdaStatement *stmt, GdaSet *params,
-					 GdaStatementModelUsage model_usage, 
-					 GType *col_types, GdaSet **last_inserted_row, 
-					 guint *task_id, 
-					 GdaServerProviderAsyncCallback async_cb, gpointer cb_data, GError **error)
+gda_firebird_provider_statement_execute (GdaServerProvider *provider
+					, GdaConnection *cnc
+					, GdaStatement *stmt, GdaSet *params
+					, GdaStatementModelUsage model_usage
+					, GType *col_types
+					, GdaSet **last_inserted_row
+					, guint *task_id
+					, GdaServerProviderAsyncCallback async_cb
+					, gpointer cb_data
+					, GError **error)
 {
-	GdaFirebirdPStmt *ps;
-	FirebirdConnectionData *cdata;
-
+	GdaFirebirdPStmt		*ps;
+	FirebirdConnectionData	*cdata;
+	gchar					*sql;
+	
 	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), NULL);
 	g_return_val_if_fail (gda_connection_get_provider (cnc) == provider, NULL);
 	g_return_val_if_fail (GDA_IS_STATEMENT (stmt), NULL);
@@ -1060,7 +1309,7 @@ gda_firebird_provider_statement_execute (GdaServerProvider *provider, GdaConnect
 
 
 	/* get/create new prepared statement */
-	ps = gda_connection_get_prepared_statement (cnc, stmt);
+	ps = (GdaFirebirdPStmt *)gda_connection_get_prepared_statement (cnc, stmt);
 	if (!ps) {
 		if (!gda_firebird_provider_statement_prepare (provider, cnc, stmt, NULL)) {
 			/* this case can appear for example if some variables are used in places
@@ -1068,16 +1317,17 @@ gda_firebird_provider_statement_execute (GdaServerProvider *provider, GdaConnect
 			 * in a SELECT statement). The action here is to get the actual SQL code for @stmt,
 			 * and use that SQL instead of @stmt to create another GdaFirebirdPStmt object.
 			 */
-			TO_IMPLEMENT;
+			g_print("Could not prepare the statement :-(.\n");
+			//TO_IMPLEMENT;
 			return NULL;
 		}
 		else
-			ps = gda_connection_get_prepared_statement (cnc, stmt);
+			ps = (GdaFirebirdPStmt *)gda_connection_get_prepared_statement (cnc, stmt);
 	}
 	g_assert (ps);
 
 	/* optionnally reset the prepared statement if required by the API */
-	TO_IMPLEMENT;
+	//TO_IMPLEMENT;
 	
 	/* bind statement's parameters */
 	GSList *list;
@@ -1089,7 +1339,7 @@ gda_firebird_provider_statement_execute (GdaServerProvider *provider, GdaConnect
 		
 		/* find requested parameter */
 		if (!params) {
-			event = gda_connection_event_new (GDA_CONNECTION_EVENT_ERROR);
+			event = gda_connection_point_available_event (cnc, GDA_CONNECTION_EVENT_ERROR); //gda_connection_event_new (GDA_CONNECTION_EVENT_ERROR);
 			gda_connection_event_set_description (event, _("Missing parameter(s) to execute query"));
 			g_set_error (error, GDA_SERVER_PROVIDER_ERROR,
 				     GDA_SERVER_PROVIDER_MISSING_PARAM_ERROR,
@@ -1108,17 +1358,18 @@ gda_firebird_provider_statement_execute (GdaServerProvider *provider, GdaConnect
 		if (!h) {
 			gchar *str;
 			str = g_strdup_printf (_("Missing parameter '%s' to execute query"), pname);
-			event = gda_connection_event_new (GDA_CONNECTION_EVENT_ERROR);
+			event = gda_connection_point_available_event (cnc, GDA_CONNECTION_EVENT_ERROR);//gda_connection_event_new (GDA_CONNECTION_EVENT_ERROR);
 			gda_connection_event_set_description (event, str);
 			g_set_error (error, GDA_SERVER_PROVIDER_ERROR,
-				     "%s", GDA_SERVER_PROVIDER_MISSING_PARAM_ERROR, str);
+					GDA_SERVER_PROVIDER_MISSING_PARAM_ERROR, str);
 			g_free (str);
 			break;
 		}
 
 		/* actual binding using the C API, for parameter at position @i */
-		const GValue *value = gda_holder_get_value (h);
-		TO_IMPLEMENT;
+		//TODO: Not sure how this should be done right now.
+		//const GValue *value = gda_holder_get_value (h);
+		//TO_IMPLEMENT;
 	}
 		
 	if (event) {
@@ -1127,9 +1378,9 @@ gda_firebird_provider_statement_execute (GdaServerProvider *provider, GdaConnect
 	}
 	
 	/* add a connection event for the execution */
-	event = gda_connection_event_new (GDA_CONNECTION_EVENT_COMMAND);
-        gda_connection_event_set_description (event, _GDA_PSTMT (ps)->sql);
-        gda_connection_add_event (cnc, event);
+	event = gda_connection_point_available_event (cnc, GDA_CONNECTION_EVENT_COMMAND); //gda_connection_event_new (GDA_CONNECTION_EVENT_COMMAND);
+	gda_connection_event_set_description (event, _GDA_PSTMT (ps)->sql);
+	gda_connection_add_event (cnc, event);
 	
 	/* execute prepared statement using C API depending on its kind */
 	if (! g_ascii_strncasecmp (_GDA_PSTMT (ps)->sql, "SELECT", 6) ||
@@ -1142,15 +1393,21 @@ gda_firebird_provider_statement_execute (GdaServerProvider *provider, GdaConnect
 		else
 			flags = GDA_DATA_MODEL_ACCESS_CURSOR_FORWARD;
 
-                data_model = (GObject *) gda_firebird_recordset_new (cnc, ps, flags, col_types);
+		data_model = (GObject *) gda_firebird_recordset_new (cnc, ps, flags, col_types);
 		gda_connection_internal_statement_executed (cnc, stmt, params, NULL); /* required: help @cnc keep some stats */
 		return data_model;
         }
 	else {
 		GdaSet *set = NULL;
+		//TODO: What the hell must I do here?
+		//TO_IMPLEMENT;
+		//g_print("SQL: %s\n\n", _GDA_PSTMT (ps)->sql);
+		if (isc_dsql_execute(cdata->status, cdata->ftr, &(ps->stmt), SQL_DIALECT_V6, NULL)) {
+			isc_print_status(cdata->status);
+			g_print("\n");
+		}
 
-		TO_IMPLEMENT;
-                /* Create a #GdaSet containing "IMPACTED_ROWS" */
+		/* Create a #GdaSet containing "IMPACTED_ROWS" */
 		/* Create GdaConnectionEvent notice with the type of command and impacted rows */
 
 		gda_connection_internal_statement_executed (cnc, stmt, params, event); /* required: help @cnc keep some stats */
@@ -1299,3 +1556,39 @@ gda_firebird_free_cnc_data (FirebirdConnectionData *cdata)
 	TO_IMPLEMENT;
 	g_free (cdata);
 }
+
+/*
+ *  fb_server_get_version
+ *
+ *  Gets Firebird connection's server version number
+ *
+ *  Returns: A string containing server version, or NULL if error
+ *           String must be released after use
+ */
+static gchar *
+fb_server_get_version (FirebirdConnectionData *fcnc)
+{
+	gchar buffer[254], item, *p_buffer;
+	gint length;
+	gchar fdb_info[] = {
+		isc_info_isc_version,
+		isc_info_end
+	};
+	
+	/* Try to get datbase version */
+	if (! isc_database_info (fcnc->status, &(fcnc->handle), sizeof (fdb_info), fdb_info,
+				 sizeof (buffer), buffer)) {
+		p_buffer = buffer;
+		if (*p_buffer != isc_info_end) {
+			item = *p_buffer++;
+			length = isc_vax_integer (p_buffer, 2);
+			p_buffer += 2;
+			if (item == isc_info_isc_version)
+				return g_strndup ((const gchar *) &p_buffer[2], length-2);
+				
+		}		
+	}
+
+	return NULL;
+}
+
diff --git a/providers/firebird/gda-firebird-pstmt.c b/providers/firebird/gda-firebird-pstmt.c
index f40a655..07b6f0e 100644
--- a/providers/firebird/gda-firebird-pstmt.c
+++ b/providers/firebird/gda-firebird-pstmt.c
@@ -75,7 +75,9 @@ gda_firebird_pstmt_init (GdaFirebirdPStmt *pstmt, GdaFirebirdPStmtClass *klass)
 	g_return_if_fail (GDA_IS_PSTMT (pstmt));
 	
 	/* initialize specific parts of @pstmt */
-	TO_IMPLEMENT;
+	//TO_IMPLEMENT;
+	pstmt->stmt		= NULL;
+	pstmt->sqlda	= NULL;
 }
 
 static void
@@ -86,8 +88,13 @@ gda_firebird_pstmt_finalize (GObject *object)
 	g_return_if_fail (GDA_IS_PSTMT (pstmt));
 
 	/* free memory */
-	TO_IMPLEMENT; /* free some specific parts of @pstmt */
+	//TO_IMPLEMENT; /* free some specific parts of @pstmt */
+	isc_dsql_free_statement(pstmt->status, &(pstmt->stmt), DSQL_close);
 
+	g_free(pstmt->sqlda);
+	pstmt->sqlda	= NULL;
+	pstmt->stmt		= NULL;	
+	
 	/* chain to parent class */
 	parent_class->finalize (object);
 }
diff --git a/providers/firebird/gda-firebird-pstmt.h b/providers/firebird/gda-firebird-pstmt.h
index 7b97c18..af35acb 100644
--- a/providers/firebird/gda-firebird-pstmt.h
+++ b/providers/firebird/gda-firebird-pstmt.h
@@ -40,6 +40,12 @@ struct _GdaFirebirdPStmt {
 	/* TO_ADD: this structure holds any information necessary to reference a prepared statement, usually a connection
          * handle from the C or C++ API
          */
+	isc_stmt_handle	stmt;
+	ISC_STATUS		status[20];
+	XSQLDA 			*sqlda;
+	
+	gint			statement_type;
+	gboolean		is_non_select;
 };
 
 struct _GdaFirebirdPStmtClass {
diff --git a/providers/firebird/gda-firebird-recordset.c b/providers/firebird/gda-firebird-recordset.c
index 1f1d29a..112be45 100644
--- a/providers/firebird/gda-firebird-recordset.c
+++ b/providers/firebird/gda-firebird-recordset.c
@@ -32,6 +32,7 @@
 #include "gda-firebird.h"
 #include "gda-firebird-recordset.h"
 #include "gda-firebird-provider.h"
+#include <libgda/libgda-global-variables.h>
 
 #define _GDA_PSTMT(x) ((GdaPStmt*)(x))
 
@@ -51,9 +52,28 @@ static gboolean gda_firebird_recordset_fetch_at (GdaDataSelect *model, GdaRow **
 struct _GdaFirebirdRecordsetPrivate {
 	GdaConnection *cnc;
 	/* TO_ADD: specific information */
+	XSQLDA *xsqlda;
+	gint n_columns;
+	
 };
 static GObjectClass *parent_class = NULL;
 
+typedef PARAMVARY VARY2;
+
+
+#ifndef ISC_INT64_FORMAT
+
+/* Define a format string for printf.  Printing of 64-bit integers
+   is not standard between platforms */
+
+#if (defined(_MSC_VER) && defined(WIN32))
+#define	ISC_INT64_FORMAT	"I64"
+#else
+#define	ISC_INT64_FORMAT	"ll"
+#endif
+#endif
+
+
 /*
  * Object init and finalize
  */
@@ -66,7 +86,8 @@ gda_firebird_recordset_init (GdaFirebirdRecordset *recset,
 	recset->priv->cnc = NULL;
 
 	/* initialize specific information */
-	TO_IMPLEMENT;
+	//TO_IMPLEMENT;
+	recset->priv->xsqlda	= NULL;
 }
 
 static void
@@ -98,7 +119,10 @@ gda_firebird_recordset_dispose (GObject *object)
 			g_object_unref (recset->priv->cnc);
 
 		/* free specific information */
-		TO_IMPLEMENT;
+		//TO_IMPLEMENT;
+		if (NULL != recset->priv->xsqlda)
+			g_free(recset->priv->xsqlda);
+			
 		g_free (recset->priv);
 		recset->priv = NULL;
 	}
@@ -137,70 +161,407 @@ gda_firebird_recordset_get_type (void)
 	return type;
 }
 
+static GType
+_gda_firebird_type_to_gda (XSQLVAR *var){
+	short       dtype;
+	GType gtype;
+	dtype = var->sqltype & ~1;
+	/*
+	if ((var->sqltype & 1) && (*var->sqlind < 0)){
+		return GDA_TYPE_NULL;
+	}
+	*/
+	switch (dtype){
+		case SQL_TEXT:
+		case SQL_VARYING:
+			gtype = G_TYPE_STRING;
+			//g_print("SQL_TEXT\n");
+			break;
+		case SQL_LONG:
+			gtype = G_TYPE_ULONG;
+			//g_print("SQL_TYPE_LONG\n");
+			break;
+		case SQL_SHORT:
+		case SQL_INT64:
+			gtype = G_TYPE_INT;
+			//g_print("SQL_TYPE_INT\n");
+			break;
+		case SQL_FLOAT:
+			gtype = G_TYPE_FLOAT;
+			//g_print("SQL_TYPE_FLOAT\n");
+			break;
+		case SQL_DOUBLE:
+			gtype = G_TYPE_DOUBLE;
+			//g_print("SQL_TYPE_DOUBLE\n");
+			break;
+		case SQL_TIMESTAMP:
+			//gtype = G_TYPE_DATE_TIME;
+			gtype = GDA_TYPE_TIMESTAMP;
+			//g_print("SQL_TIMESTAMP\n");
+			break;
+		case SQL_TYPE_DATE:
+			gtype = G_TYPE_DATE;
+			//g_print("SQL_TYPE_DATE\n");
+			break;
+		case SQL_TYPE_TIME:
+			gtype = GDA_TYPE_TIME;
+			//g_print("SQL_TYPE_TIME\n");
+			break;
+		case SQL_BLOB:
+		case SQL_ARRAY:
+		default:
+			gtype = GDA_TYPE_BLOB;
+			//g_print("SQL_BLOB\n");
+			break;
+	}
+	
+	return gtype;
+}
+
+/*
+ *    Print column's data.
+ */
+void _fb_set_row_data (XSQLVAR *var, GValue *value, GdaRow *row){
+	short       dtype;
+	char        data[2048], *p;
+	char        blob_s[20], date_s[25];
+	VARY2        *vary2;
+	short       len; 
+	struct tm   times;
+	ISC_QUAD    bid;
+
+	dtype = var->sqltype & ~1;
+	p = data;
+
+	/* Null handling.  If the column is nullable and null */
+	if ((var->sqltype & 1) && (*var->sqlind < 0))
+	{
+		switch (dtype)
+		{
+			case SQL_TEXT:
+			case SQL_VARYING:
+				len = var->sqllen;
+				break;
+			case SQL_SHORT:
+				len = 6;
+				if (var->sqlscale > 0) len += var->sqlscale;
+				break;
+			case SQL_LONG:
+				len = 11;
+				if (var->sqlscale > 0) len += var->sqlscale;
+				break;
+			case SQL_INT64:
+				len = 21;
+				if (var->sqlscale > 0) len += var->sqlscale;
+				break;
+			case SQL_FLOAT:
+				len = 15;
+				break;
+			case SQL_DOUBLE:
+				len = 24;
+				break;
+			case SQL_TIMESTAMP:
+				len = 24;
+				break;
+			case SQL_TYPE_DATE:
+				len = 10;
+				break;
+			case SQL_TYPE_TIME:
+				len = 13;
+				break;
+				case SQL_BLOB:
+				case SQL_ARRAY:
+				default:
+					len = 17;
+					break;
+		}
+		g_value_set_string (value, "NULL");
+	}
+	else
+	{
+		switch (dtype)
+		{
+			case SQL_TEXT:
+				sprintf(p, "%.*s ", var->sqllen, var->sqldata);
+				g_value_set_string (value, p);
+				break;
+
+			case SQL_VARYING:
+				vary2 = (VARY2*) var->sqldata;
+				vary2->vary_string[vary2->vary_length] = '\0';
+					
+				sprintf(p, "%-*s ", var->sqllen, vary2->vary_string);
+				g_value_set_string (value, p);
+				break;
+
+			case SQL_SHORT:
+			case SQL_LONG:
+			case SQL_INT64:
+				{
+				ISC_INT64	fb_value;
+				short		field_width;
+				short		dscale;
+				switch (dtype) {
+					case SQL_SHORT:
+						fb_value = (ISC_INT64)*(short *) var->sqldata;
+						field_width = 6;
+						break;
+					case SQL_LONG:
+						fb_value = (ISC_INT64)*(int *) var->sqldata;
+						field_width = 11;
+						break;
+					case SQL_INT64:
+						fb_value = (ISC_INT64)*(ISC_INT64 *) var->sqldata;
+						field_width = 21;
+						break;
+					default:
+						field_width = 11;
+						fb_value = 0;
+						break;
+				}
+				
+				dscale = var->sqlscale;
+				if (dscale < 0) {
+					ISC_INT64	tens;
+					short	i;
+
+					tens = 1;
+					for (i = 0; i > dscale; i--)
+						tens *= 10;
+
+					if (fb_value >= 0)
+						sprintf (p, "%*" ISC_INT64_FORMAT "d.%0*" ISC_INT64_FORMAT "d",
+						field_width - 1 + dscale, 
+						(ISC_INT64) fb_value / tens,
+						-dscale, 
+						(ISC_INT64) fb_value % tens);
+					else if ((fb_value / tens) != 0)
+						sprintf (p, "%*" ISC_INT64_FORMAT "d.%0*" ISC_INT64_FORMAT "d",
+						field_width - 1 + dscale, 
+						(ISC_INT64) (fb_value / tens),
+						-dscale, 
+						(ISC_INT64) -(fb_value % tens));
+					else
+						sprintf (p, "%*s.%0*" ISC_INT64_FORMAT "d",
+						field_width - 1 + dscale, 
+						"-0",
+						-dscale, 
+						(ISC_INT64) -(fb_value % tens));
+				}
+				else if (dscale){
+					sprintf (p, "%*" ISC_INT64_FORMAT "d%0*d", 
+						field_width, 
+						(ISC_INT64) fb_value,
+						dscale, 0);
+				}
+				else{
+					sprintf (p, "%*" ISC_INT64_FORMAT "d",
+						field_width, 
+						(ISC_INT64) fb_value);
+				}
+				
+				switch (dtype) {
+					case SQL_SHORT:
+						gda_value_set_short (value, atoi (p));
+						break;
+					case SQL_LONG:
+						g_value_set_ulong (value, atoll (p));
+						break;
+					case SQL_INT64:
+					default:
+						g_value_set_int64 (value, atoll (p));
+						break;
+				}
+				}
+				break;
+
+			case SQL_FLOAT:
+				sprintf(p, "%15g ", *(float *) (var->sqldata));
+				//setlocale (LC_NUMERIC, "C");
+				g_value_set_float (value, atof (p));
+				//setlocale (LC_NUMERIC, gda_numeric_locale);
+				break;
+
+			case SQL_DOUBLE:
+				sprintf(p, "%24f ", *(double *) (var->sqldata));
+				//setlocale (LC_NUMERIC, "C");
+				g_value_set_double (value, atof (p));
+				//setlocale (LC_NUMERIC, gda_numeric_locale);
+				break;
+				
+			case SQL_TIMESTAMP:
+				isc_decode_timestamp((ISC_TIMESTAMP *)var->sqldata, &times);
+				sprintf(date_s, "%04d-%02d-%02d %02d:%02d:%02d",
+						times.tm_year + 1900,
+						times.tm_mon+1,
+						times.tm_mday,
+						times.tm_hour,
+						times.tm_min,
+						times.tm_sec);
+				sprintf(p, "%*s ", 22, date_s);
+				//g_value_set_string (value, p);
+
+				GdaTimestamp timestamp;
+				if (! gda_parse_iso8601_timestamp (&timestamp, date_s)) {
+					g_print("****ERROR CONVERTING TO TIMESTAMP: %s\n", date_s);
+					
+					//gda_row_invalidate_value (row, value);
+					/*
+					g_set_error (error, GDA_SERVER_PROVIDER_ERROR,
+							GDA_SERVER_PROVIDER_DATA_ERROR,
+							_("Invalid timestamp '%s' (format should be YYYY-MM-DD HH:MM:SS[.ms])"), 
+							p);
+					*/
+				}
+				else
+					gda_value_set_timestamp (value, &timestamp);
+				
+				
+				break;
+
+			case SQL_TYPE_DATE:
+				isc_decode_sql_date((ISC_DATE *)var->sqldata, &times);
+				sprintf(date_s, "%04d-%02d-%02d",
+						times.tm_year + 1900,
+						times.tm_mon+1,
+						times.tm_mday);
+				sprintf(p, "%*s ", 10, date_s);
+				GDate date;
+				if (!gda_parse_iso8601_date (&date, p)) {
+					//gda_row_invalidate_value (row, value);
+					/*
+					g_set_error (error, GDA_SERVER_PROVIDER_ERROR,
+							 GDA_SERVER_PROVIDER_DATA_ERROR,
+							 _("Invalid date '%s' (date format should be YYYY-MM-DD)"), p);
+					*/
+				}
+				else
+					g_value_set_boxed (value, &date);
+				
+				break;
+
+			case SQL_TYPE_TIME:
+				isc_decode_sql_time((ISC_TIME *)var->sqldata, &times);
+				sprintf(date_s, "%02d:%02d:%02d",
+						times.tm_hour,
+						times.tm_min,
+						times.tm_sec);
+				sprintf(p, "%*s ", 11, date_s);
+				GdaTime timegda;
+				if (!gda_parse_iso8601_time (&timegda, p)) {
+					//gda_row_invalidate_value (row, value); 
+					/*
+					g_set_error (error, GDA_SERVER_PROVIDER_ERROR,
+							 GDA_SERVER_PROVIDER_DATA_ERROR,
+							 _("Invalid time '%s' (time format should be HH:MM:SS[.ms])"), p);
+					*/
+				}
+				else
+					gda_value_set_time (value, &timegda);
+				break;
+
+			case SQL_BLOB:
+			case SQL_ARRAY:
+				/* Print the blob id on blobs or arrays */
+				bid = *(ISC_QUAD *) var->sqldata;
+				sprintf(blob_s, "%08x:%08x", bid.gds_quad_high, bid.gds_quad_low);
+				sprintf(p, "%17s ", blob_s);
+				g_value_set_string (value, p);
+				break;
+
+			default:
+				g_value_set_string(value, "TYPE NOT FOUND");
+				break;
+		}
+	}
+}
+
+
 /*
  * the @ps struct is modified and transferred to the new data model created in
  * this function
  */
 GdaDataModel *
-gda_firebird_recordset_new (GdaConnection *cnc, GdaFirebirdPStmt *ps, GdaDataModelAccessFlags flags, GType *col_types)
+gda_firebird_recordset_new (GdaConnection *cnc
+								, GdaFirebirdPStmt *ps
+								, GdaDataModelAccessFlags flags
+								, GType *col_types
+							)
 {
-	GdaFirebirdRecordset *model;
-        FirebirdConnectionData *cdata;
-        gint i;
-	GdaDataModelAccessFlags rflags;
+	GdaFirebirdRecordset		*model;
+	FirebirdConnectionData		*cdata;
+	gint						i;
+	gint						fetch_stat;
+	GdaDataModelAccessFlags		rflags;
 
-        g_return_val_if_fail (GDA_IS_CONNECTION (cnc), NULL);
-        g_return_val_if_fail (ps != NULL, NULL);
+	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), NULL);
+	g_return_val_if_fail (ps != NULL, NULL);
 
 	cdata = (FirebirdConnectionData*) gda_connection_internal_get_provider_data (cnc);
 	if (!cdata)
 		return NULL;
 
 	/* make sure @ps reports the correct number of columns using the API*/
-        if (_GDA_PSTMT (ps)->ncols < 0)
-                /*_GDA_PSTMT (ps)->ncols = ...;*/
-		TO_IMPLEMENT;
-
-        /* completing @ps if not yet done */
-        if (!_GDA_PSTMT (ps)->types && (_GDA_PSTMT (ps)->ncols > 0)) {
-		/* create prepared statement's columns */
-		GSList *list;
-		for (i = 0; i < _GDA_PSTMT (ps)->ncols; i++)
-			_GDA_PSTMT (ps)->tmpl_columns = g_slist_prepend (_GDA_PSTMT (ps)->tmpl_columns, 
-									 gda_column_new ());
-		_GDA_PSTMT (ps)->tmpl_columns = g_slist_reverse (_GDA_PSTMT (ps)->tmpl_columns);
-
-		/* create prepared statement's types, all types are initialized to GDA_TYPE_NULL */
-		_GDA_PSTMT (ps)->types = g_new (GType, _GDA_PSTMT (ps)->ncols);
-		for (i = 0; i < _GDA_PSTMT (ps)->ncols; i++)
-			_GDA_PSTMT (ps)->types [i] = GDA_TYPE_NULL;
-
-		if (col_types) {
-			for (i = 0; ; i++) {
-				if (col_types [i] > 0) {
-					if (col_types [i] == G_TYPE_NONE)
-						break;
-					if (i >= _GDA_PSTMT (ps)->ncols)
-						g_warning (_("Column %d out of range (0-%d), ignoring its specified type"), i,
-							   _GDA_PSTMT (ps)->ncols - 1);
-					else
-						_GDA_PSTMT (ps)->types [i] = col_types [i];
+	if (_GDA_PSTMT (ps)->ncols < 0)
+		/*_GDA_PSTMT (ps)->ncols = ...;*/
+		_GDA_PSTMT (ps)->ncols = ps->sqlda->sqld;
+		
+		/* completing @ps if not yet done */
+		if (!_GDA_PSTMT (ps)->types && (_GDA_PSTMT (ps)->ncols > 0)) {
+			/* create prepared statement's columns */
+			GSList *list;
+			for (i = 0; i < _GDA_PSTMT (ps)->ncols; i++)
+				_GDA_PSTMT (ps)->tmpl_columns = g_slist_prepend (_GDA_PSTMT (ps)->tmpl_columns, 
+										 gda_column_new ());
+			_GDA_PSTMT (ps)->tmpl_columns = g_slist_reverse (_GDA_PSTMT (ps)->tmpl_columns);
+
+			/* create prepared statement's types, all types are initialized to GDA_TYPE_NULL */
+			_GDA_PSTMT (ps)->types = g_new (GType, _GDA_PSTMT (ps)->ncols);
+			for (i = 0; i < _GDA_PSTMT (ps)->ncols; i++)
+				_GDA_PSTMT (ps)->types [i] = GDA_TYPE_NULL;
+
+			if (col_types) {
+				for (i = 0; ; i++) {
+					if (col_types [i] > 0) {
+						if (col_types [i] == G_TYPE_NONE)
+							break;
+						if (i >= _GDA_PSTMT (ps)->ncols)
+							g_warning (_("Column %d out of range (0-%d), ignoring its specified type"), i,
+								   _GDA_PSTMT (ps)->ncols - 1);
+						else
+							_GDA_PSTMT (ps)->types [i] = col_types [i];
+					}
 				}
 			}
-		}
 		
-		/* fill GdaColumn's data */
-		for (i=0, list = _GDA_PSTMT (ps)->tmpl_columns; 
-		     i < GDA_PSTMT (ps)->ncols; 
-		     i++, list = list->next) {
-			GdaColumn *column;
+			/* fill GdaColumn's data */
+			for (i=0, list = _GDA_PSTMT (ps)->tmpl_columns; 
+				 i < GDA_PSTMT (ps)->ncols; 
+				 i++, list = list->next) {
+				GdaColumn	*column;
+				GType		gtype;
+				XSQLVAR		*var;
 			
-			column = GDA_COLUMN (list->data);
+				var			= (XSQLVAR *) &(ps->sqlda->sqlvar[i]);
+				column		= GDA_COLUMN (list->data);
 
-			/* use C API to set columns' information using gda_column_set_*() */
-			TO_IMPLEMENT;
+				/* use C API to set columns' information using gda_column_set_*() */
+				//TO_IMPLEMENT;
+				gtype = _gda_firebird_type_to_gda(var);
+			
+				_GDA_PSTMT (ps)->types [i] = gtype;
+				gda_column_set_g_type (column, gtype);
+				gda_column_set_name (column, var->aliasname);
+				gda_column_set_description (column, var->aliasname);
+				
+				//g_print("\t\tSQL-NAME:%s\n\t\tREL-NAME: %s\n\t\tOWN-NAME: %s\n\t\tALIAS: %s\n**************************\n\n"
+				//	, var->sqlname
+				//	, var->relname
+				//	, var->ownname
+				//	, var->aliasname);
+			}
+			
 		}
-        }
 
 	/* determine access mode: RANDOM or CURSOR FORWARD are the only supported */
 	if (flags & GDA_DATA_MODEL_ACCESS_RANDOM)
@@ -209,14 +570,46 @@ gda_firebird_recordset_new (GdaConnection *cnc, GdaFirebirdPStmt *ps, GdaDataMod
 		rflags = GDA_DATA_MODEL_ACCESS_CURSOR_FORWARD;
 
 	/* create data model */
-        model = g_object_new (GDA_TYPE_FIREBIRD_RECORDSET, "prepared-stmt", ps, "model-usage", rflags, NULL);
-        model->priv->cnc = cnc;
+	model = g_object_new (GDA_TYPE_FIREBIRD_RECORDSET, "prepared-stmt", ps, "model-usage", rflags, NULL);
+	model->priv->cnc = cnc;
+	model->priv->n_columns	= ps->sqlda->sqld;
 	g_object_ref (cnc);
+	
+	gda_data_select_set_columns (GDA_DATA_SELECT (model), _GDA_PSTMT (ps)->tmpl_columns);
 
 	/* post init specific code */
-	TO_IMPLEMENT;
+	if (isc_dsql_execute(cdata->status, cdata->ftr, &(ps->stmt), SQL_DIALECT_V6, NULL)) {
+		isc_print_status(cdata->status);
+		g_print("\n");
+	}
+
+	gint rownum = 0;
+	while ((fetch_stat = isc_dsql_fetch(cdata->status, &(ps->stmt), SQL_DIALECT_V6, ps->sqlda)) == 0)
+	{
+		
+		GdaRow *row = gda_row_new (ps->sqlda->sqld);
+		for (i = 0; i < ps->sqlda->sqld; i++) {
+			GValue *value = gda_row_get_value (row, i);
+			GType type =_gda_firebird_type_to_gda((XSQLVAR *) &(ps->sqlda->sqlvar[i]));
+			
+			//char *data = mysql_row[i];
+
+			//if (!data || (type == GDA_TYPE_NULL))
+			//	continue;
+
+			gda_value_reset_with_type (value, type);
+			//g_value_set_string (value, "faghmie");
+			_fb_set_row_data ((XSQLVAR *) &(ps->sqlda->sqlvar[i]), value, row);
+			//print_column((XSQLVAR *) &sqlda->sqlvar[i]);
+		}
+
+		gda_data_select_take_row ((GdaDataSelect*) model, row, rownum);
+		rownum++;
+	}
+
+	((GdaDataSelect *) model)->advertized_nrows = rownum;
 
-        return GDA_DATA_MODEL (model);
+	return GDA_DATA_MODEL (model);
 }
 
 
diff --git a/providers/firebird/gda-firebird-recordset.h b/providers/firebird/gda-firebird-recordset.h
index 5503747..f3e46d4 100644
--- a/providers/firebird/gda-firebird-recordset.h
+++ b/providers/firebird/gda-firebird-recordset.h
@@ -23,7 +23,7 @@
 #define __GDA_FIREBIRD_RECORDSET_H__
 
 #include <libgda/libgda.h>
-#include <providers-support/gda-data-select.h>
+#include <providers-support/gda-data-select-priv.h>
 #include "gda-firebird-pstmt.h"
 
 G_BEGIN_DECLS
@@ -34,6 +34,34 @@ G_BEGIN_DECLS
 #define GDA_IS_FIREBIRD_RECORDSET(obj)         (G_TYPE_CHECK_INSTANCE_TYPE (obj, GDA_TYPE_FIREBIRD_RECORDSET))
 #define GDA_IS_FIREBIRD_RECORDSET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDA_TYPE_FIREBIRD_RECORDSET))
 
+
+#ifdef VMS
+#define FB_ALIGN(n,b)              (n)
+#endif
+
+#ifdef sun
+#ifdef sparc
+#define FB_ALIGN(n,b)          ((n + b - 1) & ~(b - 1))
+#endif
+#endif
+
+#ifdef hpux
+#define FB_ALIGN(n,b)          ((n + b - 1) & ~(b - 1))
+#endif
+
+#ifdef _AIX
+#define FB_ALIGN(n,b)          ((n + b - 1) & ~(b - 1))
+#endif
+ 
+#if (defined(_MSC_VER) && defined(WIN32)) 
+#define FB_ALIGN(n,b)          ((n + b - 1) & ~(b - 1))
+#endif
+
+#ifndef FB_ALIGN
+#define FB_ALIGN(n,b)          ((n+1) & ~1)
+#endif
+
+
 typedef struct _GdaFirebirdRecordset        GdaFirebirdRecordset;
 typedef struct _GdaFirebirdRecordsetClass   GdaFirebirdRecordsetClass;
 typedef struct _GdaFirebirdRecordsetPrivate GdaFirebirdRecordsetPrivate;
@@ -41,6 +69,7 @@ typedef struct _GdaFirebirdRecordsetPrivate GdaFirebirdRecordsetPrivate;
 struct _GdaFirebirdRecordset {
 	GdaDataSelect                model;
 	GdaFirebirdRecordsetPrivate *priv;
+
 };
 
 struct _GdaFirebirdRecordsetClass {
diff --git a/providers/firebird/gda-firebird.h b/providers/firebird/gda-firebird.h
index c15af7a..b323dc7 100644
--- a/providers/firebird/gda-firebird.h
+++ b/providers/firebird/gda-firebird.h
@@ -20,7 +20,7 @@
  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA  02110-1301, USA.
  */
-c/* GDA firebird provider
+/* GDA firebird provider
  * Copyright (C) 2008 The GNOME Foundation.
  *
  * AUTHORS:
@@ -50,21 +50,24 @@ c/* GDA firebird provider
  */
 #define FIREBIRD_PROVIDER_NAME "Firebird"
 
+#include <libgda/libgda.h>
 #include <ibase.h>
 
 /*
  * Provider's specific connection data
  */
-typedef struct {
-	gchar         *dbname;
-	gchar         *server_version;
-        isc_db_handle  handle;
-        ISC_STATUS     status[20];
-        gchar          dpb_buffer[128];
-        gshort         dpb_length;
 
-	/* transaction */
-	isc_tr_handle *ftr;
+typedef struct
+{
+	//GdaConnection	*cnc;
+	gchar			*dbname;
+	gchar			*server_version;
+	isc_db_handle	handle;
+	ISC_STATUS		status[20];
+	gchar			dpb_buffer[128];
+	gshort			dpb_length;
+
+	isc_tr_handle	*ftr;
 } FirebirdConnectionData;
 
 #endif
diff --git a/providers/mysql/gda-mysql-recordset.c b/providers/mysql/gda-mysql-recordset.c
index 4b86109..a406a6e 100644
--- a/providers/mysql/gda-mysql-recordset.c
+++ b/providers/mysql/gda-mysql-recordset.c
@@ -96,7 +96,7 @@ struct _GdaMysqlRecordsetPrivate {
 
 	/* if no prepared statement available */
 	gint          ncols;
-        GType        *types;
+    GType        *types;
 };
 static GObjectClass *parent_class = NULL;
 
@@ -268,10 +268,10 @@ gda_mysql_recordset_dispose (GObject  *object)
 			g_object_unref (G_OBJECT(recset->priv->tmp_row));
 			recset->priv->tmp_row = NULL;
 		}
-		if (recset->priv->types)
-			g_free (recset->priv->types);
-
+		
+		g_free (recset->priv->types);
 		g_free (recset->priv);
+		
 		recset->priv = NULL;
 	}
 
@@ -416,11 +416,11 @@ gda_mysql_recordset_new_direct (GdaConnection *cnc, GdaDataModelAccessFlags flag
 		rflags = GDA_DATA_MODEL_ACCESS_CURSOR_FORWARD;
 
 	/* create data model */
-        model = g_object_new (GDA_TYPE_MYSQL_RECORDSET,
-			      "connection", cnc,
-			      "model-usage", rflags,
-			      NULL);
-        model->priv->cnc = cnc;
+	model = g_object_new (GDA_TYPE_MYSQL_RECORDSET,
+				"connection", cnc,
+				"model-usage", rflags,
+				NULL);
+	model->priv->cnc = cnc;
 	g_object_ref (G_OBJECT(cnc));
 
 	/* columns & types */	
diff --git a/providers/mysql/gda-mysql.h b/providers/mysql/gda-mysql.h
index 93d51b9..b6f9533 100644
--- a/providers/mysql/gda-mysql.h
+++ b/providers/mysql/gda-mysql.h
@@ -45,7 +45,7 @@
 typedef struct {
 	GdaMysqlReuseable *reuseable;
 	GdaConnection     *cnc;
-	MYSQL             *mysql;	
+	MYSQL             *mysql;
 } MysqlConnectionData;
 
 #endif
diff --git a/providers/postgres/gda-postgres-provider.c b/providers/postgres/gda-postgres-provider.c
index 8c7576d..55c09b7 100644
--- a/providers/postgres/gda-postgres-provider.c
+++ b/providers/postgres/gda-postgres-provider.c
@@ -1503,11 +1503,11 @@ gda_postgres_provider_statement_prepare (GdaServerProvider *provider, GdaConnect
 	gchar *sql;
 	GSList *used_params = NULL;
 	if (! gda_statement_get_parameters (stmt, &params, error))
-                return FALSE;
-        sql = gda_postgres_provider_statement_to_sql (provider, cnc, stmt, params, GDA_STATEMENT_SQL_PARAMS_AS_DOLLAR,
-						      &used_params, error);
-        if (!sql)
-                goto out_err;
+		return FALSE;
+	sql = gda_postgres_provider_statement_to_sql (provider, cnc, stmt, params, GDA_STATEMENT_SQL_PARAMS_AS_DOLLAR,
+						&used_params, error);
+	if (!sql)
+		goto out_err;
 
 	/* actually prepare statement */
 	PGresult *pg_res;


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