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

Function mysql_ha_find_handler

sql/sql_handler.cc:561–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559*/
560
561static SQL_HANDLER *mysql_ha_find_handler(THD *thd, const LEX_CSTRING *name)
562{
563 SQL_HANDLER *handler;
564 if ((my_hash_inited(&thd->handler_tables_hash)) &&
565 (handler= (SQL_HANDLER*) my_hash_search(&thd->handler_tables_hash,
566 (const uchar*) name->str,
567 name->length + 1)))
568 {
569 DBUG_PRINT("info-in-hash",("'%s'.'%s' as '%s' table: %p",
570 handler->db.str,
571 handler->table_name.str,
572 handler->handler_name.str, handler->table));
573 if (!handler->table)
574 {
575 /* The handler table has been closed. Re-open it. */
576 TABLE_LIST tmp;
577 tmp.init_one_table(&handler->db, &handler->table_name,
578 &handler->handler_name, TL_READ);
579
580 if (mysql_ha_open(thd, &tmp, handler))
581 {
582 DBUG_PRINT("exit",("reopen failed"));
583 return 0;
584 }
585 }
586 }
587 else
588 {
589 my_error(ER_UNKNOWN_TABLE, MYF(0), name->str, "HANDLER");
590 return 0;
591 }
592 return handler;
593}
594
595
596/**

Callers 2

mysql_ha_readFunction · 0.85
mysql_ha_read_prepareFunction · 0.85

Calls 4

my_hash_searchFunction · 0.85
mysql_ha_openFunction · 0.85
my_errorFunction · 0.85
init_one_tableMethod · 0.80

Tested by

no test coverage detected