MCPcopy Create free account
hub / github.com/MariaDB/server / open_log_table

Function open_log_table

sql/sql_base.cc:10002–10031  ·  view source on GitHub ↗

Open a log table. Opening such tables is performed internally in the server implementation, and is a 'nested' open, since some tables might be already opened by the current thread. The thread context before this call is saved, and is restored when calling close_log_table(). @param thd The current thread @param one_table Log table to open @param backup [out] Temporary storage used t

Source from the content-addressed store, hash-verified

10000 @param backup [out] Temporary storage used to save the thread context
10001*/
10002TABLE *
10003open_log_table(THD *thd, TABLE_LIST *one_table, Open_tables_backup *backup)
10004{
10005 uint flags= ( MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK |
10006 MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY |
10007 MYSQL_OPEN_IGNORE_FLUSH |
10008 MYSQL_LOCK_IGNORE_TIMEOUT |
10009 MYSQL_LOCK_LOG_TABLE);
10010 TABLE *table;
10011 /* Save value that is changed in mysql_lock_tables() */
10012 ulonglong save_utime_after_lock= thd->utime_after_lock;
10013 DBUG_ENTER("open_log_table");
10014
10015 thd->reset_n_backup_open_tables_state(backup);
10016
10017 if ((table= open_ltable(thd, one_table, one_table->lock_type, flags)))
10018 {
10019 DBUG_ASSERT(table->s->table_category == TABLE_CATEGORY_LOG);
10020 DBUG_ASSERT(!table->file->row_logging);
10021
10022 /* Make sure all columns get assigned to a default value */
10023 table->use_all_columns();
10024 DBUG_ASSERT(table->s->no_replicate);
10025 }
10026 else
10027 thd->restore_backup_open_tables_state(backup);
10028
10029 thd->utime_after_lock= save_utime_after_lock;
10030 DBUG_RETURN(table);
10031}
10032
10033/**
10034 Close a log table.

Callers 4

log_generalMethod · 0.85
log_slowMethod · 0.85
activate_logMethod · 0.85
openMethod · 0.85

Calls 4

open_ltableFunction · 0.85
use_all_columnsMethod · 0.80

Tested by

no test coverage detected