MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / find_message

Function find_message

extra/comp_err.c:679–700  ·  view source on GitHub ↗

Find the message in a particular language SYNOPSIS find_message() err Error to find message for lang Language of message to find no_default Don't return default (English) if does not exit RETURN VALUE Returns the message structure if one is found, or NULL if not. */

Source from the content-addressed store, hash-verified

677 Returns the message structure if one is found, or NULL if not.
678*/
679static struct message *find_message(struct errors *err, const char *lang,
680 my_bool no_default)
681{
682 struct message *tmp, *return_val= 0;
683 uint i, count;
684 DBUG_ENTER("find_message");
685
686 count= (err->msg).elements;
687 for (i= 0; i < count; i++)
688 {
689 tmp= dynamic_element(&err->msg, i, struct message*);
690
691 if (!strcmp(tmp->lang_short_name, lang))
692 DBUG_RETURN(tmp);
693 if (!strcmp(tmp->lang_short_name, default_language))
694 {
695 DBUG_ASSERT(tmp->text[0] != 0);
696 return_val= tmp;
697 }
698 }
699 DBUG_RETURN(no_default ? NULL : return_val);
700}
701
702
703

Callers 3

create_header_filesFunction · 0.85
create_sys_filesFunction · 0.85
parse_input_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected