[glom] Creating from examples: Do not create users and groups with SQLite.



commit 6a5a4b984b9462fe85388c341e791325d8864696
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Nov 4 22:39:39 2011 +0100

    Creating from examples: Do not create users and groups with SQLite.
    
    * glom/libglom/db_utils.cc: add_groups_from_document(),
    set_table_privileges_groups_from_document(): Do nothing if the database
    backed doesn't support this feature, to avoid errors when using SQLite.

 ChangeLog                |    8 ++++++++
 glom/libglom/db_utils.cc |    8 ++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index eb4341f..25c92d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-11-04  Murray Cumming  <murrayc murrayc com>>
+
+	Creating from examples: Do not create users and groups with SQLite.
+
+	* glom/libglom/db_utils.cc: add_groups_from_document(),
+	set_table_privileges_groups_from_document(): Do nothing if the database 
+	backed doesn't support this feature, to avoid errors when using SQLite.
+
 2011-11-04  Murray Cumming  <murrayc murrayc com>
 
 	Handle GdaBlob in query results instead of just GdaBinary.
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index dee76d5..2c85367 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -616,6 +616,10 @@ bool add_groups_from_document(Document* document)
     std::cerr << G_STRFUNC << ": add_standard_groups(): No connection yet." << std::endl;
   }
 
+  // If the connection doesn't support users we can skip this step
+  if(!(gda_connection->supports_feature(Gnome::Gda::CONNECTION_FEATURE_USERS)))
+    return true;
+
   //Get the list of groups from the database server:
   const type_vec_strings database_groups = Privs::get_database_groups();
 
@@ -660,6 +664,10 @@ bool set_table_privileges_groups_from_document(Document* document)
     std::cerr << G_STRFUNC << ": add_standard_groups(): No connection yet." << std::endl;
   }
 
+  // If the connection doesn't support users we can skip this step
+  if(!(gda_connection->supports_feature(Gnome::Gda::CONNECTION_FEATURE_USERS)))
+    return true;
+
   //Get the list of groups from the database server:
   const type_vec_strings database_groups = Privs::get_database_groups();
 



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