[libgda] Make GdaHandlerBin handle GdaBlob types correctly



commit f37bcc4815c063eb4b0e221580f001213990c810
Author: Vivien Malerba <malerba gnome-db org>
Date:   Wed Jan 27 20:57:21 2010 +0100

    Make GdaHandlerBin handle GdaBlob types correctly

 libgda/handlers/gda-handler-bin.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/libgda/handlers/gda-handler-bin.c b/libgda/handlers/gda-handler-bin.c
index 812c735..f761cba 100644
--- a/libgda/handlers/gda-handler-bin.c
+++ b/libgda/handlers/gda-handler-bin.c
@@ -240,7 +240,8 @@ gda_handler_bin_get_value_from_sql (GdaDataHandler *iface, const gchar *sql, GTy
 	hdl = GDA_HANDLER_BIN (iface);
 	g_return_val_if_fail (hdl->priv, NULL);
 
-	if (type == GDA_TYPE_BINARY) {
+	if ((type == GDA_TYPE_BINARY) ||
+	    (type == GDA_TYPE_BLOB)) {
 		if (sql && *sql) {
 			gint i = strlen (sql);
 			if ((i>=2) && (*sql=='\'') && (sql[i-1]=='\'')) {
@@ -279,6 +280,14 @@ gda_handler_bin_get_value_from_str (GdaDataHandler *iface, const gchar *str, GTy
 			gda_value_take_binary (value, bin);
 		}
 	}
+	else if (type == GDA_TYPE_BLOB) {
+		GdaBlob *blob;
+		blob = gda_string_to_blob (str);
+		if (blob) {
+			value = gda_value_new (GDA_TYPE_BLOB);
+			gda_value_take_blob (value, blob);
+		}
+	}
 
 	return value;
 }



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