diff options
author | unknown <guilhem@mysql.com> | 2006-03-13 15:34:30 +0100 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2006-03-13 15:34:30 +0100 |
commit | b9f6f9bc64bb827759e9f39ab53eb41de76171bd (patch) | |
tree | d8475bb058e90e7eb61a065f843874a80f73e72d /sql/item_create.cc | |
parent | 08ef92146f4314f43d2b39da65a325fdf5746154 (diff) | |
download | mariadb-git-b9f6f9bc64bb827759e9f39ab53eb41de76171bd.tar.gz |
Fixes to the replication mixed mode (patch approved by Monty):
- detect the need for row-based binlogging not at execution stage but earlier at parsing stage; needed for example for CREATE TABLE SELECT UUID().
- more tests of this mixed mode.
mysql-test/r/rpl_switch_stm_row_mixed.result:
result update
mysql-test/t/rpl_switch_stm_row_mixed.test:
testing more scenarios for the mixed replication mode.
Added support for manual testing of UDFs vs the mixed mode (behind a variable in the test).
Changing old file names to better ones.
sql/item_create.cc:
at parse time, when we see a UUID(), put up a flag in LEX to say this binlogs properly only with row-based binlogging.
sql/item_func.cc:
it's not perfect to put up the flag at this execution stage, better do it at parse stage.
sql/item_strfunc.cc:
it's not perfect to put up the flag at this execution stage, better do it at parse stage
sql/set_var.cc:
this assertion is wrong, this piece of code can happen in RBR mode too.
sql/sql_lex.cc:
when we reinitialize the LEX members before every query, we have to reinitialize the new flag
sql/sql_lex.h:
A new flag, set at parsing stage, which tells if some items seen during parsing stage require row-based replication to binlog/replicate correctly
when this statement is later executed.
It has to be in LEX and not directly in THD, for this to work in prepared statements.
sql/sql_parse.cc:
Parsing stage happened at some time in the past and set up the flag in LEX, now that we execute the statement we actually turn on row-based binlogging
if the thread's binlog format is "mixed". We then turn it off when leaving mysql_execute_command().
Some cleanup code was not executed if leaving mysql_execute_command() at the "error" label, fixing this. A better fix than the "goto end" would be
to modify each "goto error" to "res=1; goto end" but it required changing many lines which I don't want to do now ("make smallest possible patch").
sql/sql_yacc.yy:
When at parsing stage we see a UDF we put up a flag to say that row-based binlogging is preferred.
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index 17f1fbca471..fb1ef0ee9bc 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -431,7 +431,9 @@ Item *create_func_unhex(Item* a) Item *create_func_uuid(void) { - return new Item_func_uuid(); + THD *thd= current_thd; + thd->lex->binlog_row_based_if_mixed= 1; + return new(thd->mem_root) Item_func_uuid(); } Item *create_func_version(void) |