| 5912 | */ |
| 5913 | |
| 5914 | bool 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 | |
| 5944 | bool open_tables_for_query(THD *thd, TABLE_LIST *tables, |
no test coverage detected