[glom] get_fields_for_table_from_database(): Use gda_meta_store_sql_identifier_quote()



commit 41886be56fccd705b8d334ca9313d3546e72bb85
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Jul 25 10:42:57 2009 +0200

    get_fields_for_table_from_database(): Use gda_meta_store_sql_identifier_quote()
    	as mentioned in bug #589607 to maybe make this work with uppercase in the table name.

 ChangeLog       |    6 ++++++
 glom/base_db.cc |   17 ++++++-----------
 2 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e82fd14..cb418ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-25  Murray Cumming  <murrayc murrayc com>
+
+	* glom/base_db.cc: get_fields_for_table_from_database(): 
+	Use gda_meta_store_sql_identifier_quote() as mentioned in bug #589607
+	to maybe make this work with uppercase in the table name.
+
 2009-07-24  Daniel Elstner  <danielk openismus com>
 
 	Assign copyright of my work to Openismus GmbH
diff --git a/glom/base_db.cc b/glom/base_db.cc
index 8fdb40b..76f54ec 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -638,19 +638,14 @@ Base_DB::type_vec_fields Base_DB::get_fields_for_table_from_database(const Glib:
     Glib::RefPtr<Gnome::Gda::Connection> connection = sharedconnection->get_gda_connection();
 
     Glib::RefPtr<Gnome::Gda::Holder> holder_table_name = Gnome::Gda::Holder::create(G_TYPE_STRING, "name");
-    Glib::ustring quoted_table_name;
-    if(gda_sql_identifier_needs_quotes(table_name.c_str()))
-    {
-      gchar* quoted_table_name_c = gda_sql_identifier_add_quotes(table_name.c_str());
-      quoted_table_name = quoted_table_name_c;
-      g_free(quoted_table_name_c);
-    }
-    else
-    {
-      quoted_table_name = table_name;
-    }
+    gchar* quoted_table_name_c = gda_meta_store_sql_identifier_quote(table_name.c_str(), connection->gobj());
+    g_assert(quoted_table_name_c);
+    Glib::ustring quoted_table_name(quoted_table_name_c);
+    g_free (quoted_table_name_c);
+    quoted_table_name_c = 0;
 
     holder_table_name->set_value(quoted_table_name);
+
     std::list< Glib::RefPtr<Gnome::Gda::Holder> > holder_list;
     holder_list.push_back(holder_table_name);
 



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