Skip to content
Permalink
Browse files

MDEV-17609 mysql client sets wrong application name for Readline library

initialize_readline() is called with full pathname of executable which
sets rl_readline_name to that value.

It is expected that rl_readline_name is initialized with static name
not depending on the file name at all. Needed for setting custom
hotkeys in .inputrc
  • Loading branch information...
midenok committed Nov 3, 2018
1 parent 22914ec commit 98b24da03808d562bf37e0ae00ba2c6e0c5cc5c3
Showing with 5 additions and 4 deletions.
  1. +5 −4 client/mysql.cc
@@ -1060,7 +1060,7 @@ extern "C" int write_history(const char *command);
extern "C" HIST_ENTRY *history_get(int num);
extern "C" int history_length;
static int not_in_history(const char *line);
static void initialize_readline (char *name);
static void initialize_readline ();
static void fix_history(String *final_command);
#endif

@@ -1241,7 +1241,7 @@ int main(int argc,char *argv[])
}

#ifdef HAVE_READLINE
initialize_readline((char*) my_progname);
initialize_readline();
if (!status.batch && !quick && !opt_html && !opt_xml)
{
/* read-history from file, default ~/.mysql_history*/
@@ -2668,10 +2668,11 @@ static int fake_magic_space(const char *, int)
}


static void initialize_readline (char *name)
static void initialize_readline ()
{
/* Allow conditional parsing of the ~/.inputrc file. */
rl_readline_name = name;
rl_readline_name= "mysql";
rl_terminal_name= getenv("TERM");

/* Tell the completer that we want a crack first. */
#if defined(USE_NEW_READLINE_INTERFACE)

0 comments on commit 98b24da

Please sign in to comment.
You can’t perform that action at this time.