Commit 15c321f6 authored by unknown's avatar unknown

post-merge fixes


mysql-test/r/rpl_switch_stm_row_mixed.result:
  result update.
  I noticed the appearance of an additional table_map+rows in the binlog
  when INSERT DELAYED, since I pulled the latest fixes to RBR of 
  INSERT DELAYED. This is ok, I put the reason why into sql_insert.cc.
sql/sql_insert.cc:
  A comment about the new row-based binlogging of INSERT DELAYED.
  Removing duplicate MY_HOOKS (from a wrong merge of the past??).
parent 9fe33acb
...@@ -286,6 +286,8 @@ master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) ...@@ -286,6 +286,8 @@ master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2) master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # use `mysqltest1`; create table t12 (a int, b float) master-bin.000001 # Query 1 # use `mysqltest1`; create table t12 (a int, b float)
master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t12) master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t12)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
......
...@@ -2066,9 +2066,19 @@ bool delayed_insert::handle_inserts(void) ...@@ -2066,9 +2066,19 @@ bool delayed_insert::handle_inserts(void)
} }
if (row->log_query && row->query.str != NULL && mysql_bin_log.is_open()) if (row->log_query && row->query.str != NULL && mysql_bin_log.is_open())
{
/*
If the query has several rows to insert, only the first row will come
here. In row-based binlogging, this means that the first row will be
written to binlog as one Table_map event and one Rows event (due to an
event flush done in binlog_query()), then all other rows of this query
will be binlogged together as one single Table_map event and one
single Rows event.
*/
thd.binlog_query(THD::ROW_QUERY_TYPE, thd.binlog_query(THD::ROW_QUERY_TYPE,
row->query.str, row->query.length, row->query.str, row->query.length,
FALSE, FALSE); FALSE, FALSE);
}
if (table->s->blob_fields) if (table->s->blob_fields)
free_delayed_insert_blobs(table); free_delayed_insert_blobs(table);
...@@ -2744,22 +2754,6 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, ...@@ -2744,22 +2754,6 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
} }
class MY_HOOKS : public TABLEOP_HOOKS
{
public:
MY_HOOKS(select_create *x) : ptr(x) { }
virtual void do_prelock(TABLE **tables, uint count)
{
if (ptr->get_thd()->current_stmt_binlog_row_based &&
!(ptr->get_create_info()->options & HA_LEX_CREATE_TMP_TABLE))
ptr->binlog_show_create_table(tables, count);
}
private:
select_create *ptr;
};
int int
select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
{ {
...@@ -2772,8 +2766,9 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) ...@@ -2772,8 +2766,9 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
MY_HOOKS(select_create *x) : ptr(x) { } MY_HOOKS(select_create *x) : ptr(x) { }
virtual void do_prelock(TABLE **tables, uint count) virtual void do_prelock(TABLE **tables, uint count)
{ {
if (ptr->get_thd()->current_stmt_binlog_row_based) if (ptr->get_thd()->current_stmt_binlog_row_based &&
ptr->binlog_show_create_table(tables, count); !(ptr->get_create_info()->options & HA_LEX_CREATE_TMP_TABLE))
ptr->binlog_show_create_table(tables, count);
} }
private: private:
......
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