summaryrefslogtreecommitdiff
path: root/client/mysql.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/mysql.cc')
-rw-r--r--client/mysql.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index d0300344ba4..11bf5640020 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -692,6 +692,10 @@ static int get_options(int argc, char **argv)
skip_column_names=1;
break;
case 'P':
+ if(!current_host) {
+ my_free(current_host, MYF(MY_ALLOW_ZERO_PTR));
+ current_host=my_strdup("127.0.0.1", MYF(MY_WME));
+ };
opt_mysql_port= (unsigned int) atoi(optarg);
break;
case 'S':