mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
merge mysql-5.1-rep+3 --> mysql-5.1-rep+2-delivery1
This commit is contained in:
@ -1732,7 +1732,7 @@ end:
|
||||
*/
|
||||
|
||||
void write_bin_log(THD *thd, bool clear_error,
|
||||
char const *query, ulong query_length)
|
||||
char const *query, ulong query_length, bool is_trans)
|
||||
{
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
@ -1741,8 +1741,9 @@ void write_bin_log(THD *thd, bool clear_error,
|
||||
thd->clear_error();
|
||||
else
|
||||
errcode= query_error_code(thd, TRUE);
|
||||
|
||||
thd->binlog_query(THD::STMT_QUERY_TYPE,
|
||||
query, query_length, FALSE, FALSE, errcode);
|
||||
query, query_length, is_trans, FALSE, FALSE, errcode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1857,7 +1858,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
||||
LINT_INIT(alias);
|
||||
LINT_INIT(path_length);
|
||||
|
||||
if (thd->current_stmt_binlog_row_based && !dont_log_query)
|
||||
if (thd->is_current_stmt_binlog_format_row() && !dont_log_query)
|
||||
{
|
||||
built_query.set_charset(system_charset_info);
|
||||
if (if_exists)
|
||||
@ -1917,7 +1918,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
||||
// removed temporary table
|
||||
tmp_table_deleted= 1;
|
||||
if (thd->variables.binlog_format == BINLOG_FORMAT_MIXED &&
|
||||
thd->current_stmt_binlog_row_based)
|
||||
thd->is_current_stmt_binlog_format_row())
|
||||
{
|
||||
if (built_tmp_query.is_empty())
|
||||
{
|
||||
@ -1951,7 +1952,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
||||
being built. The string always end in a comma and the comma
|
||||
will be chopped off before being written to the binary log.
|
||||
*/
|
||||
if (!drop_temporary && thd->current_stmt_binlog_row_based && !dont_log_query)
|
||||
if (!drop_temporary && thd->is_current_stmt_binlog_format_row() && !dont_log_query)
|
||||
{
|
||||
non_temp_tables_count++;
|
||||
/*
|
||||
@ -2079,7 +2080,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
||||
query_cache_invalidate3(thd, tables, 0);
|
||||
if (!dont_log_query)
|
||||
{
|
||||
if (!thd->current_stmt_binlog_row_based ||
|
||||
if (!thd->is_current_stmt_binlog_format_row() ||
|
||||
(non_temp_tables_count > 0 && !tmp_table_deleted))
|
||||
{
|
||||
/*
|
||||
@ -2091,7 +2092,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
||||
*/
|
||||
write_bin_log(thd, !error, thd->query(), thd->query_length());
|
||||
}
|
||||
else if (thd->current_stmt_binlog_row_based &&
|
||||
else if (thd->is_current_stmt_binlog_format_row() &&
|
||||
tmp_table_deleted)
|
||||
{
|
||||
if (non_temp_tables_count > 0)
|
||||
@ -2130,7 +2131,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
|
||||
*/
|
||||
built_tmp_query.chop(); // Chop of the last comma
|
||||
built_tmp_query.append(" /* generated by server */");
|
||||
write_bin_log(thd, !error, built_tmp_query.ptr(), built_tmp_query.length());
|
||||
write_bin_log(thd, !error, built_tmp_query.ptr(), built_tmp_query.length(),
|
||||
thd->in_multi_stmt_transaction());
|
||||
}
|
||||
}
|
||||
|
||||
@ -3551,8 +3553,8 @@ static inline void write_create_table_bin_log(THD *thd,
|
||||
Otherwise, the statement shall be binlogged.
|
||||
*/
|
||||
if (!internal_tmp_table &&
|
||||
(!thd->current_stmt_binlog_row_based ||
|
||||
(thd->current_stmt_binlog_row_based &&
|
||||
(!thd->is_current_stmt_binlog_format_row() ||
|
||||
(thd->is_current_stmt_binlog_format_row() &&
|
||||
!(create_info->options & HA_LEX_CREATE_TMP_TABLE))))
|
||||
write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
}
|
||||
@ -5289,7 +5291,7 @@ binlog:
|
||||
/*
|
||||
We have to write the query before we unlock the tables.
|
||||
*/
|
||||
if (thd->current_stmt_binlog_row_based)
|
||||
if (thd->is_current_stmt_binlog_format_row())
|
||||
{
|
||||
/*
|
||||
Since temporary tables are not replicated under row-based
|
||||
@ -6450,7 +6452,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
{
|
||||
thd->clear_error();
|
||||
Query_log_event qinfo(thd, thd->query(), thd->query_length(),
|
||||
0, FALSE, 0);
|
||||
FALSE, TRUE, FALSE, 0);
|
||||
mysql_bin_log.write(&qinfo);
|
||||
}
|
||||
my_ok(thd);
|
||||
@ -7192,7 +7194,7 @@ view_err:
|
||||
if (rename_temporary_table(thd, new_table, new_db, new_name))
|
||||
goto err1;
|
||||
/* We don't replicate alter table statement on temporary tables */
|
||||
if (!thd->current_stmt_binlog_row_based)
|
||||
if (!thd->is_current_stmt_binlog_format_row())
|
||||
write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
goto end_temporary;
|
||||
}
|
||||
@ -7354,7 +7356,7 @@ view_err:
|
||||
db, table_name);
|
||||
|
||||
DBUG_ASSERT(!(mysql_bin_log.is_open() &&
|
||||
thd->current_stmt_binlog_row_based &&
|
||||
thd->is_current_stmt_binlog_format_row() &&
|
||||
(create_info->options & HA_LEX_CREATE_TMP_TABLE)));
|
||||
write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
|
||||
|
Reference in New Issue
Block a user