diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 19 | ||||
-rw-r--r-- | client/mysqltest.c | 6 |
2 files changed, 19 insertions, 6 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index a237561d83d..9b0e85aa41a 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -40,7 +40,7 @@ #include <signal.h> #include <violite.h> -const char *VER= "12.20"; +const char *VER= "12.21"; /* Don't try to make a nice table if the data is too big */ #define MAX_COLUMN_LENGTH 1024 @@ -2613,14 +2613,18 @@ static const char* construct_prompt() add_int_to_prompt(++prompt_counter); break; case 'v': - processed_prompt.append(mysql_get_server_info(&mysql)); + if (connected) + processed_prompt.append(mysql_get_server_info(&mysql)); + else + processed_prompt.append("not_connected"); break; case 'd': processed_prompt.append(current_db ? current_db : "(none)"); break; case 'h': { - const char *prompt=mysql_get_host_info(&mysql); + const char *prompt; + prompt= connected ? mysql_get_host_info(&mysql) : "not_connected"; if (strstr(prompt, "Localhost")) processed_prompt.append("localhost"); else @@ -2631,8 +2635,13 @@ static const char* construct_prompt() break; } case 'p': - if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || - ! mysql.unix_socket) + if (!connected) + { + processed_prompt.append("not_connected"); + break; + } + if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || ! + mysql.unix_socket) add_int_to_prompt(mysql.port); else { diff --git a/client/mysqltest.c b/client/mysqltest.c index 4bc941e8b56..f6c999b18e4 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -515,8 +515,12 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname) if (!my_stat(eval_file, &stat_info, MYF(MY_WME))) die(NullS); - if (!eval_result && stat_info.st_size != ds->length) + if (!eval_result && (uint) stat_info.st_size != ds->length) + { + DBUG_PRINT("info",("Size differs: result size: %u file size: %u", + ds->length, stat_info.st_size)); DBUG_RETURN(2); + } if (!(tmp = (char*) my_malloc(stat_info.st_size + 1, MYF(MY_WME)))) die(NullS); |