Binlog lacks encoding info about DROPped temporary table.
Idea of the fix is to switch temporary to system_charset_info when a temporary table
is DROPped for binlog. Since that is the server, that automatically, but not the client, who generates the query
the binlog should be updated on the server's encoding for the coming DROP.
The `write_binlog_with_system_charset()' is introduced to replace similar problematic places in the code.
mysql-test/r/drop_temp_table.result:
results changed
mysql-test/r/mix_innodb_myisam_binlog.result:
results changed
mysql-test/r/mysqlbinlog.result:
results changed
mysql-test/r/rpl_temporary.result:
results changed
mysql-test/t/mysqlbinlog.test:
Check roll-forward recovery from binlog where there are DROP temporary tables created
in koi8r.
mysql-test/t/rpl_temporary.test:
Check slave digests binlog with DROP temporary tables created in koi8r.
sql/mysql_priv.h:
`write_binlog_with_system_charset()' is added to be called when a binlog event
is created "implicitly" like DROP temporary table is case of closing connection.
sql/sql_base.cc:
Idea of the fix is to switch temporary to system_charset_info when a temporary table
is DROPped for binlog. Since that is the server, not the client, who generates the query
the binlog should be updated on server's encoding for the coming DROP.
and fixing it another way (per Monty; a simpler solution which does not increase the number
of binlog events is to always execute DROP TEMPORARY TABLE IF EXISTS on slave). A new test rpl_drop_temp.
2) fixing BUG#8436 "Multiple "stacked" SQL statements cause replication to stop" by setting
thd->query_length to the length of the query being executed, not counting the next queries
if this is a multi-query. Should also improve display of SHOW PROCESSLIST. A new test rpl_multi_query.
mysql-test/r/drop_temp_table.result:
back to one single DROP
sql/sql_base.cc:
undoing the fix I had made some days ago: we are back to one single DROP TEMPORARY TABLE for all temp tables.
sql/sql_parse.cc:
1) set thd->query_length to the length of the query being executed, excluding the other next queries
if this is a multi-query. The setting happens ASAP, ie. just after we know it's a multi-query, ie. just after yyparse().
Don't include the ';' in thd->query_length, because this is not good for storage in binlog.
2) always execute a DROP TEMPORARY TABLE IF EXISTS on slave, don't skip it even if --replicate-ignore-table
when we close the session's temp tables at session end, we automatically write to binlog *one* DROP TEMPORARY TABLE *per tmp table*.
mysql-test/r/drop_temp_table.result:
result update (note: one DROP TEMPORARY TABLE per tmp table)
mysql-test/t/drop_temp_table.test:
checking that we have one DROP TEMPORARY TABLE per tmp table now, not one multi-table DROP.
Hiding columns Log_pos/End_log_pos per Monty's request.
sql/sql_base.cc:
When we close the session's temp tables at session end, we automatically write to binlog one DROP TEMPORARY TABLE per tmp table,
not one single multi-table DROP TEMPORARY TABLE (because it causes problems if slave has --replicate*table rules).
CREATE DATABASE statement used the current database instead of the
database created when checking conditions for replication.
CREATE/DROP/ALTER DATABASE statements are now replicated based on
the manipulated database.
mysql-test/t/rpl_until.test:
Longer sleep to allow slave to stop.
mysql-test/t/rpl_charset.test:
Position change in binary file.
mysql-test/r/drop_temp_table.result:
Position change in binlog.
mysql-test/r/rpl_loaddata_rule_m.result:
Position change in binlog.
mysql-test/r/rpl_charset.result:
Position change in binlog.
sql/log_event.h:
Added new flag and parameter to suppress generation of
USE statements.
sql/log_event.cc:
Added parameter and code to suppress generation of
USE statements.
sql/sql_db.cc:
Suppress generation of USE before CREATE/ALTER/DROP DATABASE
statements.
sql/log.cc:
Query_log_event have new extra parameter.
sql/sql_table.cc:
Query_log_event have new extra parameter.
sql/sql_base.cc:
Query_log_event have new extra parameter.
sql/sql_update.cc:
Query_log_event have new extra parameter.
sql/sql_insert.cc:
Query_log_event have new extra parameter.
sql/sql_rename.cc:
Query_log_event have new extra parameter.
sql/sql_delete.cc:
Query_log_event have new extra parameter.
sql/sql_acl.cc:
Query_log_event have new extra parameter.
sql/handler.cc:
Query_log_event have new extra parameter.
sql/item_func.cc:
Query_log_event have new extra parameter.
sql/sql_parse.cc:
Query_log_event have new extra parameter.
mysql-test/r/alter_table.result:
Updated results after merge
mysql-test/r/drop_temp_table.result:
Updated results after merge
mysql-test/r/union.result:
Updated results after merge
sql/sql_db.cc:
optimization: Use my_stat() instead of my_dir() to test if directory exists
sql/sql_union.cc:
Fixed error in merge
mysql-test/std_data/trunc_binlog.000001:
Rename: mysql-test/std_data/trunc_binlog.001 -> mysql-test/std_data/trunc_binlog.000001
client/mysqltest.c:
Fixed merge problem
mysql-test/mysql-test-run.sh:
Fixed merge problem
mysql-test/r/distinct.result:
Fix after merge
mysql-test/r/drop_temp_table.result:
Fix after merge
mysql-test/r/join_outer.result:
Fix after merge
mysql-test/r/mysqldump.result:
Fix after merge
mysql-test/r/null_key.result:
Fix after merge
mysql-test/r/order_by.result:
Fix after merge
mysql-test/r/rpl_alter.result:
Fix after merge
mysql-test/r/rpl_loaddata.result:
Fix after merge
mysql-test/r/rpl_loaddata_rule_m.result:
Fix after merge
mysql-test/r/rpl_trunc_binlog.result:
Fix after merge
mysql-test/r/select_safe.result:
Fix after merge
mysql-test/t/insert.test:
Fix after merge
mysql-test/t/mysqlbinlog.test:
Fix after merge
mysql-test/t/rpl000009.test:
Fix after merge
mysql-test/t/rpl_alter.test:
Fix after merge
mysql-test/t/rpl_loaddata_rule_m.test:
Fix after merge
mysql-test/t/rpl_trunc_binlog.test:
Fix after merge
sql-common/client.c:
Fix after merge
sql/item_subselect.cc:
Fix after merge
sql/repl_failsafe.cc:
Fix after merge
sql/slave.cc:
Fix after merge
sql/sql_insert.cc:
Fix after merge
(a missing synchronization in the test)
mysql-test/r/drop_temp_table.result:
result update
mysql-test/t/drop_temp_table.test:
synchronize to be sure that the ending connection has finished binlogging.
Add quoting for use `database` for mysqlbinlog
Removed test ins0000001
Add support for --replace for exec in mysqltest
Don't refer to install dir in mysqlbinlog.result
BitKeeper/deleted/.del-ins000001.result~f45c599efdf8352b:
Delete: mysql-test/r/ins000001.result
BitKeeper/deleted/.del-ins000001.test~2428ee5c9b1bc483:
Delete: mysql-test/t/ins000001.test
client/mysqlbinlog.cc:
Removed random chars after filename for LOAD DATA INFILE
client/mysqltest.c:
Add support for --replace for 'exec'
mysql-test/r/drop_temp_table.result:
Updated results after quoting change
mysql-test/r/fulltext_multi.result:
Updated results after quoting change
mysql-test/r/fulltext_order_by.result:
Updated results after quoting change
mysql-test/r/insert.result:
New tests
mysql-test/r/insert_select.result:
Updated results after quoting change
mysql-test/r/mix_innodb_myisam_binlog.result:
Updated results after quoting change
mysql-test/r/mysqlbinlog.result:
Updated results after quoting change
mysql-test/r/rpl_log.result:
Updated results after quoting change
mysql-test/t/fulltext_multi.test:
Remove 'use'
mysql-test/t/fulltext_order_by.test:
Remove 'use'
mysql-test/t/insert.test:
Merge test with ins0000001.test
mysql-test/t/mysqlbinlog.test:
Don't refer to install dir in result
sql/log_event.cc:
Add quoting for use `database` for mysqlbinlog
support-files/mysql.server.sh:
Move pid_file test after arguments have been parsed
it's just backquoting the db's and table's names
when writing DROP TEMPORARY TABLE to the binlog when a connection ends.
A testcase for this.
sql/sql_base.cc:
backquote db and table name when writing DROP TEMPORARY TABLE to the binlog
when a connection ends.