mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Fix for BUG#20438: CREATE statements for views, stored routines and triggers
can be not replicable. Now CREATE statements for writing in the binlog are created as follows: - the beginning of the statement is re-created; - the rest of the statement is copied from the original query. The problem appears when there is a version-specific comment (produced by mysqldump), started in the re-created part of the statement and closed in the copied part -- there is closing comment-parenthesis, but there is no opening one. The proper fix could be to re-create original statement, but we can not implement it in 5.0. So, for 5.0 the fix is just to cut closing comment-parenthesis. This technique is also used for SHOW CREATE PROCEDURE statement (so we are able to reuse existing code).
This commit is contained in:
@@ -295,7 +295,10 @@ end:
|
||||
append_definer(thd, &log_query, &definer_user, &definer_host);
|
||||
}
|
||||
|
||||
log_query.append(thd->lex->stmt_definition_begin);
|
||||
log_query.append(thd->lex->stmt_definition_begin,
|
||||
(char *)thd->lex->sphead->m_body_begin -
|
||||
thd->lex->stmt_definition_begin +
|
||||
thd->lex->sphead->m_body.length);
|
||||
}
|
||||
|
||||
/* Such a statement can always go directly to binlog, no trans cache. */
|
||||
|
||||
Reference in New Issue
Block a user