Lines Matching refs:table_ref

167 static Truncate_result handler_truncate_base(THD *thd, TABLE_LIST *table_ref,  in handler_truncate_base()  argument
178 DBUG_ASSERT(table_ref->trg_event_map == 0); in handler_truncate_base()
184 table_ref->required_type = dd::enum_table_type::BASE_TABLE; in handler_truncate_base()
198 table_ref->mdl_request.ticket = nullptr; in handler_truncate_base()
201 if (open_and_lock_tables(thd, table_ref, flags)) in handler_truncate_base()
211 close_all_tables_for_name(thd, table_ref->table->s, false, table_ref->table); in handler_truncate_base()
213 int error = table_ref->table->file->ha_truncate(table_def); in handler_truncate_base()
216 table_ref->table->file->print_error(error, MYF(0)); in handler_truncate_base()
224 table_ref->table->file->has_transactions()) in handler_truncate_base()
228 } else if ((table_ref->table->file->ht->flags & HTON_SUPPORTS_ATOMIC_DDL)) { in handler_truncate_base()
260 TABLE_LIST *table_ref) { in handler_truncate_temporary() argument
269 if (open_and_lock_tables(thd, table_ref, 0)) in handler_truncate_temporary()
273 table_ref->table->file->ha_truncate(table_ref->table->s->tmp_table_def); in handler_truncate_temporary()
276 table_ref->table->file->print_error(error, MYF(0)); in handler_truncate_temporary()
284 table_ref->table->file->has_transactions()) in handler_truncate_temporary()
303 bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref) { in lock_table() argument
308 DBUG_ASSERT(table_ref->lock_descriptor().type == TL_WRITE); in lock_table()
310 DBUG_ASSERT(table_ref->mdl_request.type == MDL_EXCLUSIVE); in lock_table()
326 if (!(table = find_table_for_mdl_upgrade(thd, table_ref->db, in lock_table()
327 table_ref->table_name, false))) in lock_table()
333 table_ref->mdl_request.ticket = table->mdl_ticket; in lock_table()
354 DBUG_ASSERT(table_ref->next_global == nullptr); in lock_table()
355 if (lock_table_names(thd, table_ref, nullptr, in lock_table()
360 tdc_remove_table(thd, TDC_RT_REMOVE_ALL, table_ref->db, table_ref->table_name, in lock_table()
422 const TABLE_LIST &table_ref, in cleanup_temporary() argument
437 open_table_uncached(thd, saved_path.c_str(), table_ref.db, in cleanup_temporary()
438 table_ref.table_name, true, true, **tdef_holder_ptr); in cleanup_temporary()
470 void Sql_cmd_truncate_table::truncate_base(THD *thd, TABLE_LIST *table_ref) { in truncate_base() argument
472 DBUG_ASSERT(is_temporary_table(table_ref) == false); in truncate_base()
479 DBUG_ASSERT((!table_ref->table) || (table_ref->table && table_ref->table->s)); in truncate_base()
490 if (mdl_locker.ensure_locked(table_ref->db)) return; in truncate_base()
492 if (lock_table(thd, table_ref)) return; in truncate_base()
496 table_ref->db, table_ref->table_name, &table_def)) { in truncate_base()
501 my_error(ER_NO_SUCH_TABLE, MYF(0), table_ref->db, table_ref->table_name); in truncate_base()
523 if (fk_truncate_illegal_if_parent(thd, table_ref, table_def)) { in truncate_base()
532 if (mysql_audit_table_access_notify(thd, table_ref) != 0) { in truncate_base()
544 build_table_filename(path, sizeof(path) - 1, table_ref->db, in truncate_base()
545 table_ref->table_name, "", 0); in truncate_base()
548 if (ha_create_table(thd, path, table_ref->db, table_ref->table_name, in truncate_base()
566 const Truncate_result tr = handler_truncate_base(thd, table_ref, table_def); in truncate_base()
580 binlog_is_trans = table_ref->table->file->has_transactions(); in truncate_base()
589 close_all_tables_for_name(thd, table_ref->table->s, false, nullptr); in truncate_base()
618 TABLE_LIST *table_ref) { in truncate_temporary() argument
620 DBUG_ASSERT(is_temporary_table(table_ref)); in truncate_temporary()
633 DBUG_ASSERT((!table_ref->table) || (table_ref->table && table_ref->table->s)); in truncate_temporary()
638 cleanup_temporary(thd, hton, *table_ref, &tdef_holder, saved_path); in truncate_temporary()
641 TABLE *tmp_table = table_ref->table; in truncate_temporary()
648 if (thd->decide_logging_format(table_ref) != 0) return; in truncate_temporary()
683 m_error = ha_create_table(thd, saved_norm_path.c_str(), table_ref->db, in truncate_temporary()
684 table_ref->table_name, &create_info, true, true, in truncate_temporary()
713 const Truncate_result tr = handler_truncate_temporary(thd, table_ref); in truncate_temporary()
721 binlog_is_trans = table_ref->table->file->has_transactions(); in truncate_temporary()