From 7cd7027ad0005686fba46d8a27f3d05ee03c3b67 Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Fri, 29 Dec 2023 13:05:42 +0500 Subject: [PATCH] Added error checking --- test/tap/tests/test_binlog_fast_forward-t.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/tap/tests/test_binlog_fast_forward-t.cpp b/test/tap/tests/test_binlog_fast_forward-t.cpp index 281ac0e056..38ace98adc 100644 --- a/test/tap/tests/test_binlog_fast_forward-t.cpp +++ b/test/tap/tests/test_binlog_fast_forward-t.cpp @@ -38,13 +38,17 @@ std::vector adminQ_set1 = { int pull_replication(MYSQL *mysql, int server_id) { MARIADB_RPL_EVENT *event= NULL; MARIADB_RPL *rpl= mariadb_rpl_init(mysql); + if (!rpl) { + fprintf(stderr, "File %s, line %d, Error: mariadb_rpl_init failed\n", __FILE__, __LINE__); + return exit_status(); + } rpl->server_id= server_id; rpl->start_position= 4; rpl->flags= MARIADB_RPL_BINLOG_SEND_ANNOTATE_ROWS; - - if (mariadb_rpl_open(rpl)) + if (mariadb_rpl_open(rpl)) { + fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, mariadb_rpl_error(rpl)); return exit_status(); - + } int num_heartbeats = 0; int num_events = 0;