From e74bee61b4c9a9f62bcecf18e4fd27a6af00af44 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 4 Nov 2010 18:37:36 +0000 Subject: [PATCH] Fix the errors, reduce the noise when testing the dbi backend * Check for a null gdate before attempting to make it a string. Fixes a bunch of CRIT errors. * Comment out the log debug setting in dbi. It's stable enough that it shouldn't be needed routinely. It can, of course, be enabled from the command line. * Add a notice to ignore the warnings about there being no lock on the database when session 3 is closed. Session 3 has to be run with ignore locking or it won't run at all. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19755 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/backend/dbi/gnc-backend-dbi.c | 4 ++-- src/backend/dbi/test/test-dbi-business-stuff.c | 1 + src/backend/dbi/test/test-dbi-stuff.c | 1 + src/backend/sql/gnc-backend-sql.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backend/dbi/gnc-backend-dbi.c b/src/backend/dbi/gnc-backend-dbi.c index 50871f102c..167f2eabc7 100644 --- a/src/backend/dbi/gnc-backend-dbi.c +++ b/src/backend/dbi/gnc-backend-dbi.c @@ -1418,9 +1418,9 @@ gnc_module_init_backend_dbi(void) qof_backend_register_provider( prov ); } - /* For now, set log level to DEBUG so that SQl statements will be put into + /* If needed, set log level to DEBUG so that SQl statements will be put into the gnucash.trace file. */ - qof_log_set_level( log_module, QOF_LOG_DEBUG ); + /* qof_log_set_level( log_module, QOF_LOG_DEBUG ); */ } #ifndef GNC_NO_LOADABLE_MODULES diff --git a/src/backend/dbi/test/test-dbi-business-stuff.c b/src/backend/dbi/test/test-dbi-business-stuff.c index 9f03247e5b..ab837a86b0 100644 --- a/src/backend/dbi/test/test-dbi-business-stuff.c +++ b/src/backend/dbi/test/test-dbi-business-stuff.c @@ -213,6 +213,7 @@ test_dbi_business_store_and_reload( const gchar* driver, QofSession* session_1, qof_session_destroy( session_1 ); qof_session_end( session_2 ); qof_session_destroy( session_2 ); + g_print(" You may ignore the warning about the lock file having no entries: We had to ignore locking to run two sessions on the same database\n"); qof_session_end( session_3 ); qof_session_destroy( session_3 ); } diff --git a/src/backend/dbi/test/test-dbi-stuff.c b/src/backend/dbi/test/test-dbi-stuff.c index 344851bf6b..74b23e3364 100644 --- a/src/backend/dbi/test/test-dbi-stuff.c +++ b/src/backend/dbi/test/test-dbi-stuff.c @@ -166,6 +166,7 @@ test_dbi_store_and_reload( const gchar* driver, QofSession* session_1, const gch qof_session_destroy( session_1 ); qof_session_end( session_2 ); qof_session_destroy( session_2 ); + g_print(" You may ignore the warning about the lock file having no entries: We had to ignore locking to run two sessions on the same database\n"); qof_session_end( session_3 ); qof_session_destroy( session_3 ); } diff --git a/src/backend/sql/gnc-backend-sql.c b/src/backend/sql/gnc-backend-sql.c index 94485c86f8..6874574ebb 100644 --- a/src/backend/sql/gnc-backend-sql.c +++ b/src/backend/sql/gnc-backend-sql.c @@ -2122,7 +2122,7 @@ add_gvalue_date_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name, date = (GDate*)(*getter)( pObject, NULL ); } } - if ( g_date_valid( date ) ) + if ( date && g_date_valid( date ) ) { buf = g_strdup_printf( "%04d%02d%02d", g_date_get_year( date ), g_date_get_month( date ), g_date_get_day( date ) );