mirror of
https://github.com/MariaDB/server.git
synced 2025-07-10 04:22:00 +03:00
Merging with 5.1-5.1.29-rc
This commit is contained in:
@ -7507,6 +7507,39 @@ int test_if_data_home_dir(const char *dir)
|
||||
C_MODE_END
|
||||
|
||||
|
||||
/**
|
||||
Check that host name string is valid.
|
||||
|
||||
@param[in] str string to be checked
|
||||
|
||||
@return Operation status
|
||||
@retval FALSE host name is ok
|
||||
@retval TRUE host name string is longer than max_length or
|
||||
has invalid symbols
|
||||
*/
|
||||
|
||||
bool check_host_name(LEX_STRING *str)
|
||||
{
|
||||
const char *name= str->str;
|
||||
const char *end= str->str + str->length;
|
||||
if (check_string_byte_length(str, ER(ER_HOSTNAME), HOSTNAME_LENGTH))
|
||||
return TRUE;
|
||||
|
||||
while (name != end)
|
||||
{
|
||||
if (*name == '@')
|
||||
{
|
||||
my_printf_error(ER_UNKNOWN_ERROR,
|
||||
"Malformed hostname (illegal symbol: '%c')", MYF(0),
|
||||
*name);
|
||||
return TRUE;
|
||||
}
|
||||
name++;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
extern int MYSQLparse(void *thd); // from sql_yacc.cc
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user