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

Function get_trigger_table

sql/sql_show.cc:11389–11423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11387*/
11388
11389static
11390TABLE_LIST *get_trigger_table(THD *thd, const sp_name *trg_name)
11391{
11392 char trn_path_buff[FN_REFLEN];
11393 LEX_CSTRING trn_path= { trn_path_buff, 0 };
11394 LEX_CSTRING db;
11395 LEX_CSTRING tbl_name;
11396 TABLE_LIST *table;
11397
11398 build_trn_path(thd, trg_name, (LEX_STRING*) &trn_path);
11399
11400 if (check_trn_exists(&trn_path))
11401 {
11402 my_error(ER_TRG_DOES_NOT_EXIST, MYF(0));
11403 return NULL;
11404 }
11405
11406 if (load_table_name_for_trigger(thd, trg_name, &trn_path, &tbl_name))
11407 return NULL;
11408
11409 /* We need to reset statement table list to be PS/SP friendly. */
11410 if (!(table= thd->alloc<TABLE_LIST>(1)))
11411 return NULL;
11412
11413 db= thd->make_ident_opt_casedn(trg_name->m_db, lower_case_table_names);
11414
11415 tbl_name.str= thd->strmake(tbl_name.str, tbl_name.length);
11416
11417 if (db.str == NULL || tbl_name.str == NULL)
11418 return NULL;
11419
11420 table->init_one_table(&db, &tbl_name, 0, TL_IGNORE);
11421
11422 return table;
11423}
11424
11425
11426/**

Callers 1

show_create_triggerFunction · 0.85

Calls 7

build_trn_pathFunction · 0.85
check_trn_existsFunction · 0.85
my_errorFunction · 0.85
make_ident_opt_casednMethod · 0.80
strmakeMethod · 0.80
init_one_tableMethod · 0.80

Tested by

no test coverage detected