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

Function check_host_name

sql/sql_parse.cc:2399–2418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2397*/
2398
2399bool check_host_name(LEX_STRING *str)
2400{
2401 const char *name= str->str;
2402 const char *end= str->str + str->length;
2403 if (check_string_byte_length(str, ER(ER_HOSTNAME), HOSTNAME_LENGTH))
2404 return TRUE;
2405
2406 while (name != end)
2407 {
2408 if (*name == '@')
2409 {
2410 my_printf_error(ER_UNKNOWN_ERROR,
2411 "Malformed hostname (illegal symbol: '%c')", MYF(0),
2412 *name);
2413 return TRUE;
2414 }
2415 name++;
2416 }
2417 return FALSE;
2418}
2419
2420
2421extern int MYSQLparse(class THD *thd); // from sql_yacc.cc

Callers

nothing calls this directly

Calls 2

check_string_byte_lengthFunction · 0.85
my_printf_errorFunction · 0.85

Tested by

no test coverage detected