MXS-1938: Log query for inconsistent replies

If a session command produces a different result on the slave than it did
on the master, a warning is logged. This warning now also logs the query
that was being executed to make investigation of the problem easier.
This commit is contained in:
Markus Mäkelä
2018-06-23 09:06:29 +03:00
parent c70cc61132
commit 6183fab79b
2 changed files with 17 additions and 7 deletions

View File

@ -71,6 +71,11 @@ std::string SessionCommand::to_string()
/** TODO: Create C++ versions of modutil functions */
GWBUF *buf = m_buffer.release();
if (!GWBUF_IS_CONTIGUOUS(buf))
{
buf = gwbuf_make_contiguous(buf);
}
if (modutil_extract_SQL(buf, &sql, &sql_len))
{
str.append(sql, sql_len);