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



commit 5b4837f384a58f85fec4f4741a7b04022b2c468a
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 bc115dc..1c32bd4 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 gdouble results from python functions.
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index 961d734..18db594 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -687,6 +687,10 @@ bool add_groups_from_document(Document* document)
     std::cerr << "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();
 
@@ -731,6 +735,10 @@ bool set_table_privileges_groups_from_document(Document* document)
     std::cerr << "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]