[libgdamm] update_meta_store_table(): Use the (even more horrible) gda_sql_identifier_quote() function instead
- From: Murray Cumming <murrayc src gnome org>
- To: svn-commits-list gnome org
- Subject: [libgdamm] update_meta_store_table(): Use the (even more horrible) gda_sql_identifier_quote() function instead
- Date: Mon, 20 Jul 2009 14:17:38 +0000 (UTC)
commit baab053c56573844529c187b7f5e12f2c38001e9
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Jul 20 16:17:25 2009 +0200
update_meta_store_table(): Use the (even more horrible) gda_sql_identifier_quote() function instead of
gda_sql_identifier_add_quotes(), because that is now what the documentation
says we should use.
ChangeLog | 7 +++++++
libgda/src/connection.ccg | 9 +++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 210e0fd..e37e592 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-20 Murray Cumming <murrayc murrayc com>
+
+ * libgda/src/connection.ccg: update_meta_store_table(): Use the
+ (even more horrible) gda_sql_identifier_quote() function instead of
+ gda_sql_identifier_add_quotes(), because that is now what the documentation
+ says we should use.
+
2009-07-07 Murray Cumming <murrayc murrayc com>
* libgda/src/libgda_methods.defs: Regenerated with h2defs.py.
diff --git a/libgda/src/connection.ccg b/libgda/src/connection.ccg
index 21f930a..22de523 100644
--- a/libgda/src/connection.ccg
+++ b/libgda/src/connection.ccg
@@ -24,7 +24,7 @@
#include <libgdamm/metastore.h>
#include <libgda/gda-enum-types.h>
#include <libgda/gda-connection.h>
-#include <sql-parser/gda-sql-parser.h> //For gda_sql_identifier_add_quotes().
+#include <sql-parser/gda-sql-parser.h> //For gda_sql_identifier_quote().
#include <libgda/libgda.h> //For GDA_GENERAL_ERROR
#include <iostream>
@@ -370,7 +370,12 @@ bool Connection::update_meta_store_table(const Glib::ustring& table_name, const
bool Connection::update_meta_store_table(const Glib::ustring& table_name, const Glib::ustring& schema_name, std::auto_ptr<Glib::Error>& error)
#endif
{
- gchar* table_name_quoted = gda_sql_identifier_add_quotes(table_name.c_str());
+ // This ridiculous function, with the obscure parameters, is needed to make sure that
+ // the GdaMetaStore really gets the meta data for the table we specified, even if
+ // the table name contains upper-case characters or spaces. murrayc.
+ gchar* table_name_quoted = gda_sql_identifier_quote(table_name.c_str(), gobj(), NULL,
+ TRUE /* meta-store convention */,
+ TRUE /* force_quotes - Yes, the really_do_what_i_say() function has a really_really_do_what_i_say parameter. */ );
std::cout << "Connection::update_meta_store_table(): table_name_quoted=" << table_name_quoted << std::endl;
GValue table_name_value = { 0 };
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]