~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to sql/rpl_rli.cc

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
  :Slave_reporting_capability("SQL"),
34
34
   no_storage(FALSE), replicate_same_server_id(::replicate_same_server_id),
35
35
   info_fd(-1), cur_log_fd(-1), save_temporary_tables(0),
 
36
   cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0),
36
37
#if HAVE_purify
37
38
   is_fake(FALSE),
38
39
#endif
39
 
   cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0),
40
40
   group_master_log_pos(0), log_space_total(0), ignore_log_space_limit(0),
41
41
   last_master_timestamp(0), slave_skip_counter(0),
42
42
   abort_pos_wait(0), slave_run_id(0), sql_thd(0),
852
852
      Don't ask for disk deletion. For now, anyway they will be deleted when
853
853
      slave restarts, but it is a better intention to not delete them.
854
854
    */
855
 
    DBUG_PRINT("info", ("table: 0x%lx", (long) table));
 
855
    DBUG_PRINT("info", ("table: %p", table));
856
856
    close_temporary(table, 1, 0);
857
857
  }
858
858
  save_temporary_tables= 0;
1166
1166
    end_trans(thd, ROLLBACK); // if a "real transaction"
1167
1167
  }
1168
1168
  m_table_map.clear_tables();
1169
 
  close_thread_tables(thd);
1170
 
  clear_tables_to_lock();
 
1169
  slave_close_thread_tables(thd);
1171
1170
  clear_flag(IN_STMT);
1172
1171
  /*
1173
1172
    Cleanup for the flags that have been set at do_apply_event.
1180
1179
 
1181
1180
void Relay_log_info::clear_tables_to_lock()
1182
1181
{
 
1182
  /*
 
1183
    Deallocating elements of table list below will also free memory where
 
1184
    meta-data locks are stored. So we want to be sure that we don't have
 
1185
    any references to this memory left.
 
1186
  */
 
1187
  DBUG_ASSERT(!mdl_has_locks(&(current_thd->mdl_context)));
 
1188
 
1183
1189
  while (tables_to_lock)
1184
1190
  {
1185
1191
    uchar* to_free= reinterpret_cast<uchar*>(tables_to_lock);
1196
1202
  DBUG_ASSERT(tables_to_lock == NULL && tables_to_lock_count == 0);
1197
1203
}
1198
1204
 
 
1205
void Relay_log_info::slave_close_thread_tables(THD *thd)
 
1206
{
 
1207
  /*
 
1208
    Since we use same memory chunks for allocation of metadata lock
 
1209
    objects for tables as we use for allocating corresponding elements
 
1210
    of 'tables_to_lock' list, we have to release metadata locks by
 
1211
    closing tables before calling clear_tables_to_lock().
 
1212
  */
 
1213
  close_thread_tables(thd);
 
1214
  clear_tables_to_lock();
 
1215
}
1199
1216
#endif