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

Function load_table_name_for_trigger

sql/sql_trigger.cc:3178–3217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3176*/
3177
3178bool load_table_name_for_trigger(THD *thd,
3179 const sp_name *trg_name,
3180 const LEX_CSTRING *trn_path,
3181 LEX_CSTRING *tbl_name)
3182{
3183 File_parser *parser;
3184 struct st_trigname trn_data;
3185 Handle_old_incorrect_trigger_table_hook trigger_table_hook(
3186 trn_path->str,
3187 &trn_data.trigger_table);
3188 DBUG_ENTER("load_table_name_for_trigger");
3189
3190 /* Parse the TRN-file. */
3191
3192 if (!(parser= sql_parse_prepare(trn_path, thd->mem_root, TRUE)))
3193 DBUG_RETURN(TRUE);
3194
3195 if (!is_equal(&trigname_file_type, parser->type()))
3196 {
3197 my_error(ER_WRONG_OBJECT, MYF(0),
3198 trg_name->m_name.str,
3199 TRN_EXT + 1,
3200 "TRIGGERNAME");
3201
3202 DBUG_RETURN(TRUE);
3203 }
3204
3205 if (parser->parse((uchar*) &trn_data, thd->mem_root,
3206 trigname_file_parameters, 1,
3207 &trigger_table_hook))
3208 DBUG_RETURN(TRUE);
3209
3210 /* Copy trigger table name. */
3211
3212 *tbl_name= trn_data.trigger_table;
3213
3214 /* That's all. */
3215
3216 DBUG_RETURN(FALSE);
3217}

Callers 2

get_trigger_tableFunction · 0.85

Calls 5

sql_parse_prepareFunction · 0.85
is_equalFunction · 0.85
my_errorFunction · 0.85
typeMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected