diff -urN gnucash-2.4.7/src/backend/dbi/gnc-backend-dbi.c gnucash-2.4.7-patched/src/backend/dbi/gnc-backend-dbi.c
--- gnucash-2.4.7/src/backend/dbi/gnc-backend-dbi.c	2011-07-02 15:35:04.000000000 -0400
+++ gnucash-2.4.7-patched/src/backend/dbi/gnc-backend-dbi.c	2011-09-17 21:10:28.214427412 -0400
@@ -137,7 +137,7 @@
         const gchar* table_name,
         GList* col_info_list );
 static GncSqlConnection* create_dbi_connection( /*@ observer @*/ provider_functions_t* provider, /*@ observer @*/ QofBackend* qbe, /*@ observer @*/ dbi_conn conn );
-static gboolean conn_test_dbi_library( dbi_conn conn );
+static GncDbiTestResult conn_test_dbi_library( dbi_conn conn );
 #define GNC_DBI_PROVIDER_SQLITE (&provider_sqlite3)
 #define GNC_DBI_PROVIDER_MYSQL (&provider_mysql)
 #define GNC_DBI_PROVIDER_PGSQL (&provider_pgsql)
@@ -242,6 +242,7 @@
     gchar *filepath = NULL;
     gchar *msg = " ";
     gboolean file_exists;
+    GncDbiTestResult dbi_test_result = GNC_DBI_PASS;
 
     g_return_if_fail( qbe != NULL );
     g_return_if_fail( session != NULL );
@@ -314,10 +315,26 @@
         goto exit;
     }
 
-    if ( !conn_test_dbi_library( be->conn ) )
+    dbi_test_result = conn_test_dbi_library( be->conn );
+    switch( dbi_test_result )
+    {
+        case GNC_DBI_PASS:
+            break;
+
+        case GNC_DBI_FAIL_SETUP:
+            qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
+            qof_backend_set_message( qbe,
+                    "DBI library large number test incomplete" );
+            break;
+
+        case GNC_DBI_FAIL_TEST:
+            qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
+            qof_backend_set_message( qbe,
+                    "DBI library fails large number test" );
+            break;
+    }
+    if ( GNC_DBI_PASS != dbi_test_result )
     {
-        qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
-        qof_backend_set_message( qbe, "DBI library fails large number test" );
         if ( create && !file_exists ) /* File didn't exist before, but it */
         {
             /* does now, and we don't want to */
@@ -733,6 +750,7 @@
     gint portnum = 0;
     gint result;
     gboolean success = FALSE;
+    GncDbiTestResult dbi_test_result = GNC_DBI_PASS;
 
     g_return_if_fail( qbe != NULL );
     g_return_if_fail( session != NULL );
@@ -769,11 +787,26 @@
     result = dbi_conn_connect( be->conn );
     if ( result == 0 )
     {
-        if ( !conn_test_dbi_library( be->conn ) )
+        dbi_test_result = conn_test_dbi_library( be->conn );
+        switch( dbi_test_result )
+        {
+            case GNC_DBI_PASS:
+                break;
+
+            case GNC_DBI_FAIL_SETUP:
+                qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
+                qof_backend_set_message( qbe,
+                        "DBI library large number test incomplete" );
+                break;
+
+            case GNC_DBI_FAIL_TEST:
+                qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
+                qof_backend_set_message( qbe,
+                        "DBI library fails large number test" );
+                break;
+        }
+        if ( GNC_DBI_PASS != dbi_test_result )
         {
-            qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
-            qof_backend_set_message( qbe,
-                                     "DBI library fails large number test" );
             goto exit;
         }
         if (create && !force && save_may_clobber_data( qbe ) )
@@ -842,11 +875,26 @@
                 qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
                 goto exit;
             }
-            if ( !conn_test_dbi_library( be->conn ) )
+            dbi_test_result = conn_test_dbi_library( be->conn );
+            switch( dbi_test_result )
+            {
+                case GNC_DBI_PASS:
+                    break;
+
+                case GNC_DBI_FAIL_SETUP:
+                    qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
+                    qof_backend_set_message( qbe,
+                            "DBI library large number test incomplete" );
+                    break;
+
+                case GNC_DBI_FAIL_TEST:
+                    qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
+                    qof_backend_set_message( qbe,
+                            "DBI library fails large number test" );
+                    break;
+            }
+            if ( GNC_DBI_PASS != dbi_test_result )
             {
-                qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
-                qof_backend_set_message( qbe,
-                                         "DBI library fails large number test" );
                 dbi_conn_queryf( be->conn, "DROP DATABASE %s", dbname );
                 goto exit;
             }
@@ -1005,6 +1053,7 @@
     gchar* translog_path = NULL;
     gboolean success = FALSE;
     gint portnum = 0;
+    GncDbiTestResult dbi_test_result = GNC_DBI_PASS;
 
     g_return_if_fail( qbe != NULL );
     g_return_if_fail( session != NULL );
@@ -1048,11 +1097,26 @@
     result = dbi_conn_connect( be->conn );
     if ( result == 0 )
     {
-        if ( !conn_test_dbi_library( be->conn ) )
+        dbi_test_result = conn_test_dbi_library( be->conn );
+        switch ( dbi_test_result )
+        {
+            case GNC_DBI_PASS:
+                break;
+
+            case GNC_DBI_FAIL_SETUP:
+                qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
+                qof_backend_set_message( qbe,
+                        "DBI library large number test incomplete" );
+                break;
+
+            case GNC_DBI_FAIL_TEST:
+                qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
+                qof_backend_set_message( qbe,
+                        "DBI library fails large number test" );
+                break;
+        }
+        if ( GNC_DBI_PASS != dbi_test_result )
         {
-            qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
-            qof_backend_set_message( qbe,
-                                     "DBI library fails large number test" );
             goto exit;
         }
         if (create && !force && save_may_clobber_data( qbe ) )
@@ -1122,11 +1186,26 @@
                 qof_backend_set_error( qbe, ERR_BACKEND_SERVER_ERR );
                 goto exit;
             }
-            if ( !conn_test_dbi_library( be->conn ) )
+            dbi_test_result = conn_test_dbi_library( be->conn );
+            switch( dbi_test_result )
+            {
+                case GNC_DBI_PASS:
+                    break;
+
+                case GNC_DBI_FAIL_SETUP:
+                    qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
+                    qof_backend_set_message( qbe,
+                            "DBI library large number test incomplete" );
+                    break;
+
+                case GNC_DBI_FAIL_TEST:
+                    qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
+                    qof_backend_set_message( qbe,
+                            "DBI library fails large number test" );
+                    break;
+            }
+            if ( GNC_DBI_PASS != dbi_test_result )
             {
-                qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
-                qof_backend_set_message( qbe,
-                                         "DBI library fails large number test" );
                 dbi_conn_select_db( be->conn, "template1" );
                 dbi_conn_queryf( be->conn, "DROP DATABASE %s", dbnamelc );
                 goto exit;
@@ -2898,9 +2977,11 @@
  * compiler option it fails to correctly handle saving of 64-bit
  * values. This function tests for the problem.
  * @param: conn: The just-opened dbi_conn
- * @returns: TRUE if the dbi library is safe to use, FALSE otherwise.
+ * @returns: GNC_DBI_PASS if the dbi library is safe to use,
+ * GNC_DBI_FAIL_SETUP if the test could not be completed, or
+ * GNC_DBI_FAIL_TEST if the bug was found.
  */
-static gboolean
+static GncDbiTestResult
 conn_test_dbi_library( dbi_conn conn )
 {
     gint64 testlonglong = -9223372036854775807LL, resultlonglong = 0;
@@ -2908,7 +2989,7 @@
     gdouble testdouble = 1.7976921348623157E+307, resultdouble = 0.0;
     dbi_result result;
     gchar doublestr[G_ASCII_DTOSTR_BUF_SIZE], *querystr;
-    gboolean retval = TRUE;
+    GncDbiTestResult retval = GNC_DBI_PASS;
     memset( doublestr, 0, sizeof(doublestr));
 
     result = dbi_conn_query( conn, "CREATE TEMPORARY TABLE numtest "
@@ -2917,7 +2998,7 @@
     if ( result == NULL )
     {
         PWARN("Test_DBI_Library: Create table failed");
-        return FALSE;
+        return GNC_DBI_FAIL_SETUP;
     }
     dbi_result_free( result );
     g_ascii_dtostr( doublestr, sizeof(doublestr), testdouble );
@@ -2929,7 +3010,7 @@
     if ( result == NULL )
     {
         PWARN("Test_DBI_Library: Failed to insert test row into table" );
-        return FALSE;
+        return GNC_DBI_FAIL_SETUP;
     }
     dbi_result_free( result );
     gnc_push_locale( LC_NUMERIC, "C");
@@ -2941,7 +3022,7 @@
         PWARN("Test_DBI_Library: Failed to retrieve test row into table: %s",
               errmsg );
         result = dbi_conn_query( conn, "DROP TABLE numtest" );
-        return FALSE;
+        return GNC_DBI_FAIL_SETUP;
     }
     while ( dbi_result_next_row( result ))
     {
@@ -2954,13 +3035,13 @@
     {
         PWARN( "Test_DBI_Library: LongLong Failed %" G_GINT64_FORMAT " != % " G_GINT64_FORMAT,
                testlonglong, resultlonglong );
-        retval = FALSE;
+        retval = GNC_DBI_FAIL_TEST;
     }
     if ( testulonglong != resultulonglong )
     {
         PWARN( "Test_DBI_Library: Unsigned longlong Failed %" G_GUINT64_FORMAT " != %" G_GUINT64_FORMAT,
                testulonglong, resultulonglong );
-        retval = FALSE;
+        retval = GNC_DBI_FAIL_TEST;
     }
     /* A bug in libdbi stores only 7 digits of precision */
     if ( testdouble >= resultdouble + 0.000001e307 ||
@@ -2968,7 +3049,7 @@
     {
         PWARN( "Test_DBI_Library: Double Failed %17e != %17e",
                testdouble, resultdouble );
-        retval = FALSE;
+        retval = GNC_DBI_FAIL_TEST;
     }
     return retval;
 }
Binary files gnucash-2.4.7/src/backend/dbi/.gnc-backend-dbi.c.swp and gnucash-2.4.7-patched/src/backend/dbi/.gnc-backend-dbi.c.swp differ
diff -urN gnucash-2.4.7/src/backend/dbi/gnc-backend-dbi-priv.h gnucash-2.4.7-patched/src/backend/dbi/gnc-backend-dbi-priv.h
--- gnucash-2.4.7/src/backend/dbi/gnc-backend-dbi-priv.h	2011-04-23 18:17:29.000000000 -0400
+++ gnucash-2.4.7-patched/src/backend/dbi/gnc-backend-dbi-priv.h	2011-09-17 20:21:06.644799930 -0400
@@ -43,6 +43,19 @@
     drop_backup
 } TableOpType;
 
+/**
+ * Return values from conn_test_dbi_library
+ * @var GNC_DBI_PASS Did not find the large numbers bug
+ * @var GNC_DBI_FAIL_SETUP Could not completed the test
+ * @var GNC_DBI_FAIL_TEST Found the large numbers bug
+ */
+typedef enum
+{
+    GNC_DBI_PASS = 0,
+    GNC_DBI_FAIL_SETUP,
+    GNC_DBI_FAIL_TEST
+} GncDbiTestResult;
+
 typedef gchar* (*CREATE_TABLE_DDL_FN)( GncSqlConnection* conn,
                                        const gchar* table_name,
                                        const GList* col_info_list );
Binary files gnucash-2.4.7/src/backend/dbi/.gnc-backend-dbi-priv.h.swp and gnucash-2.4.7-patched/src/backend/dbi/.gnc-backend-dbi-priv.h.swp differ
diff -urN gnucash-2.4.7/src/gnome-utils/gnc-file.c gnucash-2.4.7-patched/src/gnome-utils/gnc-file.c
--- gnucash-2.4.7/src/gnome-utils/gnc-file.c	2011-07-02 12:57:48.000000000 -0400
+++ gnucash-2.4.7-patched/src/gnome-utils/gnc-file.c	2011-09-17 18:34:50.375259080 -0400
@@ -447,6 +447,17 @@
         gnc_error_dialog (parent, "%s", fmt);
         break;
 
+    case ERR_SQL_DBI_UNTESTABLE:
+
+        fmt = _("GnuCash could not complete a critical test for the presence of "
+                "a bug in the \"libdbi\" library. This may be caused by a "
+                "permissions misconfiguration of your SQL database. Please see "
+                "https://bugzilla.gnome.org/show_bug.cgi?id=645216 for more "
+                "information.");
+
+        gnc_error_dialog (parent, "%s", fmt);
+        break;
+
     default:
         PERR("FIXME: Unhandled error %d", io_error);
         fmt = _("An unknown I/O error (%d) occurred.");
Binary files gnucash-2.4.7/src/gnome-utils/.gnc-file.c.swp and gnucash-2.4.7-patched/src/gnome-utils/.gnc-file.c.swp differ
diff -urN gnucash-2.4.7/src/libqof/qof/qofbackend.h gnucash-2.4.7-patched/src/libqof/qof/qofbackend.h
--- gnucash-2.4.7/src/libqof/qof/qofbackend.h	2011-07-02 15:35:04.000000000 -0400
+++ gnucash-2.4.7-patched/src/libqof/qof/qofbackend.h	2011-09-17 18:34:50.375259080 -0400
@@ -110,6 +110,7 @@
     ERR_SQL_DB_TOO_NEW,		  /**< database is newer, we can't write to it */
     ERR_SQL_DB_BUSY,              /**< database is busy, cannot upgrade version */
     ERR_SQL_BAD_DBI,		  /**< LibDBI has numeric errors */
+    ERR_SQL_DBI_UNTESTABLE,       /**< could not complete test for LibDBI bug */
 
     /* RPC errors */
     ERR_RPC_HOST_UNK = 4000,      /**< Host unknown */
