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

Function open_normal_and_derived_tables

sql/sql_base.cc:5861–5896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5859*/
5860
5861bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags,
5862 uint dt_phases)
5863{
5864 DML_prelocking_strategy prelocking_strategy;
5865 uint counter;
5866 MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
5867 DBUG_ENTER("open_normal_and_derived_tables");
5868 if (open_tables(thd, &tables, &counter, flags, &prelocking_strategy))
5869 goto end;
5870
5871 // Process initialization phase if it is requested in dt_phases
5872 if ((dt_phases & DT_INIT) && mysql_handle_derived(thd->lex, DT_INIT))
5873 goto end;
5874
5875 thd->lex->resolve_optimizer_hints();
5876
5877 // Process all phases remaining after DT_INIT
5878 if (mysql_handle_derived(thd->lex, dt_phases & ~DT_INIT))
5879 goto end;
5880
5881 DBUG_RETURN(0);
5882end:
5883 /*
5884 No need to commit/rollback the statement transaction: it's
5885 either not started or we're filling in an INFORMATION_SCHEMA
5886 table on the fly, and thus mustn't manipulate with the
5887 transaction of the enclosing statement.
5888 */
5889 DBUG_ASSERT(thd->transaction->stmt.is_empty() ||
5890 (thd->state_flags & Open_tables_state::BACKUPS_AVAIL));
5891 close_thread_tables(thd);
5892 /* Don't keep locks for a failed statement. */
5893 thd->mdl_context.rollback_to_savepoint(mdl_savepoint);
5894
5895 DBUG_RETURN(TRUE); /* purecov: inspected */
5896}
5897
5898
5899/**

Callers 10

mysqld_list_fieldsFunction · 0.85
mysql_test_insert_commonFunction · 0.85
mysql_test_selectFunction · 0.85
mysql_test_do_fieldsFunction · 0.85
mysql_test_set_fieldsFunction · 0.85
mysql_test_call_fieldsFunction · 0.85
mysql_test_create_tableFunction · 0.85
mysql_test_create_viewFunction · 0.85
mysql_table_grantFunction · 0.85

Calls 7

mysql_handle_derivedFunction · 0.85
close_thread_tablesFunction · 0.85
mdl_savepointMethod · 0.80
open_tablesFunction · 0.70
is_emptyMethod · 0.45
rollback_to_savepointMethod · 0.45

Tested by

no test coverage detected