Set from a string in 'user@host' format. This method resembles parse_user(), but does not need temporary buffers. */
| 8985 | but does not need temporary buffers. |
| 8986 | */ |
| 8987 | void AUTHID::parse(const char *str, size_t length) |
| 8988 | { |
| 8989 | const char *p= strrchr(str, '@'); |
| 8990 | if (!p) |
| 8991 | { |
| 8992 | user.str= str; |
| 8993 | user.length= length; |
| 8994 | host= null_clex_str; |
| 8995 | } |
| 8996 | else |
| 8997 | { |
| 8998 | user.str= str; |
| 8999 | user.length= (size_t) (p - str); |
| 9000 | host.str= p + 1; |
| 9001 | host.length= (size_t) (length - user.length - 1); |
| 9002 | if (user.length && !host.length) |
| 9003 | host= host_not_specified; // 'user@' -> 'user@%' |
| 9004 | } |
| 9005 | if (user.length > USERNAME_LENGTH) |
| 9006 | user.length= USERNAME_LENGTH; |
| 9007 | if (host.length > HOSTNAME_LENGTH) |
| 9008 | host.length= HOSTNAME_LENGTH; |
| 9009 | } |
| 9010 | |
| 9011 | |
| 9012 | bool Database_qualified_name::copy_sp_name_internal(MEM_ROOT *mem_root, |
no outgoing calls
no test coverage detected