[glom/glom-1-20] Add some runtime warnings.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-20] Add some runtime warnings.
- Date: Mon, 6 Feb 2012 09:59:53 +0000 (UTC)
commit c4a7efab4cc75d839c0fdff7daf2fb7fca87e931
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Feb 3 08:57:55 2012 +0100
Add some runtime warnings.
* glom/libglom/db_utils.cc: get_table_names_from_database():
Slightly improved error checking.
* glom/libglom/privs.cc: set_table_privileges():
Warn if a GRANT fails.
ChangeLog | 9 +++++++++
glom/libglom/db_utils.cc | 8 ++++++--
glom/libglom/privs.cc | 6 +++++-
3 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3197ce0..b61c6d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-02-03 Murray Cumming <murrayc murrayc com>
+
+ Add some runtime warnings.
+
+ * glom/libglom/db_utils.cc: get_table_names_from_database():
+ Slightly improved error checking.
+ * glom/libglom/privs.cc: set_table_privileges():
+ Warn if a GRANT fails.
+
2012-02-02 Murray Cumming <murrayc murrayc com>
Share on Network: Add reassuring message when user removal fails.
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index 12f72c3..9c92aea 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -985,11 +985,15 @@ type_vec_strings get_table_names_from_database(bool ignore_system_tables)
std::cerr << G_STRFUNC << ": Error: " << ex.what() << std::endl;
}
- if(data_model_tables && (data_model_tables->get_n_columns() == 0))
+ if(!data_model_tables)
+ {
+ std::cerr << G_STRFUNC << ": libgda returned an empty tables GdaDataModel for the database." << std::endl;
+ }
+ else if(data_model_tables->get_n_columns() <= 0)
{
std::cerr << G_STRFUNC << ": libgda reported 0 tables for the database." << std::endl;
}
- else if(data_model_tables)
+ else
{
//std::cout << "debug: data_model_tables refcount=" << G_OBJECT(data_model_tables->gobj())->ref_count << std::endl;
const int rows = data_model_tables->get_n_rows();
diff --git a/glom/libglom/privs.cc b/glom/libglom/privs.cc
index 5d95cbf..58d72c0 100644
--- a/glom/libglom/privs.cc
+++ b/glom/libglom/privs.cc
@@ -251,7 +251,11 @@ bool Privs::set_table_privileges(const Glib::ustring& group_name, const Glib::us
Privileges priv_autoincrements;
priv_autoincrements.m_view = true;
priv_autoincrements.m_edit = true;
- return set_table_privileges(group_name, GLOM_STANDARD_TABLE_AUTOINCREMENTS_TABLE_NAME, priv_autoincrements);
+ if(!set_table_privileges(group_name, GLOM_STANDARD_TABLE_AUTOINCREMENTS_TABLE_NAME, priv_autoincrements))
+ {
+ std::cerr << G_STRFUNC << ": GRANT failed on autoincrements table." << std::endl;
+ return false;
+ }
}
return true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]