Commit f8bf5b0f authored by Daniele Sciascia's avatar Daniele Sciascia Committed by Jan Lindström

MDEV-23466 SIGABRT on SELECT WSREP_LAST_SEEN_GTID

SELECT WSREP_LAST_SEEN_GTID aborts the server if no provider is
loaded.
parent fe3284b2
SELECT WSREP_LAST_SEEN_GTID();
WSREP_LAST_SEEN_GTID()
00000000-0000-0000-0000-000000000000:-1
!include ../my.cnf
[mysqld.1]
wsrep-on=OFF
binlog-format=ROW
wsrep-provider=none
wsrep-cluster-address='gcomm://'
innodb_autoinc_lock_mode=2
#
# MDEV-23466: SIGABRT in wsrep::server_state::provider on
# SELECT WSREP_LAST_SEEN_GTID() on optimized builds
#
--source include/have_innodb.inc
--source include/have_wsrep.inc
--source include/have_binlog_format_row.inc
SELECT WSREP_LAST_SEEN_GTID();
...@@ -5379,9 +5379,13 @@ String *Item_func_wsrep_last_written_gtid::val_str_ascii(String *str) ...@@ -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) String *Item_func_wsrep_last_seen_gtid::val_str_ascii(String *str)
{ {
/* TODO: Should call Wsrep_server_state.instance().last_committed_gtid() wsrep::gtid gtid= wsrep::gtid::undefined();
instead. */ if (Wsrep_server_state::instance().is_provider_loaded())
wsrep::gtid gtid= Wsrep_server_state::instance().provider().last_committed_gtid(); {
/* 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())) if (gtid_str.alloc(wsrep::gtid_c_str_len()))
{ {
my_error(ER_OUTOFMEMORY, wsrep::gtid_c_str_len()); my_error(ER_OUTOFMEMORY, wsrep::gtid_c_str_len());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment