| 5942 | |
| 5943 | |
| 5944 | bool 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 | /* |
no test coverage detected