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

Function open_tables_for_query

sql/sql_base.cc:5944–5963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5942
5943
5944bool open_tables_for_query(THD *thd, TABLE_LIST *tables,
5945 uint *table_count, uint flags,
5946 DML_prelocking_strategy *prelocking_strategy)
5947{
5948 MDL_savepoint mdl_savepoint = thd->mdl_context.mdl_savepoint();
5949
5950 DBUG_ASSERT(tables == thd->lex->query_tables);
5951
5952 if (open_tables(thd, &tables, table_count,
5953 thd->stmt_arena->is_stmt_prepare() ? MYSQL_OPEN_FORCE_SHARED_MDL : 0,
5954 prelocking_strategy))
5955 {
5956 close_thread_tables(thd);
5957 /* Don't keep locks for a failed statement. */
5958 thd->mdl_context.rollback_to_savepoint(mdl_savepoint);
5959 return true;
5960 }
5961
5962 return false;
5963}
5964
5965
5966/*

Callers 2

prepareMethod · 0.85
executeMethod · 0.85

Calls 5

close_thread_tablesFunction · 0.85
mdl_savepointMethod · 0.80
open_tablesFunction · 0.70
is_stmt_prepareMethod · 0.45
rollback_to_savepointMethod · 0.45

Tested by

no test coverage detected