Commit ddf34104 authored by sjaakola's avatar sjaakola Committed by Julius Goryavsky

MDEV-30456 ALTER TABLE algorithm clause not replicated

Fixing the regression happening with galera.galera_toi_ddl_nonconflicting
The problem, surfaced by the test, was due to multi-statement used in the test.
The test issues two queries, as multi-statement:

--send ALTER TABLE t1 ADD COLUMN f3 INTEGER; INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 123);

With this, the session's THD structure has in query_string member
the full multi-statement, and this was used as base query in
TOI replication rewriting.

The fix is to pass actual length of the ALTER statement part for
TOI replication.
Signed-off-by: default avatarJulius Goryavsky <julius.goryavsky@mariadb.com>
parent b476c944
......@@ -1885,7 +1885,7 @@ static int wsrep_alter_table_query(THD *thd, uchar** buf, size_t* buf_len,
Alter_info *alter_info)
{
String log_query;
log_query.append(thd->query());
log_query.append(thd->query(), thd->query_length());
/*
if user has specified the alter algorithm by session variable alter_algorithm
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment