Loading client/mysqlbinlog.cc +7 −9 Original line number Diff line number Diff line Loading @@ -483,19 +483,17 @@ static int write_event_header_and_base64(Log_event *ev, FILE *result_file, PRINT_EVENT_INFO *print_event_info) { IO_CACHE *head= &print_event_info->head_cache; IO_CACHE *body= &print_event_info->body_cache; DBUG_ENTER("write_event_header_and_base64"); /* Write header and base64 output to cache */ IO_CACHE result_cache; if (open_cached_file(&result_cache, NULL, NULL, 0, MYF(MY_WME | MY_NABP))) return 1; ev->print_header(&result_cache, print_event_info, FALSE); ev->print_base64(&result_cache, print_event_info, FALSE); /* Write header and base64 output to cache */ ev->print_header(head, print_event_info, FALSE); ev->print_base64(body, print_event_info, FALSE); /* Read data from cache and write to result file */ my_b_copy_to_file(&result_cache, result_file); close_cached_file(&result_cache); DBUG_RETURN(0); DBUG_RETURN(copy_event_cache_to_file_and_reinit(head, result_file) || copy_event_cache_to_file_and_reinit(body, result_file)); } Loading mysql-test/t/rpl_misc_functions.test +2 −0 Original line number Diff line number Diff line Loading @@ -89,12 +89,14 @@ INSERT INTO t1 VALUES (test_replication_sf()); --exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql # Cleanup connection master; --disable_warnings DROP PROCEDURE IF EXISTS test_replication_sp1; DROP PROCEDURE IF EXISTS test_replication_sp2; DROP FUNCTION IF EXISTS test_replication_sf; DROP TABLE IF EXISTS t1; --enable_warnings --sync_slave_with_master # If all is good, when can cleanup our dump files. --system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql Loading sql/lock.cc +4 −4 Original line number Diff line number Diff line Loading @@ -582,7 +582,7 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle, goto end; /* A temporary table does not have locks. */ if (table->s->tmp_table == TMP_TABLE) if (table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) goto end; /* Get command lock or LOCK TABLES lock. Maybe empty for INSERT DELAYED. */ Loading @@ -607,7 +607,7 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle, if (haystack->placeholder()) continue; table2= haystack->table; if (table2->s->tmp_table == TMP_TABLE) if (table2->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) continue; /* All tables in list must be in lock. */ Loading Loading @@ -694,7 +694,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, *write_lock_used=0; for (i=tables=lock_count=0 ; i < count ; i++) { if (table_ptr[i]->s->tmp_table != TMP_TABLE) if (table_ptr[i]->s->tmp_table != NON_TRANSACTIONAL_TMP_TABLE) { tables+=table_ptr[i]->file->lock_count(); lock_count++; Loading Loading @@ -736,7 +736,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, TABLE *table; enum thr_lock_type lock_type; if ((table=table_ptr[i])->s->tmp_table == TMP_TABLE) if ((table=table_ptr[i])->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) continue; lock_type= table->reginfo.lock_type; if (lock_type >= TL_WRITE_ALLOW_WRITE) Loading sql/log_event.cc +3 −6 Original line number Diff line number Diff line Loading @@ -75,8 +75,7 @@ class Write_on_release_cache ~Write_on_release_cache() { if (!my_b_copy_to_file(m_cache, m_file)) reinit_io_cache(m_cache, WRITE_CACHE, 0L, FALSE, TRUE); copy_event_cache_to_file_and_reinit(m_cache, m_file); if (m_flags | FLUSH_F) fflush(m_file); } Loading Loading @@ -6333,10 +6332,8 @@ void Rows_log_event::print_helper(FILE *file, if (get_flags(STMT_END_F)) { my_b_copy_to_file(head, file); my_b_copy_to_file(body, file); reinit_io_cache(head, WRITE_CACHE, 0, FALSE, TRUE); reinit_io_cache(body, WRITE_CACHE, 0, FALSE, TRUE); copy_event_cache_to_file_and_reinit(head, file); copy_event_cache_to_file_and_reinit(body, file); } } #endif Loading sql/log_event.h +8 −0 Original line number Diff line number Diff line Loading @@ -2489,4 +2489,12 @@ class Delete_rows_log_event : public Rows_log_event #endif }; static inline bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache, FILE *file) { return my_b_copy_to_file(cache, file) || reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE); } #endif /* _log_event_h */ Loading
client/mysqlbinlog.cc +7 −9 Original line number Diff line number Diff line Loading @@ -483,19 +483,17 @@ static int write_event_header_and_base64(Log_event *ev, FILE *result_file, PRINT_EVENT_INFO *print_event_info) { IO_CACHE *head= &print_event_info->head_cache; IO_CACHE *body= &print_event_info->body_cache; DBUG_ENTER("write_event_header_and_base64"); /* Write header and base64 output to cache */ IO_CACHE result_cache; if (open_cached_file(&result_cache, NULL, NULL, 0, MYF(MY_WME | MY_NABP))) return 1; ev->print_header(&result_cache, print_event_info, FALSE); ev->print_base64(&result_cache, print_event_info, FALSE); /* Write header and base64 output to cache */ ev->print_header(head, print_event_info, FALSE); ev->print_base64(body, print_event_info, FALSE); /* Read data from cache and write to result file */ my_b_copy_to_file(&result_cache, result_file); close_cached_file(&result_cache); DBUG_RETURN(0); DBUG_RETURN(copy_event_cache_to_file_and_reinit(head, result_file) || copy_event_cache_to_file_and_reinit(body, result_file)); } Loading
mysql-test/t/rpl_misc_functions.test +2 −0 Original line number Diff line number Diff line Loading @@ -89,12 +89,14 @@ INSERT INTO t1 VALUES (test_replication_sf()); --exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql # Cleanup connection master; --disable_warnings DROP PROCEDURE IF EXISTS test_replication_sp1; DROP PROCEDURE IF EXISTS test_replication_sp2; DROP FUNCTION IF EXISTS test_replication_sf; DROP TABLE IF EXISTS t1; --enable_warnings --sync_slave_with_master # If all is good, when can cleanup our dump files. --system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql Loading
sql/lock.cc +4 −4 Original line number Diff line number Diff line Loading @@ -582,7 +582,7 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle, goto end; /* A temporary table does not have locks. */ if (table->s->tmp_table == TMP_TABLE) if (table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) goto end; /* Get command lock or LOCK TABLES lock. Maybe empty for INSERT DELAYED. */ Loading @@ -607,7 +607,7 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle, if (haystack->placeholder()) continue; table2= haystack->table; if (table2->s->tmp_table == TMP_TABLE) if (table2->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) continue; /* All tables in list must be in lock. */ Loading Loading @@ -694,7 +694,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, *write_lock_used=0; for (i=tables=lock_count=0 ; i < count ; i++) { if (table_ptr[i]->s->tmp_table != TMP_TABLE) if (table_ptr[i]->s->tmp_table != NON_TRANSACTIONAL_TMP_TABLE) { tables+=table_ptr[i]->file->lock_count(); lock_count++; Loading Loading @@ -736,7 +736,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, TABLE *table; enum thr_lock_type lock_type; if ((table=table_ptr[i])->s->tmp_table == TMP_TABLE) if ((table=table_ptr[i])->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) continue; lock_type= table->reginfo.lock_type; if (lock_type >= TL_WRITE_ALLOW_WRITE) Loading
sql/log_event.cc +3 −6 Original line number Diff line number Diff line Loading @@ -75,8 +75,7 @@ class Write_on_release_cache ~Write_on_release_cache() { if (!my_b_copy_to_file(m_cache, m_file)) reinit_io_cache(m_cache, WRITE_CACHE, 0L, FALSE, TRUE); copy_event_cache_to_file_and_reinit(m_cache, m_file); if (m_flags | FLUSH_F) fflush(m_file); } Loading Loading @@ -6333,10 +6332,8 @@ void Rows_log_event::print_helper(FILE *file, if (get_flags(STMT_END_F)) { my_b_copy_to_file(head, file); my_b_copy_to_file(body, file); reinit_io_cache(head, WRITE_CACHE, 0, FALSE, TRUE); reinit_io_cache(body, WRITE_CACHE, 0, FALSE, TRUE); copy_event_cache_to_file_and_reinit(head, file); copy_event_cache_to_file_and_reinit(body, file); } } #endif Loading
sql/log_event.h +8 −0 Original line number Diff line number Diff line Loading @@ -2489,4 +2489,12 @@ class Delete_rows_log_event : public Rows_log_event #endif }; static inline bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache, FILE *file) { return my_b_copy_to_file(cache, file) || reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE); } #endif /* _log_event_h */