libgda r3267 - in trunk: . doc/C doc/C/tmpl libgda libgda/sqlite/virtual providers/postgres providers/skel-implementation/capi tests/value-holders
- From: vivien svn gnome org
- To: svn-commits-list gnome org
- Subject: libgda r3267 - in trunk: . doc/C doc/C/tmpl libgda libgda/sqlite/virtual providers/postgres providers/skel-implementation/capi tests/value-holders
- Date: Tue, 16 Dec 2008 20:26:33 +0000 (UTC)
Author: vivien
Date: Tue Dec 16 20:26:33 2008
New Revision: 3267
URL: http://svn.gnome.org/viewvc/libgda?rev=3267&view=rev
Log:
2008-12-16 Vivien Malerba <malerba gnome-db org>
* libgda/gda-meta-struct.[ch]:
* libgda/gda-column.[ch]:
* libgda/gda-holder.[ch]: added a GDestroyNotify argument to gda_*_set_attribute()
because this API design was not correct, this breaks the API, see bug #564402
The gda_*_set_attribute_static() has been defined to reproduce the previous behaviour
* libgda/gda-meta-struct-io.c: use gda_meta_table_column_set_attribute_static()
* libgda/gda-attributes-manager.c: documentation corrections
* providers/postgres/gda-postgres-meta.c: fixed a bug the SQL code
* configure.in: detect size of C types used by MD5 implementation
* libgda/global.h: fixed MD5 computation error (make sure a four byte word is used)
* tests/value-holders/check_holder.c:
* tests/value-holders/check_set.c: use gda_holder_set_attribute_static()
* other misc files: minor corrections to remove compilation warnings.
2008-12-16 Murray Cumming <murrayc murrayc com>
* libgda/gda-data-model-iter-extra.h: Rename
gda_data_model_iter_move_at_row_default() to
gda_data_model_iter_move_to_row_default().
* libgda/gda-data-model-iter.[h|c]: Rename
gda_data_model_iter_move_at_row() to
gda_data_model_iter_move_to_row().
* libgda/gda-data-model.c:
* libgda/gda-data-proxy.c:
* libgda/gda-data-select.c:
* libgda/sqlite/virtual/virtual-test.c: Adapt.
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/doc/C/libgda-4.0-sections.txt
trunk/doc/C/tmpl/gda-column.sgml
trunk/doc/C/tmpl/gda-holder.sgml
trunk/doc/C/tmpl/gda-meta-struct.sgml
trunk/gtk-doc.make
trunk/libgda/gda-attributes-manager.c
trunk/libgda/gda-column.c
trunk/libgda/gda-column.h
trunk/libgda/gda-data-model-bdb.c
trunk/libgda/gda-data-model-iter-extra.h
trunk/libgda/gda-data-model-iter.c
trunk/libgda/gda-data-model-iter.h
trunk/libgda/gda-data-model.c
trunk/libgda/gda-data-proxy.c
trunk/libgda/gda-data-select.c
trunk/libgda/gda-holder.c
trunk/libgda/gda-holder.h
trunk/libgda/gda-meta-store.c
trunk/libgda/gda-meta-struct-io.c
trunk/libgda/gda-meta-struct.c
trunk/libgda/gda-meta-struct.h
trunk/libgda/gda-set.c
trunk/libgda/gda-util.c
trunk/libgda/global.h
trunk/libgda/sqlite/virtual/gda-vconnection-data-model.c
trunk/libgda/sqlite/virtual/gda-virtual-connection.c
trunk/libgda/sqlite/virtual/virtual-test.c
trunk/providers/postgres/gda-postgres-meta.c
trunk/providers/skel-implementation/capi/gda-capi-meta.c
trunk/tests/value-holders/check_holder.c
trunk/tests/value-holders/check_set.c
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Tue Dec 16 20:26:33 2008
@@ -42,6 +42,8 @@
IT_PROG_INTLTOOL([0.35.5])
AC_SUBST(INTLTOOL_XML_RULE)
+AC_CHECK_SIZEOF(unsigned int,0)
+AC_CHECK_SIZEOF(unsigned long int,0)
AC_DEFINE_UNQUOTED(BONOBO_EXPLICIT_TRANSLATION_DOMAIN, "libgda-$LIBGDA_ABI_VERSION")
Modified: trunk/doc/C/libgda-4.0-sections.txt
==============================================================================
--- trunk/doc/C/libgda-4.0-sections.txt (original)
+++ trunk/doc/C/libgda-4.0-sections.txt Tue Dec 16 20:26:33 2008
@@ -14,6 +14,7 @@
gda_column_get_default_value
gda_column_get_attribute
gda_column_set_attribute
+gda_column_set_attribute_static
<SUBSECTION Standard>
GDA_COLUMN
GDA_COLUMN_CLASS
@@ -1023,6 +1024,7 @@
gda_holder_set_bind
gda_holder_get_bind
gda_holder_get_attribute
+gda_holder_set_attribute_static
gda_holder_set_attribute
<SUBSECTION Standard>
GDA_IS_HOLDER
@@ -1345,6 +1347,7 @@
GDA_META_TABLE_COLUMN
gda_meta_table_column_get_attribute
gda_meta_table_column_set_attribute
+gda_meta_table_column_set_attribute_static
gda_meta_table_column_foreach_attribute
GdaMetaTableForeignKey
GDA_META_TABLE_FOREIGN_KEY
Modified: trunk/doc/C/tmpl/gda-column.sgml
==============================================================================
--- trunk/doc/C/tmpl/gda-column.sgml (original)
+++ trunk/doc/C/tmpl/gda-column.sgml Tue Dec 16 20:26:33 2008
@@ -152,5 +152,16 @@
@column:
@attribute:
@value:
+ destroy:
+
+
+<!-- ##### MACRO gda_column_set_attribute_static ##### -->
+<para>
+
+</para>
+
+ holder:
+ attribute:
+ value:
Modified: trunk/doc/C/tmpl/gda-holder.sgml
==============================================================================
--- trunk/doc/C/tmpl/gda-holder.sgml (original)
+++ trunk/doc/C/tmpl/gda-holder.sgml Tue Dec 16 20:26:33 2008
@@ -351,6 +351,16 @@
@Returns:
+<!-- ##### MACRO gda_holder_set_attribute_static ##### -->
+<para>
+
+</para>
+
+ holder:
+ attribute:
+ value:
+
+
<!-- ##### FUNCTION gda_holder_set_attribute ##### -->
<para>
@@ -359,5 +369,6 @@
@holder:
@attribute:
@value:
+ destroy:
Modified: trunk/doc/C/tmpl/gda-meta-struct.sgml
==============================================================================
--- trunk/doc/C/tmpl/gda-meta-struct.sgml (original)
+++ trunk/doc/C/tmpl/gda-meta-struct.sgml Tue Dec 16 20:26:33 2008
@@ -235,6 +235,17 @@
@tcol:
@att_name:
@value:
+ destroy:
+
+
+<!-- ##### MACRO gda_meta_table_column_set_attribute_static ##### -->
+<para>
+
+</para>
+
+ holder:
+ attribute:
+ value:
<!-- ##### FUNCTION gda_meta_table_column_foreach_attribute ##### -->
Modified: trunk/gtk-doc.make
==============================================================================
--- trunk/gtk-doc.make (original)
+++ trunk/gtk-doc.make Tue Dec 16 20:26:33 2008
@@ -7,11 +7,9 @@
if GTK_DOC_USE_LIBTOOL
GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
-GTKDOC_RUN = $(LIBTOOL) --mode=execute
else
GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
-GTKDOC_RUN = sh -c
endif
# We set GPATH here; this gives us semantics for GNU make
@@ -55,8 +53,6 @@
docs: html-build.stamp
-$(REPORT_FILES): sgml-build.stamp
-
#### scan ####
scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
@@ -65,7 +61,7 @@
cd $(srcdir) && \
gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
- CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
else \
cd $(srcdir) ; \
for i in $(SCANOBJ_FILES) ; do \
@@ -111,12 +107,7 @@
@-chmod -R u+w $(srcdir)
rm -rf $(srcdir)/html
mkdir $(srcdir)/html
- mkhtml_options=""; \
- gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
- if test "$(?)" = "0"; then \
- mkhtml_options=--path="$(srcdir)"; \
- fi
- cd $(srcdir)/html && gtkdoc-mkhtml $(mkhtml_options) $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+ cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
@echo 'gtk-doc: Fixing cross-references'
cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
@@ -137,37 +128,24 @@
cd $(srcdir) && rm -rf xml html
install-data-local:
- installfiles=`echo $(srcdir)/html/*`; \
+ -installfiles=`echo $(srcdir)/html/*`; \
if test "$$installfiles" = '$(srcdir)/html/*'; \
then echo '-- Nothing to install' ; \
else \
- if test -n "$(DOC_MODULE_VERSION)"; then \
- installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
- else \
- installdir="$(DESTDIR)$(TARGET_DIR)"; \
- fi; \
- $(mkinstalldirs) $${installdir} ; \
+ $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
for i in $$installfiles; do \
echo '-- Installing '$$i ; \
- $(INSTALL_DATA) $$i $${installdir}; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
done; \
- if test -n "$(DOC_MODULE_VERSION)"; then \
- mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
- mv -f $${installdir}/$(DOC_MODULE).devhelp \
- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
- fi; \
- ! which gtkdoc-rebase >/dev/null 2>&1 || \
- gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir} ; \
+ echo '-- Installing $(srcdir)/html/index.sgml' ; \
+ $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \
+ which gtkdoc-rebase >/dev/null && \
+ gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \
fi
+
uninstall-local:
- if test -n "$(DOC_MODULE_VERSION)"; then \
- installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
- else \
- installdir="$(DESTDIR)$(TARGET_DIR)"; \
- fi; \
- rm -rf $${installdir}
+ rm -f $(DESTDIR)$(TARGET_DIR)/*
#
# Require gtk-doc when making dist
@@ -190,7 +168,6 @@
-cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
-cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
cd $(distdir) && rm -f $(DISTCLEANFILES)
- ! which gtkdoc-rebase >/dev/null 2>&1 || \
- gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
+ -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
.PHONY : dist-hook-local docs
Modified: trunk/libgda/gda-attributes-manager.c
==============================================================================
--- trunk/libgda/gda-attributes-manager.c (original)
+++ trunk/libgda/gda-attributes-manager.c Tue Dec 16 20:26:33 2008
@@ -178,7 +178,7 @@
ObjAttrs *objattrs2;
objattrs2 = g_new0 (ObjAttrs, 1);
objattrs2->mgr = mgr;
- objattrs2->objects = g_slist_prepend (NULL, ptr);;
+ objattrs2->objects = g_slist_prepend (NULL, ptr);
objattrs2->values_hash = g_hash_table_new_full (attname_hash, attname_equal,
(GDestroyNotify) attname_free,
(GDestroyNotify) gda_value_free);
@@ -200,7 +200,7 @@
objattrs = objattrs2;
}
- /* Acutally add the attribute */
+ /* Actually add the attribute */
if (value) {
AttName *attname;
@@ -226,15 +226,17 @@
* gda_attributes_manager_set
* @mgr: a #GdaAttributesManager
* @ptr: a pointer to the ressources to which the attribute will apply
- * @att_name: an attribute's name, as a *static* string
+ * @att_name: an attribute's name
* @value: a #GValue, or %NULL
*
* Associates an attribute named @att_name to @ptr, with the value @value. Any previous association is replaced by
* this one, and if @value is %NULL then the association is removed.
*
- * Note: @att_name is *not* copied, so it should be a static string, or a string which exists as long as @mgr exists (or,
- * in case @ptr is an object, as long as that object exists). Libgda provides several predefined names for common attributes,
+ * Note: @att_name is *not* copied, so it should be a string which exists as long as @mgr exists.
+ * Libgda provides several predefined names for common attributes,
* see <link linkend="libgda-40-Attributes-manager.synopsis">this section</link>.
+ *
+ * If @att_name needs to be freed when not used anymore, then use gda_attributes_manager_set_full().
*/
void
gda_attributes_manager_set (GdaAttributesManager *mgr, gpointer ptr, const gchar *att_name, const GValue *value)
@@ -246,12 +248,12 @@
* gda_attributes_manager_set_full
* @mgr: a #GdaAttributesManager
* @ptr: a pointer to the ressources to which the attribute will apply
- * @att_name: an attribute's name, as a *static* string
+ * @att_name: an attribute's name
* @value: a #GValue, or %NULL
* @destroy: function called when @att_name is destroyed
*
* Does the same as gda_attributes_manager_set() except that @destroy is called when @att_name needs
- * to be freed
+ * to be freed.
*/
void
gda_attributes_manager_set_full (GdaAttributesManager *mgr, gpointer ptr,
Modified: trunk/libgda/gda-column.c
==============================================================================
--- trunk/libgda/gda-column.c (original)
+++ trunk/libgda/gda-column.c Tue Dec 16 20:26:33 2008
@@ -1,5 +1,5 @@
/* GDA library
- * Copyright (C) 1998 - 2006 The GNOME Foundation.
+ * Copyright (C) 1998 - 2008 The GNOME Foundation.
*
* AUTHORS:
* Michael Lausch <michael lausch at>
@@ -315,7 +315,7 @@
if (name)
g_value_set_string ((value = gda_value_new (G_TYPE_STRING)), name);
- gda_column_set_attribute (column, GDA_ATTRIBUTE_NAME, value);
+ gda_column_set_attribute_static (column, GDA_ATTRIBUTE_NAME, value);
if (value)
gda_value_free (value);
@@ -360,7 +360,7 @@
if (descr)
g_value_set_string ((value = gda_value_new (G_TYPE_STRING)), descr);
- gda_column_set_attribute (column, GDA_ATTRIBUTE_DESCRIPTION, value);
+ gda_column_set_attribute_static (column, GDA_ATTRIBUTE_DESCRIPTION, value);
if (value)
gda_value_free (value);
}
@@ -568,23 +568,39 @@
* @column: a #GdaColumn
* @attribute: attribute name as a static string
* @value: a #GValue, or %NULL
+ * @destroy: a function to be called when @attribute is not needed anymore, or %NULL
*
- * Set the value associated to a named attribute.
+ * Set the value associated to a named attribute. The @attribute string is 'stolen' by this method, and
+ * the memory it uses will be freed using the @destroy function when no longer needed (if @destroy is %NULL,
+ * then the string will not be freed at all).
*
- * Attributes can have any name, but Libgda proposes some default names, see <link linkend="libgda-40-Attributes-manager.synopsis">this section</link>.
- * If there is already an attribute named @attribute set, then its value is replaced with the new @value,
- * except if @value is %NULL, in which case the attribute is removed.
+ * Attributes can have any name, but Libgda proposes some default names,
+ * see <link linkend="libgda-40-Attributes-manager.synopsis">this section</link>.
+ *
+ * If there is already an attribute named @attribute set, then its value is replaced with the new value (@value is
+ * copied), except if @value is %NULL, in which case the attribute is removed.
+ *
+ * For example one would use it as:
+ *
+ * <code>
+ * gda_column_set_attribute (holder, g_strdup (my_attribute), g_free, my_value);
+ * gda_column_set_attribute (holder, GDA_ATTRIBUTE_NAME, NULL, my_value);
+ * </code>
*
* Note: this method does not modify in any way the contents of the data model for which @column is a column (nor
* does it modify the table definition of the tables used by a SELECT statement is the model was created from a
* SELECT statement).
- *
- * Warning: @attribute should be a static string (no copy of it is made), so the string should exist as long as the @column
- * object exists.
*/
void
-gda_column_set_attribute (GdaColumn *column, const gchar *attribute, const GValue *value)
+gda_column_set_attribute (GdaColumn *column, const gchar *attribute, const GValue *value, GDestroyNotify destroy)
{
+ const GValue *cvalue;
g_return_if_fail (GDA_IS_COLUMN (column));
- gda_attributes_manager_set (gda_column_attributes_manager, column, attribute, value);
+
+ cvalue = gda_attributes_manager_get (gda_column_attributes_manager, column, attribute);
+ if ((value && cvalue && !gda_value_differ (cvalue, value)) ||
+ (!value && !cvalue))
+ return;
+
+ gda_attributes_manager_set_full (gda_column_attributes_manager, column, attribute, value, destroy);
}
Modified: trunk/libgda/gda-column.h
==============================================================================
--- trunk/libgda/gda-column.h (original)
+++ trunk/libgda/gda-column.h Tue Dec 16 20:26:33 2008
@@ -81,7 +81,15 @@
void gda_column_set_default_value (GdaColumn *column, const GValue *default_value);
const GValue *gda_column_get_attribute (GdaColumn *column, const gchar *attribute);
-void gda_column_set_attribute (GdaColumn *column, const gchar *attribute, const GValue *value);
+void gda_column_set_attribute (GdaColumn *column, const gchar *attribute, const GValue *value,
+ GDestroyNotify destroy);
+
+/**
+ * gda_column_set_attribute_static
+ *
+ * This function is similar to gda_column_set_attribute() but for static strings
+ */
+#define gda_column_set_attribute_static(holder,attribute,value) gda_column_set_attribute((holder),(attribute),(value),NULL)
G_END_DECLS
Modified: trunk/libgda/gda-data-model-bdb.c
==============================================================================
--- trunk/libgda/gda-data-model-bdb.c (original)
+++ trunk/libgda/gda-data-model-bdb.c Tue Dec 16 20:26:33 2008
@@ -646,7 +646,7 @@
gchar *str;
str = g_strdup_printf (_("Custom BDB model implementation is not complete: "
"the '%s' method is missing"), "get_key_part");
- g_warning (str);
+ g_warning ("%s", str);
g_free (str);
}
value = gda_value_new_null ();
@@ -679,7 +679,7 @@
gchar *str;
str = g_strdup_printf (_("Custom BDB model implementation is not complete: "
"the '%s' method is missing"), "get_data_part");
- g_warning (str);
+ g_warning ("%s", str);
g_free (str);
}
value = gda_value_new_null ();
Modified: trunk/libgda/gda-data-model-iter-extra.h
==============================================================================
--- trunk/libgda/gda-data-model-iter-extra.h (original)
+++ trunk/libgda/gda-data-model-iter-extra.h Tue Dec 16 20:26:33 2008
@@ -26,7 +26,7 @@
G_BEGIN_DECLS
-gboolean gda_data_model_iter_move_at_row_default (GdaDataModel *model, GdaDataModelIter *iter, gint row);
+gboolean gda_data_model_iter_move_to_row_default (GdaDataModel *model, GdaDataModelIter *iter, gint row);
gboolean gda_data_model_iter_move_next_default (GdaDataModel *model, GdaDataModelIter *iter);
gboolean gda_data_model_iter_move_prev_default (GdaDataModel *model, GdaDataModelIter *iter);
Modified: trunk/libgda/gda-data-model-iter.c
==============================================================================
--- trunk/libgda/gda-data-model-iter.c (original)
+++ trunk/libgda/gda-data-model-iter.c Tue Dec 16 20:26:33 2008
@@ -201,7 +201,7 @@
/* sync parameters with the new values in row */
if (iter->priv->row == row) {
iter->priv->keep_param_changes = TRUE;
- gda_data_model_iter_move_at_row (iter, row);
+ gda_data_model_iter_move_to_row (iter, row);
iter->priv->keep_param_changes = FALSE;
}
}
@@ -217,7 +217,7 @@
* then make all the parameters invalid */
if (iter->priv->row == row) {
gda_data_model_iter_invalidate_contents (iter);
- gda_data_model_iter_move_at_row (iter, -1);
+ gda_data_model_iter_move_to_row (iter, -1);
}
else {
/* shift iter's row by one to keep good numbers */
@@ -231,7 +231,7 @@
{
/* reset the iter to before the 1st row */
gda_data_model_iter_invalidate_contents (iter);
- gda_data_model_iter_move_at_row (iter, -1);
+ gda_data_model_iter_move_to_row (iter, -1);
/* adjust GdaHolder's type if a column's type has changed from GDA_TYPE_NULL
* to something else */
@@ -513,7 +513,7 @@
}
/**
- * gda_data_model_iter_move_at_row
+ * gda_data_model_iter_move_to_row
* @iter: a #GdaDataModelIter object
* @row: the row to set @iter to
*
@@ -528,7 +528,7 @@
* Returns: TRUE if no error occurred
*/
gboolean
-gda_data_model_iter_move_at_row (GdaDataModelIter *iter, gint row)
+gda_data_model_iter_move_to_row (GdaDataModelIter *iter, gint row)
{
g_return_val_if_fail (GDA_IS_DATA_MODEL_ITER (iter), FALSE);
g_return_val_if_fail (iter->priv, FALSE);
@@ -554,7 +554,7 @@
return (GDA_DATA_MODEL_GET_CLASS (model)->i_iter_at_row) (model, iter, row);
else {
/* default method */
- return gda_data_model_iter_move_at_row_default (model, iter, row);
+ return gda_data_model_iter_move_to_row_default (model, iter, row);
}
}
}
@@ -572,10 +572,10 @@
}
/**
- * gda_data_model_iter_move_at_row_default
+ * gda_data_model_iter_move_to_row_default
*/
gboolean
-gda_data_model_iter_move_at_row_default (GdaDataModel *model, GdaDataModelIter *iter, gint row)
+gda_data_model_iter_move_to_row_default (GdaDataModel *model, GdaDataModelIter *iter, gint row)
{
/* default method */
GSList *list;
Modified: trunk/libgda/gda-data-model-iter.h
==============================================================================
--- trunk/libgda/gda-data-model-iter.h (original)
+++ trunk/libgda/gda-data-model-iter.h Tue Dec 16 20:26:33 2008
@@ -66,7 +66,7 @@
gboolean gda_data_model_iter_set_value_at (GdaDataModelIter *iter, gint col,
const GValue *value, GError **error);
-gboolean gda_data_model_iter_move_at_row (GdaDataModelIter *iter, gint row);
+gboolean gda_data_model_iter_move_to_row (GdaDataModelIter *iter, gint row);
gboolean gda_data_model_iter_move_next (GdaDataModelIter *iter);
gboolean gda_data_model_iter_move_prev (GdaDataModelIter *iter);
gint gda_data_model_iter_get_row (GdaDataModelIter *iter);
Modified: trunk/libgda/gda-data-model.c
==============================================================================
--- trunk/libgda/gda-data-model.c (original)
+++ trunk/libgda/gda-data-model.c Tue Dec 16 20:26:33 2008
@@ -25,6 +25,7 @@
#include <glib/gi18n-lib.h>
#include <glib.h>
+#include <glib/gprintf.h>
#include <libgda/gda-data-model.h>
#include <libgda/gda-data-model-private.h>
#include <libgda/gda-data-model-extra.h>
@@ -709,7 +710,7 @@
* rows in @model.
*
* The row the returned #GdaDataModelIter represents is undefined. For models which can be accessed
- * randomly the corresponding row can be set using gda_data_model_iter_move_at_row(),
+ * randomly the corresponding row can be set using gda_data_model_iter_move_to_row(),
* and for models which are accessible sequentially only then the first row will be
* fetched using gda_data_model_iter_move_next().
*
Modified: trunk/libgda/gda-data-proxy.c
==============================================================================
--- trunk/libgda/gda-data-proxy.c (original)
+++ trunk/libgda/gda-data-proxy.c Tue Dec 16 20:26:33 2008
@@ -2315,7 +2315,7 @@
repl_row = index;
if (!iter)
iter = gda_data_model_create_iter (proxy->priv->model);
- if (!gda_data_model_iter_move_at_row (iter, repl_row))
+ if (!gda_data_model_iter_move_to_row (iter, repl_row))
repl_row = -1;
}
Modified: trunk/libgda/gda-data-select.c
==============================================================================
--- trunk/libgda/gda-data-select.c (original)
+++ trunk/libgda/gda-data-select.c Tue Dec 16 20:26:33 2008
@@ -1901,7 +1901,7 @@
int_row = external_to_internal_row (imodel, row, NULL);
if (imodel->priv->usage_flags & GDA_DATA_MODEL_ACCESS_RANDOM)
- return gda_data_model_iter_move_at_row_default (model, iter, row);
+ return gda_data_model_iter_move_to_row_default (model, iter, row);
g_return_val_if_fail (iter, FALSE);
g_return_val_if_fail (imodel->priv->iter == iter, FALSE);
Modified: trunk/libgda/gda-holder.c
==============================================================================
--- trunk/libgda/gda-holder.c (original)
+++ trunk/libgda/gda-holder.c Tue Dec 16 20:26:33 2008
@@ -356,7 +356,7 @@
GValue *att_value;
g_value_set_boolean ((att_value = gda_value_new (G_TYPE_BOOLEAN)), holder->priv->default_forced);
- gda_holder_set_attribute (holder, GDA_ATTRIBUTE_IS_DEFAULT, att_value);
+ gda_holder_set_attribute_static (holder, GDA_ATTRIBUTE_IS_DEFAULT, att_value);
gda_value_free (att_value);
@@ -538,10 +538,10 @@
holder->priv->id = g_value_dup_string (value);
break;
case PROP_NAME:
- gda_holder_set_attribute (holder, GDA_ATTRIBUTE_NAME, value);
+ gda_holder_set_attribute_static (holder, GDA_ATTRIBUTE_NAME, value);
break;
case PROP_DESCR:
- gda_holder_set_attribute (holder, GDA_ATTRIBUTE_DESCRIPTION, value);
+ gda_holder_set_attribute_static (holder, GDA_ATTRIBUTE_DESCRIPTION, value);
break;
case PROP_GDA_TYPE:
if (holder->priv->g_type == GDA_TYPE_NULL)
@@ -957,7 +957,7 @@
}
GValue *att_value;
g_value_set_boolean ((att_value = gda_value_new (G_TYPE_BOOLEAN)), holder->priv->default_forced);
- gda_holder_set_attribute (holder, GDA_ATTRIBUTE_IS_DEFAULT, att_value);
+ gda_holder_set_attribute_static (holder, GDA_ATTRIBUTE_IS_DEFAULT, att_value);
gda_value_free (att_value);
/* real setting of the value */
@@ -1088,7 +1088,7 @@
}
GValue *att_value;
g_value_set_boolean ((att_value = gda_value_new (G_TYPE_BOOLEAN)), holder->priv->default_forced);
- gda_holder_set_attribute (holder, GDA_ATTRIBUTE_IS_DEFAULT, att_value);
+ gda_holder_set_attribute_static (holder, GDA_ATTRIBUTE_IS_DEFAULT, att_value);
gda_value_free (att_value);
/* real setting of the value */
@@ -1260,7 +1260,7 @@
GValue *att_value;
g_value_set_boolean ((att_value = gda_value_new (G_TYPE_BOOLEAN)), TRUE);
- gda_holder_set_attribute (holder, GDA_ATTRIBUTE_IS_DEFAULT, att_value);
+ gda_holder_set_attribute_static (holder, GDA_ATTRIBUTE_IS_DEFAULT, att_value);
gda_value_free (att_value);
g_signal_emit (holder, gda_holder_signals[CHANGED], 0);
@@ -1350,7 +1350,7 @@
GValue *att_value;
g_value_set_boolean ((att_value = gda_value_new (G_TYPE_BOOLEAN)), holder->priv->default_forced);
- gda_holder_set_attribute (holder, GDA_ATTRIBUTE_IS_DEFAULT, att_value);
+ gda_holder_set_attribute_static (holder, GDA_ATTRIBUTE_IS_DEFAULT, att_value);
gda_value_free (att_value);
/* don't emit the "changed" signal */
@@ -1689,28 +1689,38 @@
/**
* gda_holder_set_attribute
* @holder: a #GdaHolder
- * @attribute: attribute name as a static string
+ * @attribute: attribute name
* @value: a #GValue, or %NULL
+ * @destroy: a function to be called when @attribute is not needed anymore, or %NULL
*
- * Set the value associated to a named attribute.
+ * Set the value associated to a named attribute. The @attribute string is 'stolen' by this method, and
+ * the memory it uses will be freed using the @destroy function when no longer needed (if @destroy is %NULL,
+ * then the string will not be freed at all).
*
- * Attributes can have any name, but Libgda proposes some default names, see <link linkend="libgda-40-Attributes-manager.synopsis">this section</link>.
- * If there is already an attribute named @attribute set, then its value is replaced with the new @value,
- * except if @value is %NULL, in which case the attribute is removed.
+ * Attributes can have any name, but Libgda proposes some default names,
+ * see <link linkend="libgda-40-Attributes-manager.synopsis">this section</link>.
+ *
+ * For example one would use it as:
+ *
+ * <code>
+ * gda_holder_set_attribute (holder, g_strdup (my_attribute), g_free, my_value);
+ * gda_holder_set_attribute (holder, GDA_ATTRIBUTE_NAME, NULL, my_value);
+ * </code>
*
- * Warning: @attribute should be a static string (no copy of it is made), so the string should exist as long as the @holder
- * object exists.
+ * If there is already an attribute named @attribute set, then its value is replaced with the new value (@value is
+ * copied), except if @value is %NULL, in which case the attribute is removed.
*/
void
-gda_holder_set_attribute (GdaHolder *holder, const gchar *attribute, const GValue *value)
+gda_holder_set_attribute (GdaHolder *holder, const gchar *attribute, const GValue *value, GDestroyNotify destroy)
{
const GValue *cvalue;
g_return_if_fail (GDA_IS_HOLDER (holder));
cvalue = gda_attributes_manager_get (gda_holder_attributes_manager, holder, attribute);
- if (cvalue && !gda_value_differ (cvalue, value))
+ if ((value && cvalue && !gda_value_differ (cvalue, value)) ||
+ (!value && !cvalue))
return;
- gda_attributes_manager_set (gda_holder_attributes_manager, holder, attribute, value);
+ gda_attributes_manager_set_full (gda_holder_attributes_manager, holder, attribute, value, destroy);
//g_print ("GdaHolder %p ATTR '%s' set to '%s'\n", holder, attribute, gda_value_stringify (value));
}
Modified: trunk/libgda/gda-holder.h
==============================================================================
--- trunk/libgda/gda-holder.h (original)
+++ trunk/libgda/gda-holder.h Tue Dec 16 20:26:33 2008
@@ -99,7 +99,15 @@
GdaHolder *gda_holder_get_bind (GdaHolder *holder);
const GValue *gda_holder_get_attribute (GdaHolder *holder, const gchar *attribute);
-void gda_holder_set_attribute (GdaHolder *holder, const gchar *attribute, const GValue *value);
+void gda_holder_set_attribute (GdaHolder *holder, const gchar *attribute, const GValue *value,
+ GDestroyNotify destroy);
+
+/**
+ * gda_holder_set_attribute_static
+ *
+ * This function is similar to gda_holder_set_attribute() but for static strings
+ */
+#define gda_holder_set_attribute_static(holder,attribute,value) gda_holder_set_attribute((holder),(attribute),(value),NULL)
G_END_DECLS
Modified: trunk/libgda/gda-meta-store.c
==============================================================================
--- trunk/libgda/gda-meta-store.c (original)
+++ trunk/libgda/gda-meta-store.c Tue Dec 16 20:26:33 2008
@@ -1393,7 +1393,7 @@
GSList *tlist;
for (tlist = TABLE_INFO (dbobj)->columns; tlist; tlist = tlist->next) {
if (((TableColumn*) tlist->data)->column_name &&
- !strcmp (((TableColumn*) tlist->data)->column_name, cname)) {
+ !strcmp (((TableColumn*) tlist->data)->column_name, (gchar*) cname)) {
tcol = (TableColumn*) tlist->data;
if ((tcol->gtype != ptype) ||
(tcol->pkey != pkey) ||
Modified: trunk/libgda/gda-meta-struct-io.c
==============================================================================
--- trunk/libgda/gda-meta-struct-io.c (original)
+++ trunk/libgda/gda-meta-struct-io.c Tue Dec 16 20:26:33 2008
@@ -276,7 +276,7 @@
if (extra) {
GValue *true_value;
g_value_set_boolean ((true_value = gda_value_new (G_TYPE_BOOLEAN)), TRUE);
- gda_meta_table_column_set_attribute (tcol, GDA_ATTRIBUTE_AUTO_INCREMENT, true_value);
+ gda_meta_table_column_set_attribute_static (tcol, GDA_ATTRIBUTE_AUTO_INCREMENT, true_value);
gda_value_free (true_value);
xmlFree (extra);
}
Modified: trunk/libgda/gda-meta-struct.c
==============================================================================
--- trunk/libgda/gda-meta-struct.c (original)
+++ trunk/libgda/gda-meta-struct.c Tue Dec 16 20:26:33 2008
@@ -2271,9 +2271,16 @@
* object exists.
*/
void
-gda_meta_table_column_set_attribute (GdaMetaTableColumn *tcol, const gchar *attribute, const GValue *value)
+gda_meta_table_column_set_attribute (GdaMetaTableColumn *tcol, const gchar *attribute, const GValue *value,
+ GDestroyNotify destroy)
{
- gda_attributes_manager_set (att_mgr, tcol, attribute, value);
+ const GValue *cvalue;
+ cvalue = gda_attributes_manager_get (att_mgr, tcol, attribute);
+ if ((value && cvalue && !gda_value_differ (cvalue, value)) ||
+ (!value && !cvalue))
+ return;
+
+ gda_attributes_manager_set_full (att_mgr, tcol, attribute, value, destroy);
}
/**
Modified: trunk/libgda/gda-meta-struct.h
==============================================================================
--- trunk/libgda/gda-meta-struct.h (original)
+++ trunk/libgda/gda-meta-struct.h Tue Dec 16 20:26:33 2008
@@ -150,7 +150,15 @@
} GdaMetaTableColumn;
#define GDA_META_TABLE_COLUMN(x) ((GdaMetaTableColumn*)(x))
const GValue *gda_meta_table_column_get_attribute (GdaMetaTableColumn *tcol, const gchar *att_name);
-void gda_meta_table_column_set_attribute (GdaMetaTableColumn *tcol, const gchar *att_name, const GValue *value);
+void gda_meta_table_column_set_attribute (GdaMetaTableColumn *tcol, const gchar *att_name, const GValue *value,
+ GDestroyNotify destroy);
+/**
+ * gda_meta_table_column_set_attribute_static
+ *
+ * This function is similar to gda_meta_table_column_set_attribute() but for static strings
+ */
+#define gda_meta_table_column_set_attribute_static(holder,attribute,value) gda_meta_table_column_set_attribute((holder),(attribute),(value),NULL)
+
void gda_meta_table_column_foreach_attribute (GdaMetaTableColumn *tcol, GdaAttributesManagerFunc func, gpointer data);
typedef struct {
Modified: trunk/libgda/gda-set.c
==============================================================================
--- trunk/libgda/gda-set.c (original)
+++ trunk/libgda/gda-set.c Tue Dec 16 20:26:33 2008
@@ -751,7 +751,7 @@
errors = gda_data_model_import_get_errors (GDA_DATA_MODEL_IMPORT (model));
if (errors) {
GError *err = (GError *) errors->data;
- g_set_error (error, 0, 0, err->message);
+ g_set_error (error, 0, 0, "%s", err->message);
g_object_unref (model);
model = NULL;
allok = FALSE;
Modified: trunk/libgda/gda-util.c
==============================================================================
--- trunk/libgda/gda-util.c (original)
+++ trunk/libgda/gda-util.c Tue Dec 16 20:26:33 2008
@@ -496,8 +496,10 @@
GValue *value;
g_value_set_string ((value = gda_value_new (G_TYPE_STRING)),
(gchar*) xmlNodeGetContent (vnode));
- gda_attributes_manager_set_full (gda_holder_attributes_manager, (gpointer) holder,
- att_name, value, (GDestroyNotify) xmlFree);
+ gda_attributes_manager_set_full (gda_holder_attributes_manager,
+ (gpointer) holder,
+ (gchar*) att_name, value,
+ (GDestroyNotify) xmlFree);
gda_value_free (value);
}
vnode = vnode->next;
Modified: trunk/libgda/global.h
==============================================================================
--- trunk/libgda/global.h (original)
+++ trunk/libgda/global.h Tue Dec 16 20:26:33 2008
@@ -1,7 +1,7 @@
/* GLOBAL.H - RSAREF types and constants */
/* Copyright (C) RSA Laboratories, a division of RSA Data Security,
- Inc., created 1991. All rights reserved.
+ * Inc., created 1991. All rights reserved.
*/
#ifndef _GLOBAL_H_
@@ -19,18 +19,13 @@
/* POINTER defines a generic pointer type */
typedef unsigned char *POINTER;
-/* UINT2 defines a two byte word */
-typedef unsigned short int UINT2;
-
/* UINT4 defines a four byte word */
-typedef unsigned long int UINT4;
-
-#ifndef NULL_PTR
-#define NULL_PTR ((POINTER)0)
-#endif
-
-#ifndef UNUSED_ARG
-#define UNUSED_ARG(x) x = *(&x);
+#if (SIZEOF_UNSIGNED_INT==4)
+typedef unsigned int UINT4;
+#elif (SIZEOF_UNSIGNED_LONG_INT==4)
+typedef unsigned long int UINT4
+#else
+#error Could not identify a four byte word type
#endif
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
Modified: trunk/libgda/sqlite/virtual/gda-vconnection-data-model.c
==============================================================================
--- trunk/libgda/sqlite/virtual/gda-vconnection-data-model.c (original)
+++ trunk/libgda/sqlite/virtual/gda-vconnection-data-model.c Tue Dec 16 20:26:33 2008
@@ -301,7 +301,7 @@
td = gda_vconnection_get_table_data_by_name (cnc, table_name);
if (!td) {
- g_set_error (error, 0, 0, "%s", "%s",
+ g_set_error (error, 0, 0, "%s",
_("Table to remove not found"));
return FALSE;
}
Modified: trunk/libgda/sqlite/virtual/gda-virtual-connection.c
==============================================================================
--- trunk/libgda/sqlite/virtual/gda-virtual-connection.c (original)
+++ trunk/libgda/sqlite/virtual/gda-virtual-connection.c Tue Dec 16 20:26:33 2008
@@ -148,7 +148,7 @@
}
else
g_set_error (error, GDA_CONNECTION_ERROR, GDA_CONNECTION_PROVIDER_ERROR, "%s",
- "%s", _("Internal error: virtual provider does not implement the create_operation() virtual method"));
+ _("Internal error: virtual provider does not implement the create_operation() virtual method"));
return cnc;
}
Modified: trunk/libgda/sqlite/virtual/virtual-test.c
==============================================================================
--- trunk/libgda/sqlite/virtual/virtual-test.c (original)
+++ trunk/libgda/sqlite/virtual/virtual-test.c Tue Dec 16 20:26:33 2008
@@ -41,7 +41,7 @@
GdaDataModelIter *iter;
iter = gda_data_model_create_iter (xml_model);
- gda_data_model_iter_move_at_row (iter, -1);
+ gda_data_model_iter_move_to_row (iter, -1);
for (gda_data_model_iter_move_next (iter); gda_data_model_iter_is_valid (iter);
gda_data_model_iter_move_next (iter)) {
g_print ("has row %d\n", gda_data_model_iter_get_row (iter));
@@ -61,7 +61,7 @@
GdaDataModelIter *iter;
iter = gda_data_model_create_iter (csv_model);
- gda_data_model_iter_move_at_row (iter, -1);
+ gda_data_model_iter_move_to_row (iter, -1);
for (gda_data_model_iter_move_next (iter); gda_data_model_iter_is_valid (iter);
gda_data_model_iter_move_next (iter)) {
g_print ("has row %d\n", gda_data_model_iter_get_row (iter));
Modified: trunk/providers/postgres/gda-postgres-meta.c
==============================================================================
--- trunk/providers/postgres/gda-postgres-meta.c (original)
+++ trunk/providers/postgres/gda-postgres-meta.c Tue Dec 16 20:26:33 2008
@@ -162,13 +162,13 @@
"UNION SELECT current_database()::information_schema.sql_identifier AS table_catalog, nr.nspname::information_schema.sql_identifier AS table_schema, r.relname::information_schema.sql_identifier AS table_name, (((((nr.oid::text || '_'::text) || r.oid::text) || '_'::text) || a.attnum::text) || '_not_null'::text)::information_schema.sql_identifier AS constraint_name, a.attname FROM pg_namespace nr, pg_class r, pg_attribute a WHERE nr.oid = r.relnamespace AND r.oid = a.attrelid AND a.attnotnull AND a.attnum > 0 AND NOT a.attisdropped AND r.relkind = 'r'::\"char\" AND NOT pg_is_other_temp_schema(nr.oid) AND (pg_has_role(r.relowner, 'USAGE'::text) OR has_table_privilege(r.oid, 'SELECT'::text) OR has_table_privilege(r.oid, 'INSERT'::text) OR has_table_privilege(r.oid, 'UPDATE'::text) OR has_table_privilege(r.oid, 'DELETE'::text) OR has_table_privilege(r.oid, 'REFERENCES'::text) OR has_table_privilege(r.oid, 'TRIGGER'::text))",
/* I_STMT_UDT */
- "SELECT pg_catalog.current_database() as cat, n.nspname, t.typname, 'gchararray', pg_catalog.obj_description(t.oid), CASE WHEN pg_catalog.pg_type_is_visible(t.oid) IS TRUE THEN t.typname ELSE coalesce (n.nspname || '.', '') || t.typname END, coalesce (n.nspname || '.', '') || t.typname, CASE WHEN t.typname ~ '^_' THEN TRUE WHEN t.typname in ('any', 'anyarray', 'anyelement', 'cid', 'cstring', 'int2vector', 'internal', 'language_handler', 'oidvector', 'opaque', 'record', 'refcursor', 'regclass', 'regoper', 'regoperator', 'regproc', 'regprocedure', 'regtype', 'SET', 'smgr', 'tid', 'trigger', 'unknown', 'void', 'xid', 'oid', 'aclitem') THEN TRUE ELSE FALSE END, o.rolname FROM pg_catalog.pg_type t, pg_catalog.pg_user u, pg_catalog.pg_namespace n , pg_authid o WHERE t.typowner=u.usesysid AND n.oid = t.typnamespace AND pg_catalog.pg_type_is_visible(t.oid) AND (t.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid)) AND o.oid=t.typowner AND
pg_catalog.current_database = ##cat::string AND n.nspname = ##schema::string",
+ "SELECT pg_catalog.current_database() as cat, n.nspname, t.typname, 'gchararray', pg_catalog.obj_description(t.oid), CASE WHEN pg_catalog.pg_type_is_visible(t.oid) IS TRUE THEN t.typname ELSE coalesce (n.nspname || '.', '') || t.typname END, coalesce (n.nspname || '.', '') || t.typname, CASE WHEN t.typname ~ '^_' THEN TRUE WHEN t.typname in ('any', 'anyarray', 'anyelement', 'cid', 'cstring', 'int2vector', 'internal', 'language_handler', 'oidvector', 'opaque', 'record', 'refcursor', 'regclass', 'regoper', 'regoperator', 'regproc', 'regprocedure', 'regtype', 'SET', 'smgr', 'tid', 'trigger', 'unknown', 'void', 'xid', 'oid', 'aclitem') THEN TRUE ELSE FALSE END, o.rolname FROM pg_catalog.pg_type t, pg_catalog.pg_user u, pg_catalog.pg_namespace n , pg_authid o WHERE t.typowner=u.usesysid AND n.oid = t.typnamespace AND pg_catalog.pg_type_is_visible(t.oid) AND (t.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid)) AND o.oid=t.typowner AND
pg_catalog.current_database() = ##cat::string AND n.nspname = ##schema::string",
/* I_STMT_UDT_ALL */
"SELECT pg_catalog.current_database(), n.nspname, t.typname, 'gchararray', pg_catalog.obj_description(t.oid), CASE WHEN pg_catalog.pg_type_is_visible(t.oid) IS TRUE THEN t.typname ELSE coalesce (n.nspname || '.', '') || t.typname END, coalesce (n.nspname || '.', '') || t.typname, CASE WHEN t.typname ~ '^_' THEN TRUE WHEN t.typname in ('any', 'anyarray', 'anyelement', 'cid', 'cstring', 'int2vector', 'internal', 'language_handler', 'oidvector', 'opaque', 'record', 'refcursor', 'regclass', 'regoper', 'regoperator', 'regproc', 'regprocedure', 'regtype', 'SET', 'smgr', 'tid', 'trigger', 'unknown', 'void', 'xid', 'oid', 'aclitem') THEN TRUE ELSE FALSE END, o.rolname FROM pg_catalog.pg_type t, pg_catalog.pg_user u, pg_catalog.pg_namespace n , pg_authid o WHERE t.typowner=u.usesysid AND n.oid = t.typnamespace AND pg_catalog.pg_type_is_visible(t.oid) AND (t.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid)) AND o.oid=t.typowner",
/* I_STMT_UDT_COLUMNS */
- "select pg_catalog.current_database(), n.nspname, udt.typname, a.attname, a.attnum, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'UDT' || current_database() || '.' || n.nspname || '.' || udt.typname || '.' || a.attnum ELSE NULL END, information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truety
pmod(a.*, t.*)), NULL, NULL , NULL, NULL, NULL, NULL FROM pg_type udt INNER JOIN pg_namespace n ON (udt.typnamespace=n.oid) INNER JOIN pg_attribute a ON (a.attrelid=udt.typrelid) INNER JOIN pg_type t ON (a.atttypid=t.oid) INNER JOIN pg_namespace nt ON (t.typnamespace = nt.oid) WHERE udt.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = udt.typrelid) AND pg_catalog.current_database = ##cat::string AND n.nspname = ##schema::string AND udt.typname = ##name::string",
+ "select pg_catalog.current_database(), n.nspname, udt.typname, a.attname, a.attnum, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'UDT' || current_database() || '.' || n.nspname || '.' || udt.typname || '.' || a.attnum ELSE NULL END, information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truety
pmod(a.*, t.*)), NULL, NULL , NULL, NULL, NULL, NULL FROM pg_type udt INNER JOIN pg_namespace n ON (udt.typnamespace=n.oid) INNER JOIN pg_attribute a ON (a.attrelid=udt.typrelid) INNER JOIN pg_type t ON (a.atttypid=t.oid) INNER JOIN pg_namespace nt ON (t.typnamespace = nt.oid) WHERE udt.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = udt.typrelid) AND pg_catalog.current_database() = ##cat::string AND n.nspname = ##schema::string AND udt.typname = ##name::string",
/* I_STMT_UDT_COLUMNS_ALL */
"select pg_catalog.current_database(), n.nspname, udt.typname, a.attname, a.attnum, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN NULL ELSE coalesce (nt.nspname || '.', '') || t.typname END, CASE WHEN t.typelem <> 0::oid AND t.typlen = -1 THEN 'UDT' || current_database() || '.' || n.nspname || '.' || udt.typname || '.' || a.attnum ELSE NULL END, information_schema._pg_char_max_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_char_octet_length(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_numeric_scale(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truetypmod(a.*, t.*)), information_schema._pg_datetime_precision(information_schema._pg_truetypid(a.*, t.*), information_schema._pg_truety
pmod(a.*, t.*)), NULL, NULL , NULL, NULL, NULL, NULL FROM pg_type udt INNER JOIN pg_namespace n ON (udt.typnamespace=n.oid) INNER JOIN pg_attribute a ON (a.attrelid=udt.typrelid) INNER JOIN pg_type t ON (a.atttypid=t.oid) INNER JOIN pg_namespace nt ON (t.typnamespace = nt.oid) WHERE udt.typrelid != 0 AND (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = udt.typrelid)",
Modified: trunk/providers/skel-implementation/capi/gda-capi-meta.c
==============================================================================
--- trunk/providers/skel-implementation/capi/gda-capi-meta.c (original)
+++ trunk/providers/skel-implementation/capi/gda-capi-meta.c Tue Dec 16 20:26:33 2008
@@ -33,8 +33,6 @@
#include <libgda/gda-set.h>
#include <libgda/gda-holder.h>
-static gboolean append_a_row (GdaDataModel *to_model, GError **error, gint nb, ...);
-
/*
* predefined statements' IDs
*/
Modified: trunk/tests/value-holders/check_holder.c
==============================================================================
--- trunk/tests/value-holders/check_holder.c (original)
+++ trunk/tests/value-holders/check_holder.c Tue Dec 16 20:26:33 2008
@@ -951,7 +951,7 @@
"gda_holder_get_attribute() should have retunred NULL");
return FALSE;
}
- gda_holder_set_attribute (h, "attname1", value);
+ gda_holder_set_attribute_static (h, "attname1", value);
gda_value_free (value);
cvalue = gda_holder_get_attribute (h, "attname1");
if (!cvalue) {
Modified: trunk/tests/value-holders/check_set.c
==============================================================================
--- trunk/tests/value-holders/check_set.c (original)
+++ trunk/tests/value-holders/check_set.c Tue Dec 16 20:26:33 2008
@@ -275,7 +275,7 @@
return FALSE;
}
g_value_set_string ((value = gda_value_new (G_TYPE_STRING)), "Hello!");
- gda_holder_set_attribute (h, "MyAttr", value);
+ gda_holder_set_attribute_static (h, "MyAttr", value);
gda_value_free (value);
if (!emitted_signals_find (set, "holder-attr-changed", error))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]