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

Function open_tables_only_view_structure

sql/sql_base.cc:5914–5941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5912*/
5913
5914bool open_tables_only_view_structure(THD *thd, TABLE_LIST *table_list,
5915 bool can_deadlock)
5916{
5917 DBUG_ENTER("open_tables_only_view_structure");
5918 /*
5919 Let us set fake sql_command so views won't try to merge
5920 themselves into main statement. If we don't do this,
5921 SELECT * from information_schema.xxxx will cause problems.
5922 SQLCOM_SHOW_FIELDS is used because it satisfies
5923 'LEX::only_view_structure()'.
5924 */
5925 enum_sql_command save_sql_command= thd->lex->sql_command;
5926 thd->lex->sql_command= SQLCOM_SHOW_FIELDS;
5927 bool rc= (thd->open_temporary_tables(table_list) ||
5928 open_normal_and_derived_tables(thd, table_list,
5929 (MYSQL_OPEN_IGNORE_FLUSH |
5930 MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL |
5931 MYSQL_OPEN_GET_NEW_TABLE |
5932 (can_deadlock ?
5933 MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)),
5934 DT_INIT | DT_PREPARE));
5935 /*
5936 Restore old value of sql_command back as it is being looked at in
5937 process_table() function.
5938 */
5939 thd->lex->sql_command= save_sql_command;
5940 DBUG_RETURN(rc);
5941}
5942
5943
5944bool open_tables_for_query(THD *thd, TABLE_LIST *tables,

Callers 3

resolve_type_refMethod · 0.85

Calls 2

open_temporary_tablesMethod · 0.80

Tested by

no test coverage detected