Fix test-backend-dbi for Postgress and MySQL.

Pass MySQL database exists errors and skip creating the database
if it exists.
pull/381/head
John Ralls 8 years ago
parent c2972c75d0
commit de927d535d

@ -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");

@ -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

Loading…
Cancel
Save