Skip to content

Commit f8bf5b0

Browse files
Daniele SciasciaJan Lindström
authored andcommitted
MDEV-23466 SIGABRT on SELECT WSREP_LAST_SEEN_GTID
SELECT WSREP_LAST_SEEN_GTID aborts the server if no provider is loaded.
1 parent fe3284b commit f8bf5b0

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SELECT WSREP_LAST_SEEN_GTID();
2+
WSREP_LAST_SEEN_GTID()
3+
00000000-0000-0000-0000-000000000000:-1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
!include ../my.cnf
2+
3+
[mysqld.1]
4+
wsrep-on=OFF
5+
binlog-format=ROW
6+
wsrep-provider=none
7+
wsrep-cluster-address='gcomm://'
8+
innodb_autoinc_lock_mode=2
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# MDEV-23466: SIGABRT in wsrep::server_state::provider on
3+
# SELECT WSREP_LAST_SEEN_GTID() on optimized builds
4+
#
5+
6+
--source include/have_innodb.inc
7+
--source include/have_wsrep.inc
8+
--source include/have_binlog_format_row.inc
9+
10+
SELECT WSREP_LAST_SEEN_GTID();

sql/item_strfunc.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5379,9 +5379,13 @@ String *Item_func_wsrep_last_written_gtid::val_str_ascii(String *str)
53795379

53805380
String *Item_func_wsrep_last_seen_gtid::val_str_ascii(String *str)
53815381
{
5382-
/* TODO: Should call Wsrep_server_state.instance().last_committed_gtid()
5383-
instead. */
5384-
wsrep::gtid gtid= Wsrep_server_state::instance().provider().last_committed_gtid();
5382+
wsrep::gtid gtid= wsrep::gtid::undefined();
5383+
if (Wsrep_server_state::instance().is_provider_loaded())
5384+
{
5385+
/* TODO: Should call Wsrep_server_state.instance().last_committed_gtid()
5386+
instead. */
5387+
gtid= Wsrep_server_state::instance().provider().last_committed_gtid();
5388+
}
53855389
if (gtid_str.alloc(wsrep::gtid_c_str_len()))
53865390
{
53875391
my_error(ER_OUTOFMEMORY, wsrep::gtid_c_str_len());

0 commit comments

Comments
 (0)