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

Function mysql_admin_table

sql/sql_admin.cc:542–1563  ·  view source on GitHub ↗

RETURN VALUES FALSE Message sent to net (admin operation went ok) TRUE Message should be sent by caller (admin operation or network communication failed) */

Source from the content-addressed store, hash-verified

540 (admin operation or network communication failed)
541*/
542static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
543 HA_CHECK_OPT* check_opt,
544 const LEX_CSTRING *operator_name,
545 thr_lock_type lock_type,
546 bool org_open_for_modify,
547 bool no_errors_from_open,
548 uint extra_open_options,
549 int (*prepare_func)(THD *, TABLE_LIST *,
550 HA_CHECK_OPT *),
551 int (handler::*operator_func)(THD *,
552 HA_CHECK_OPT *),
553 int (view_operator_func)(THD *, TABLE_LIST*,
554 HA_CHECK_OPT *),
555 bool is_cmd_replicated)
556{
557 TABLE_LIST *table;
558 List<Item> field_list;
559 Protocol *protocol= thd->protocol;
560 LEX *lex= thd->lex;
561 bool need_repair_or_alter= 0;
562 wait_for_commit* suspended_wfc;
563 bool is_table_modified= false;
564 LEX_CUSTRING tabledef_version;
565 DBUG_ENTER("mysql_admin_table");
566 DBUG_PRINT("enter", ("extra_open_options: %u", extra_open_options));
567
568#ifdef WITH_WSREP
569 /*
570 CACHE INDEX and LOAD INDEX INTO CACHE statements are
571 local operations. Do not replicate them with Galera
572 */
573 const bool disable_wsrep_on= (WSREP(thd) &&
574 (lex->sql_command == SQLCOM_ASSIGN_TO_KEYCACHE ||
575 lex->sql_command == SQLCOM_PRELOAD_KEYS));
576
577 Disable_wsrep_on_guard wsrep_on_guard(thd, disable_wsrep_on);
578#endif /* WITH_WSREP */
579
580 if (thd->transaction->xid_state.check_has_uncommitted_xa())
581 DBUG_RETURN(TRUE);
582
583 fill_check_table_metadata_fields(thd, &field_list);
584
585 if (protocol->send_result_set_metadata(&field_list,
586 Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
587 DBUG_RETURN(TRUE);
588
589 /*
590 This function calls trans_commit() during its operation, but that does not
591 imply that the operation is complete or binlogged. So we have to suspend
592 temporarily the wakeup_subsequent_commits() calls (if used).
593 */
594 suspended_wfc= thd->suspend_subsequent_commits();
595
596 mysql_ha_rm_tables(thd, tables);
597
598 /*
599 Close all temporary tables which were pre-open to simplify

Callers 3

mysql_assign_to_keycacheFunction · 0.85
mysql_preload_keysFunction · 0.85
executeMethod · 0.85

Calls 15

mysql_ha_rm_tablesFunction · 0.85
close_thread_tablesFunction · 0.85
strxmovFunction · 0.85
open_only_one_tableFunction · 0.85
trans_rollback_stmtFunction · 0.85
trans_rollbackFunction · 0.85
my_errorFunction · 0.85
set_part_stateFunction · 0.85
my_snprintfFunction · 0.85
my_eofFunction · 0.85
push_warningFunction · 0.85

Tested by

no test coverage detected