diff options
author | Alfranio Correia <alfranio.correia@sun.com> | 2010-06-02 00:25:08 +0100 |
---|---|---|
committer | Alfranio Correia <alfranio.correia@sun.com> | 2010-06-02 00:25:08 +0100 |
commit | 2fb387b084efb268064f064f11afa115d272cf7f (patch) | |
tree | 4b14cabdb6420424cb9aa25979cd70f63a6b09fa /sql/sql_parse.h | |
parent | f11b030e1728744d345dca708819eaee09f43a7c (diff) | |
download | mariadb-git-2fb387b084efb268064f064f11afa115d272cf7f.tar.gz |
BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format
errors
In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
binlog_format=row and a statement modifies a table restricted to
statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
binlog_format=statement and a statement modifies a table restricted to
row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
However, some DDL statements that lock tables (e.g. ALTER TABLE,
CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
although no row might be inserted into the binary log.
To fix the problem, we tagged statements that may generate
rows into the binary log and thence the warning messages are
only printed out when the appropriate conditions hold and rows
might be changed.
sql/log_event.cc:
Reorganized the Query_log_event's constructor based on the
CF_CAN_GENERATE_ROW_EVENTS flag and as such any statement
that has the associated flag should go through a cache
before being written to the binary log.
sql/share/errmsg-utf8.txt:
Improved the error message ER_BINLOG_UNSAFE_MIXED_STATEMENT according to Paul's
suggestion.
sql/sql_class.cc:
Created a hook to be used by innodb that checks if a statement
may write rows to the binary log. In other words, if it has
the CF_CAN_GENERATE_ROW_EVENTS flag associated.
sql/sql_class.h:
Defined the CF_CAN_GENERATE_ROW_EVENTS flag.
sql/sql_parse.cc:
Updated the sql_command_flags and added a function to check the
CF_CAN_GENERATE_ROW_EVENTS.
sql/sql_parse.h:
Added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
storage/innobase/handler/ha_innodb.cc:
Added a call to the hook thd_generates_rows().
storage/innobase/handler/ha_innodb.h:
Defined an external reference to the hook thd_generates_rows().
Diffstat (limited to 'sql/sql_parse.h')
-rw-r--r-- | sql/sql_parse.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_parse.h b/sql/sql_parse.h index e1543a09549..6d968033ccd 100644 --- a/sql/sql_parse.h +++ b/sql/sql_parse.h @@ -79,6 +79,7 @@ bool check_host_name(LEX_STRING *str); bool check_identifier_name(LEX_STRING *str, uint max_char_length, uint err_code, const char *param_for_err_msg); bool mysql_test_parse_for_slave(THD *thd,char *inBuf,uint length); +bool sqlcom_can_generate_row_events(const THD *thd); bool is_update_query(enum enum_sql_command command); bool is_log_table_write_query(enum enum_sql_command command); bool alloc_query(THD *thd, const char *packet, uint packet_length); |