MDEV-23466 SIGABRT on SELECT WSREP_LAST_SEEN_GTID

SELECT WSREP_LAST_SEEN_GTID aborts the server if no provider is
loaded.
This commit is contained in:
Daniele Sciascia 2020-08-18 11:03:12 +02:00 committed by Jan Lindström
parent fe3284b2cc
commit f8bf5b0f84
4 changed files with 28 additions and 3 deletions

View File

@ -0,0 +1,3 @@
SELECT WSREP_LAST_SEEN_GTID();
WSREP_LAST_SEEN_GTID()
00000000-0000-0000-0000-000000000000:-1

View File

@ -0,0 +1,8 @@
!include ../my.cnf
[mysqld.1]
wsrep-on=OFF
binlog-format=ROW
wsrep-provider=none
wsrep-cluster-address='gcomm://'
innodb_autoinc_lock_mode=2

View File

@ -0,0 +1,10 @@
#
# 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();

View File

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