gnucash maint: Fix test-backend-dbi for Postgress and MySQL.
John Ralls
jralls at code.gnucash.org
Fri Jul 13 19:37:03 EDT 2018
Updated via https://github.com/Gnucash/gnucash/commit/de927d53 (commit)
from https://github.com/Gnucash/gnucash/commit/c2972c75 (commit)
commit de927d535d38fc584659fdea3935ea9834dab34b
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jul 13 16:34:42 2018 -0700
Fix test-backend-dbi for Postgress and MySQL.
Pass MySQL database exists errors and skip creating the database
if it exists.
diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
index c67e567..b3d9d2a 100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@ -531,6 +531,12 @@ error_handler<DbType::DBI_MYSQL> (dbi_conn conn, void* user_data)
dbi_be->set_dbi_error (ERR_BACKEND_CANT_CONNECT, 1, true);
dbi_be->retry_connection (msg);
}
+ else if (err_num == 1007) //Database exists
+ {
+ dbi_be->set_exists(true);
+ return;
+ }
+
else // Any other error
{
PERR ("DBI error: %s\n", msg);
@@ -700,7 +706,8 @@ GncDbiBackend<Type>::session_begin (QofSession* session, const char* book_id,
if (create)
{
- if (!create_database(conn, uri.quote_dbname(Type).c_str()))
+ if (!m_exists &&
+ !create_database(conn, uri.quote_dbname(Type).c_str()))
{
dbi_conn_close(conn);
LEAVE("Error");
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c7924e8..3e5dfbf 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -344,7 +344,6 @@ gnucash/import-export/log-replay/gncmod-log-replay.c
gnucash/import-export/log-replay/gnc-plugin-log-replay.c
gnucash/import-export/ofx/gncmod-ofx-import.c
gnucash/import-export/ofx/gnc-ofx-import.c
-gnucash/import-export/ofx/gnc-ofx-kvp.c
gnucash/import-export/ofx/gnc-plugin-ofx.c
gnucash/import-export/ofx/gschemas/org.gnucash.dialogs.import.ofx.gschema.xml.in
gnucash/import-export/qif-imp/assistant-qif-import.c
Summary of changes:
libgnucash/backend/dbi/gnc-backend-dbi.cpp | 9 ++++++++-
po/POTFILES.in | 1 -
2 files changed, 8 insertions(+), 2 deletions(-)
More information about the gnucash-changes
mailing list