summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorDaniele Sciascia <daniele.sciascia@galeracluster.com>2020-08-18 11:03:12 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2020-08-19 13:12:00 +0300
commitf8bf5b0f8431493975f8f4488d0bef6e0e4e289e (patch)
tree0dff5b5a30d0a4834a02378a91c34d7f1ef30b17 /sql/item_strfunc.cc
parentfe3284b2cc8cc4f948aa234b3c6f9f2f8cffa027 (diff)
downloadmariadb-git-f8bf5b0f8431493975f8f4488d0bef6e0e4e289e.tar.gz
MDEV-23466 SIGABRT on SELECT WSREP_LAST_SEEN_GTID
SELECT WSREP_LAST_SEEN_GTID aborts the server if no provider is loaded.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index c735f697986..ea14e9d44f8 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -5379,9 +5379,13 @@ String *Item_func_wsrep_last_written_gtid::val_str_ascii(String *str)
String *Item_func_wsrep_last_seen_gtid::val_str_ascii(String *str)
{
- /* TODO: Should call Wsrep_server_state.instance().last_committed_gtid()
- instead. */
- wsrep::gtid gtid= Wsrep_server_state::instance().provider().last_committed_gtid();
+ wsrep::gtid gtid= wsrep::gtid::undefined();
+ if (Wsrep_server_state::instance().is_provider_loaded())
+ {
+ /* TODO: Should call Wsrep_server_state.instance().last_committed_gtid()
+ instead. */
+ gtid= Wsrep_server_state::instance().provider().last_committed_gtid();
+ }
if (gtid_str.alloc(wsrep::gtid_c_str_len()))
{
my_error(ER_OUTOFMEMORY, wsrep::gtid_c_str_len());