From 1cbc7d6e7f5a30007409b188f6ebd0c6fac84405 Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Tue, 9 Jun 2015 12:39:50 +0200 Subject: [PATCH] Added error string to router->m_errmsg Added error string to router->m_errmsg --- server/modules/routing/binlog/blr_master.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/modules/routing/binlog/blr_master.c b/server/modules/routing/binlog/blr_master.c index 2e91acdd2..804ff9f23 100644 --- a/server/modules/routing/binlog/blr_master.c +++ b/server/modules/routing/binlog/blr_master.c @@ -374,6 +374,12 @@ char query[128]; msg_len = len-7-6; // +7 is where msg starts, 6 is skipped the status message (#42000) msg_err = (char *)malloc(msg_len + 1); + // skip status message only as MYSQL_RESPONSE_ERR(buf) points to GWBUF_DATA(buf) +7 + strncpy(msg_err, (char *)(MYSQL_ERROR_MSG(buf) + 6), msg_len); + + /* NULL terminated error string */ + *(msg_err+msg_len)='\0'; + LOGIF(LE, (skygw_log_write( LOGFILE_ERROR, "%s: Received error: %u, '%s' from master during '%s' phase "