diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-01-30 17:40:40 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-01-30 17:41:37 +0200 |
commit | 446b3d356218bff06efe4b3f5df89595cdfe8284 (patch) | |
tree | 0f526331d9ef00e595e761027ff73ee7b8883c1f /sql | |
parent | cea431e1f7024426cca09061e9a238485340206d (diff) | |
download | mariadb-git-446b3d356218bff06efe4b3f5df89595cdfe8284.tar.gz |
MDEV-14875: galera_new_cluster crashes mysqld when existing server contains databases
Fortify wsrep_hton so that wsrep calls are not done to NULL-pointers.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/wsrep_hton.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc index 0a85a947294..e7c7b377e08 100644 --- a/sql/wsrep_hton.cc +++ b/sql/wsrep_hton.cc @@ -120,7 +120,7 @@ void wsrep_post_commit(THD* thd, bool all) case LOCAL_COMMIT: { DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED); - if (wsrep->post_commit(wsrep, &thd->wsrep_ws_handle)) + if (wsrep && wsrep->post_commit(wsrep, &thd->wsrep_ws_handle)) { DBUG_PRINT("wsrep", ("set committed fail")); WSREP_WARN("set committed fail: %llu %d", @@ -252,7 +252,7 @@ static int wsrep_rollback(handlerton *hton, THD *thd, bool all) if ((all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && (thd->variables.wsrep_on && thd->wsrep_conflict_state != MUST_REPLAY)) { - if (wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle)) + if (wsrep && wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle)) { DBUG_PRINT("wsrep", ("setting rollback fail")); WSREP_ERROR("settting rollback fail: thd: %llu, schema: %s, SQL: %s", @@ -294,7 +294,7 @@ int wsrep_commit(handlerton *hton, THD *thd, bool all) possible changes to clean state. */ if (WSREP_PROVIDER_EXISTS) { - if (wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle)) + if (wsrep && wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle)) { DBUG_PRINT("wsrep", ("setting rollback fail")); WSREP_ERROR("settting rollback fail: thd: %llu, schema: %s, SQL: %s", @@ -471,7 +471,7 @@ wsrep_run_wsrep_commit(THD *thd, bool all) } else if (!rcode) { - if (WSREP_OK == rcode) + if (WSREP_OK == rcode && wsrep) rcode = wsrep->pre_commit(wsrep, (wsrep_conn_id_t)thd->thread_id, &thd->wsrep_ws_handle, |