mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
Bug #17485: mysql client crashes when connecting to the Instance Manager
Using \U or \u in a prompt with the mysql command-line client could crash when connecting to the instance manager, since it does not return information about the user when asked by the client. This is fixed by having the client use what it knowns about the user (or giving up and saying "(unknown)"). client/mysql.cc: init_username() may not retrieve a username (such as from the instance manager), in which case we fall back to what was specified on the command line (or .cnf file) or finally (unknown).
This commit is contained in:
parent
66fc547d1b
commit
ff8f68d2d5
1 changed files with 4 additions and 2 deletions
|
@ -3623,12 +3623,14 @@ static const char* construct_prompt()
|
|||
case 'U':
|
||||
if (!full_username)
|
||||
init_username();
|
||||
processed_prompt.append(full_username);
|
||||
processed_prompt.append(full_username ? full_username :
|
||||
(current_user ? current_user : "(unknown)"));
|
||||
break;
|
||||
case 'u':
|
||||
if (!full_username)
|
||||
init_username();
|
||||
processed_prompt.append(part_username);
|
||||
processed_prompt.append(part_username ? part_username :
|
||||
(current_user ? current_user : "(unknown)"));
|
||||
break;
|
||||
case PROMPT_CHAR:
|
||||
processed_prompt.append(PROMPT_CHAR);
|
||||
|
|
Loading…
Reference in a new issue