libgda r3250 - in trunk: . doc/C/tmpl libgda libgda/binreloc tests
- From: vivien svn gnome org
- To: svn-commits-list gnome org
- Subject: libgda r3250 - in trunk: . doc/C/tmpl libgda libgda/binreloc tests
- Date: Mon, 10 Nov 2008 14:13:47 +0000 (UTC)
Author: vivien
Date: Mon Nov 10 14:13:47 2008
New Revision: 3250
URL: http://svn.gnome.org/viewvc/libgda?rev=3250&view=rev
Log:
Released 3.99.6
2008-11-10 Vivien Malerba <malerba gnome-db org>
* libgda/gda-easy.[ch]: modified the gda_perform_create_database() and
gda_perform_drop_database() to add the provider's name as 1st argument, for
bug #529794
* tests/test-cnc-utils.c: adaptations to API changes
* libgda/gda-init.c: set the default value of gda_numeric_locale and gda_lang_locale
to "" instead of NULL so if people forget to call gda_init() then they won't have a
crash when using any of there variables
* libgda/gda-data-model.[ch]: use real error codes with g_set_error()
* libgda/binreloc/gda-binreloc.c: make binreloc work again correctly on Win32
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/doc/C/tmpl/gda-convenient.sgml
trunk/libgda/binreloc/gda-binreloc.c
trunk/libgda/gda-data-model.c
trunk/libgda/gda-data-model.h
trunk/libgda/gda-easy.c
trunk/libgda/gda-easy.h
trunk/libgda/gda-init.c
trunk/tests/test-cnc-utils.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Mon Nov 10 14:13:47 2008
@@ -1,7 +1,17 @@
-libgda 3.99.6,
+libgda 3.99.6, 2008-11-10
- - bug fixes: #541991, #546339
+ - A few API improvements
+ - MySQL provider improvements (Carlos Savoretti)
+ - Performances improvements, and memory leaks removal
+ - use the G_TYPE_GTYPE type instead of ulong
+ - better control of exported symbols in the final library and providers
+ - better binreloc behaviour in 64 bits
+ - use custom marshallers for GError, GType and GValue in signals (bug #555905)
+ - bug fixes: #541991, #546339, #555905, #556258, #556327, #556960, #529794 (Johannes Schmid,
+ Massimo Cora', Vivien Malerba)
- Translations:
+ - es (Jorge Gonzalez)
+ - sv (Daniel Nylander)
libgda 3.99.5, 2008-10-09
Modified: trunk/doc/C/tmpl/gda-convenient.sgml
==============================================================================
--- trunk/doc/C/tmpl/gda-convenient.sgml (original)
+++ trunk/doc/C/tmpl/gda-convenient.sgml Mon Nov 10 14:13:47 2008
@@ -33,6 +33,7 @@
</para>
+ provider:
@op:
@error:
@Returns:
@@ -54,6 +55,7 @@
</para>
+ provider:
@op:
@error:
@Returns:
Modified: trunk/libgda/binreloc/gda-binreloc.c
==============================================================================
--- trunk/libgda/binreloc/gda-binreloc.c (original)
+++ trunk/libgda/binreloc/gda-binreloc.c Mon Nov 10 14:13:47 2008
@@ -73,64 +73,103 @@
const gchar *prefix_dir_name = NULL;
gint prefix_len = strlen (LIBGDAPREFIX);
+ /*
+ g_print ("LIBGDAPREFIX = %s\n", LIBGDAPREFIX);
+ g_print ("LIBGDABIN = %s\n", LIBGDABIN);
+ g_print ("LIBGDASBIN = %s\n", LIBGDASBIN);
+ g_print ("LIBGDADATA = %s\n",LIBGDADATA );
+ g_print ("LIBGDALIB = %s\n", LIBGDALIB);
+ g_print ("LIBGDALIBEXEC = %s\n",LIBGDALIBEXEC );
+ g_print ("LIBGDASYSCONF = %s\n", LIBGDASYSCONF);
+ */
+
#ifdef G_OS_WIN32
wchar_t path[MAX_PATH];
gchar* p;
#endif
+
switch (where) {
default:
case GDA_NO_DIR:
break;
case GDA_BIN_DIR:
tmp = LIBGDABIN;
+#ifndef G_OS_WIN32
if (! g_str_has_prefix (tmp, LIBGDAPREFIX) || (tmp [prefix_len] != G_DIR_SEPARATOR))
prefix = g_strdup (tmp);
else
prefix_dir_name = tmp + prefix_len + 1;
+#else
+ prefix_dir_name = "bin";
+#endif
break;
case GDA_SBIN_DIR:
tmp = LIBGDASBIN;
+#ifndef G_OS_WIN32
if (! g_str_has_prefix (tmp, LIBGDAPREFIX) || (tmp [prefix_len] != G_DIR_SEPARATOR))
prefix = g_strdup (tmp);
else
prefix_dir_name = tmp + prefix_len + 1;
+#else
+ prefix_dir_name = "sbin";
+#endif
break;
case GDA_DATA_DIR:
tmp = LIBGDADATA;
+#ifndef G_OS_WIN32
if (! g_str_has_prefix (tmp, LIBGDAPREFIX) || (tmp [prefix_len] != G_DIR_SEPARATOR))
prefix = g_strdup (tmp);
else
prefix_dir_name = tmp + prefix_len + 1;
+#else
+ prefix_dir_name = "share";
+#endif
break;
case GDA_LOCALE_DIR:
tmp = LIBGDADATA;
+#ifndef G_OS_WIN32
if (! g_str_has_prefix (tmp, LIBGDAPREFIX) || (tmp [prefix_len] != G_DIR_SEPARATOR)) {
prefix = g_strdup (tmp);
prefix_dir_name = "locale";
}
else
prefix_dir_name = "share" G_DIR_SEPARATOR_S "locale";
+#else
+ prefix_dir_name = "share" G_DIR_SEPARATOR_S "locale";
+#endif
break;
case GDA_LIB_DIR:
tmp = LIBGDALIB;
+#ifndef G_OS_WIN32
if (! g_str_has_prefix (tmp, LIBGDAPREFIX) || (tmp [prefix_len] != G_DIR_SEPARATOR))
prefix = g_strdup (tmp);
else
prefix_dir_name = tmp + prefix_len + 1;
+#else
+ prefix_dir_name = "lib";
+#endif
break;
case GDA_LIBEXEC_DIR:
tmp = LIBGDALIBEXEC;
+#ifndef G_OS_WIN32
if (! g_str_has_prefix (tmp, LIBGDAPREFIX) || (tmp [prefix_len] != G_DIR_SEPARATOR))
prefix = g_strdup (tmp);
else
prefix_dir_name = tmp + prefix_len + 1;
+#else
+ prefix_dir_name = "libexec";
+#endif
break;
case GDA_ETC_DIR:
tmp = LIBGDASYSCONF;
+#ifndef G_OS_WIN32
if (! g_str_has_prefix (tmp, LIBGDAPREFIX) || (tmp [prefix_len] != G_DIR_SEPARATOR))
prefix = g_strdup (tmp);
else
prefix_dir_name = tmp + prefix_len + 1;
+#else
+ prefix_dir_name = "etc";
+#endif
break;
}
@@ -138,7 +177,6 @@
g_print ("%s ()\n", __FUNCTION__);
#endif
-
if (!prefix) {
/* prefix part for each OS */
#ifdef G_OS_WIN32
@@ -151,7 +189,7 @@
p = strrchr (prefix, G_DIR_SEPARATOR);
if (p && (g_ascii_strcasecmp (p + 1, "bin") == 0 ||
g_ascii_strcasecmp (p + 1, "lib") == 0))
- *p = '\0';
+ *p = '\0';
#elif HAVE_CARBON
#define MAXLEN 500
ProcessSerialNumber myProcess;
Modified: trunk/libgda/gda-data-model.c
==============================================================================
--- trunk/libgda/gda-data-model.c (original)
+++ trunk/libgda/gda-data-model.c Mon Nov 10 14:13:47 2008
@@ -771,7 +771,7 @@
g_return_val_if_fail (GDA_IS_DATA_MODEL (model), FALSE);
if (! (gda_data_model_get_access_flags (model) & GDA_DATA_MODEL_ACCESS_INSERT)) {
- g_set_error (error, 0, 0,
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_ACCESS_ERROR,
_("Model does not allow row insertion"));
return -1;
}
@@ -803,7 +803,7 @@
g_return_val_if_fail (GDA_IS_DATA_MODEL (model), FALSE);
if (! (gda_data_model_get_access_flags (model) & GDA_DATA_MODEL_ACCESS_DELETE)) {
- g_set_error (error, 0, 0,
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_ACCESS_ERROR,
_("Model does not allow row deletion"));
return FALSE;
}
@@ -1106,7 +1106,7 @@
if (g_file_test (file, G_FILE_TEST_EXISTS)) {
if (! overwrite) {
g_free (body);
- g_set_error (error, 0, 0,
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_FILE_EXIST_ERROR,
_("File '%s' already exists"), file);
return FALSE;
}
@@ -1335,9 +1335,11 @@
if (xmlNodeIsText (xml_field))
continue;
- if (strcmp ((gchar*)xml_field->name, "gda_value") && strcmp ((gchar*)xml_field->name, "gda_array_value")) {
- g_set_error (error, 0, 0, _("Expected tag <gda_value> or <gda_array_value>, "
- "got <%s>, ignoring"), (gchar*)xml_field->name);
+ if (strcmp ((gchar*)xml_field->name, "gda_value") &&
+ strcmp ((gchar*)xml_field->name, "gda_array_value")) {
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_XML_FORMAT_ERROR,
+ _("Expected tag <gda_value> or <gda_array_value>, "
+ "got <%s>, ignoring"), (gchar*)xml_field->name);
continue;
}
@@ -1366,7 +1368,7 @@
gdatype = gda_column_get_g_type (column);
if ((gdatype == G_TYPE_INVALID) ||
(gdatype == GDA_TYPE_NULL)) {
- g_set_error (error, 0, 0,
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_XML_FORMAT_ERROR,
_("Cannot retrieve column data type (type is UNKNOWN or not specified)"));
retval = FALSE;
break;
@@ -1448,7 +1450,7 @@
node = node->next;
if (strcmp ((gchar*)node->name, "gda_array_data")) {
- g_set_error (error, 0, 0,
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_XML_FORMAT_ERROR,
_("Expected tag <gda_array_data>, got <%s>"), node->name);
return FALSE;
}
@@ -1508,7 +1510,7 @@
/* obtain an iterator */
from_iter = gda_data_model_create_iter (from);
if (!from_iter) {
- g_set_error (error, 0, 0,
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_ACCESS_ERROR,
_("Could not get an iterator for source data model"));
return FALSE;
}
@@ -1525,7 +1527,7 @@
col = GPOINTER_TO_INT (g_hash_table_lookup (cols_trans, GINT_TO_POINTER (i)));
if (col >= from_nb_cols) {
g_slist_free (copy_params);
- g_set_error (error, 0, 0,
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_COLUMN_OUT_OF_RANGE_ERROR,
_("Inexistent column in source data model: %d"), col);
return FALSE;
}
@@ -1539,7 +1541,7 @@
column = gda_data_model_describe_column (to, i);
if (! gda_column_get_allow_null (column) && !param) {
g_slist_free (copy_params);
- g_set_error (error, 0, 0,
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_VALUE_TYPE_ERROR,
_("Destination column %d can't be NULL but has no correspondence in the "
"source data model"), i);
return FALSE;
@@ -1549,7 +1551,7 @@
(gda_holder_get_g_type (param) != G_TYPE_INVALID) &&
!g_value_type_transformable (gda_holder_get_g_type (param),
gda_column_get_g_type (column))) {
- g_set_error (error, 0, 0,
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_VALUE_TYPE_ERROR,
_("Destination column %d has a gda type (%s) incompatible with "
"source column %d type (%s)"), i,
gda_g_type_to_string (gda_column_get_g_type (column)),
@@ -1646,7 +1648,7 @@
gchar *str;
str = gda_value_stringify (value);
- g_set_error (error, 0, 0,
+ g_set_error (error, GDA_DATA_MODEL_ERROR, GDA_DATA_MODEL_VALUE_TYPE_ERROR,
_("Can't transform '%s' from GDA type %s to GDA type %s"),
str,
gda_g_type_to_string (G_VALUE_TYPE (value)),
Modified: trunk/libgda/gda-data-model.h
==============================================================================
--- trunk/libgda/gda-data-model.h (original)
+++ trunk/libgda/gda-data-model.h Mon Nov 10 14:13:47 2008
@@ -73,7 +73,9 @@
GDA_DATA_MODEL_VALUE_TYPE_ERROR,
GDA_DATA_MODEL_ROW_NOT_FOUND_ERROR,
GDA_DATA_MODEL_ACCESS_ERROR,
- GDA_DATA_MODEL_FEATURE_NON_SUPPORTED_ERROR
+ GDA_DATA_MODEL_FEATURE_NON_SUPPORTED_ERROR,
+ GDA_DATA_MODEL_FILE_EXIST_ERROR,
+ GDA_DATA_MODEL_XML_FORMAT_ERROR
};
/* struct for the interface */
Modified: trunk/libgda/gda-easy.c
==============================================================================
--- trunk/libgda/gda-easy.c (original)
+++ trunk/libgda/gda-easy.c Mon Nov 10 14:13:47 2008
@@ -76,24 +76,27 @@
/**
* gda_perform_create_database
+ * @provider: the database provider to use, or %NULL if @op has been created using gda_prepare_create_database()
* @op: a #GdaServerOperation object obtained using gda_prepare_create_database()
* @error: a place to store en error, or %NULL
*
- * Creates a new database using the specifications in @op, which must have been obtained using
- * gda_prepare_create_database ()
+ * Creates a new database using the specifications in @op. @op can be obtained using
+ * gda_server_provider_create_operation(), or gda_prepare_create_database().
*
* Returns: TRUE if no error occurred and the database has been created
*/
gboolean
-gda_perform_create_database (GdaServerOperation *op, GError **error)
+gda_perform_create_database (const gchar *provider, GdaServerOperation *op, GError **error)
{
- GdaServerProvider *provider;
+ GdaServerProvider *prov;
g_return_val_if_fail (GDA_IS_SERVER_OPERATION (op), FALSE);
-
- provider = g_object_get_data (G_OBJECT (op), "_gda_provider_obj");
- if (provider)
- return gda_server_provider_perform_operation (provider, NULL, op, error);
+ if (provider)
+ prov = gda_config_get_provider (provider, error);
+ else
+ prov = g_object_get_data (G_OBJECT (op), "_gda_provider_obj");
+ if (prov)
+ return gda_server_provider_perform_operation (prov, NULL, op, error);
else {
g_warning ("Could not find operation's associated provider, "
"did you use gda_prepare_create_database() ?");
@@ -142,24 +145,27 @@
/**
* gda_perform_drop_database
+ * @provider: the database provider to use, or %NULL if @op has been created using gda_prepare_drop_database()
* @op: a #GdaServerOperation object obtained using gda_prepare_drop_database()
* @error: a place to store en error, or %NULL
*
- * Destroys an existing database using the specifications in @op, which must have been obtained using
- * gda_prepare_drop_database ()
+ * Destroys an existing database using the specifications in @op. @op can be obtained using
+ * gda_server_provider_create_operation(), or gda_prepare_drop_database().
*
* Returns: TRUE if no error occurred and the database has been destroyed
*/
gboolean
-gda_perform_drop_database (GdaServerOperation *op, GError **error)
+gda_perform_drop_database (const gchar *provider, GdaServerOperation *op, GError **error)
{
- GdaServerProvider *provider;
+ GdaServerProvider *prov;
g_return_val_if_fail (GDA_IS_SERVER_OPERATION (op), FALSE);
-
- provider = g_object_get_data (G_OBJECT (op), "_gda_provider_obj");
- if (provider)
- return gda_server_provider_perform_operation (provider, NULL, op, error);
+ if (provider)
+ prov = gda_config_get_provider (provider, error);
+ else
+ prov = g_object_get_data (G_OBJECT (op), "_gda_provider_obj");
+ if (prov)
+ return gda_server_provider_perform_operation (prov, NULL, op, error);
else {
g_warning ("Could not find operation's associated provider, "
"did you use gda_prepare_drop_database() ?");
Modified: trunk/libgda/gda-easy.h
==============================================================================
--- trunk/libgda/gda-easy.h (original)
+++ trunk/libgda/gda-easy.h Mon Nov 10 14:13:47 2008
@@ -70,9 +70,9 @@
* Database creation and destruction
*/
GdaServerOperation *gda_prepare_create_database (const gchar *provider, const gchar *db_name, GError **error);
-gboolean gda_perform_create_database (GdaServerOperation *op, GError **error);
+gboolean gda_perform_create_database (const gchar *provider, GdaServerOperation *op, GError **error);
GdaServerOperation *gda_prepare_drop_database (const gchar *provider, const gchar *db_name, GError **error);
-gboolean gda_perform_drop_database (GdaServerOperation *op, GError **error);
+gboolean gda_perform_drop_database (const gchar *provider, GdaServerOperation *op, GError **error);
/*
* Tables creation and destruction
Modified: trunk/libgda/gda-init.c
==============================================================================
--- trunk/libgda/gda-init.c (original)
+++ trunk/libgda/gda-init.c Mon Nov 10 14:13:47 2008
@@ -34,8 +34,8 @@
xmlDtdPtr gda_paramlist_dtd = NULL;
xmlDtdPtr gda_server_op_dtd = NULL;
-gchar *gda_numeric_locale = NULL;
-gchar *gda_lang_locale = NULL;
+gchar *gda_numeric_locale = "";
+gchar *gda_lang_locale = "";
/**
* gda_init
Modified: trunk/tests/test-cnc-utils.c
==============================================================================
--- trunk/tests/test-cnc-utils.c (original)
+++ trunk/tests/test-cnc-utils.c Mon Nov 10 14:13:47 2008
@@ -116,12 +116,12 @@
db_quark_list = gda_quark_list_new_from_string (db_params);
op = gda_prepare_drop_database (prov_info->id, dbname, NULL);
gda_quark_list_foreach (db_quark_list, (GHFunc) db_create_quark_foreach_func, op);
- gda_perform_create_database (op, NULL);
+ gda_perform_create_database (NULL, op, NULL);
g_object_unref (op);
op = gda_prepare_create_database (prov_info->id, dbname, NULL);
gda_quark_list_foreach (db_quark_list, (GHFunc) db_create_quark_foreach_func, op);
- if (!gda_perform_create_database (op, error))
+ if (!gda_perform_create_database (NULL, op, error))
goto out;
db_created = TRUE;
}
@@ -300,7 +300,7 @@
gda_quark_list_foreach (db_quark_list, (GHFunc) db_drop_quark_foreach_func, op);
gda_quark_list_free (db_quark_list);
- if (!gda_perform_drop_database (op, error))
+ if (!gda_perform_drop_database (NULL, op, error))
retval = FALSE;
g_object_unref (op);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]