glom r1497 - in trunk: . glom
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: glom r1497 - in trunk: . glom
- Date: Mon, 31 Mar 2008 12:48:49 +0100 (BST)
Author: murrayc
Date: Mon Mar 31 12:48:49 2008
New Revision: 1497
URL: http://svn.gnome.org/viewvc/glom?rev=1497&view=rev
Log:
2008-03-31 Murray Cumming <murrayc murrayc com>
* glom/base_db.cc: get_record_field_values_for_calculation():
Do not show an error if the record does not exist yet. That is normal
and is already dealt with by the following code. Do show an error if
there is an exception.
Bug #525096 (Jani Monoses)
Modified:
trunk/ChangeLog
trunk/glom/base_db.cc
Modified: trunk/glom/base_db.cc
==============================================================================
--- trunk/glom/base_db.cc (original)
+++ trunk/glom/base_db.cc Mon Mar 31 12:48:49 2008
@@ -2042,7 +2042,18 @@
//sharedptr<const Field> fieldPrimaryKey = get_field_primary_key();
const Glib::ustring query = Utils::build_sql_select_with_key(table_name, fieldsToGet, primary_key, primary_key_value);
- Glib::RefPtr<Gnome::Gda::DataModel> data_model = query_execute(query);
+
+ Glib::RefPtr<Gnome::Gda::DataModel> data_model;
+ try
+ {
+ data_model = query_execute(query);
+ }
+ catch(const Glib::Exception& ex)
+ {
+ std::cerr << "Base_DB::get_record_field_values_for_calculation(): Exception while executing SQL: " << query << std::endl;
+ handle_error(ex);
+ return field_values;
+ }
if(data_model && data_model->get_n_rows())
{
@@ -2065,7 +2076,9 @@
}
else
{
- handle_error();
+ //Maybe the record does not exist yet
+ //(Maybe we need the field values so we can calculate default values for some fields when creating the record.)
+ //So we create appropriate empty values below.
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]