summaryrefslogtreecommitdiff
path: root/client/mysql.cc
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-09-22 01:46:26 +0300
committerunknown <monty@donna.mysql.com>2000-09-22 01:46:26 +0300
commit5f12486229fb578f2e170238ab2cdd7c9bf42a82 (patch)
tree578e79cb989b0a5458b2f7b7cd27600813a79432 /client/mysql.cc
parent5e955288bc695e2f7a92c5549c7753309b41bed7 (diff)
downloadmariadb-git-5f12486229fb578f2e170238ab2cdd7c9bf42a82.tar.gz
Fixes for MyISAM and packed keys + AIX
Docs/manual.texi: Updated changelog client/mysql.cc: Free all memory, even if we can't connect to the server include/config-win.h: Ensure that we don't use SAFE_MUTEX on windows include/my_pthread.h: Optimze struct for Ia64 include/myisam.h: Hack for debugging BIG tables myisam/mi_check.c: Hack for debugging BIG tables myisam/mi_search.c: Fixed bug in packed keys myisam/myisamchk.c: Hack for debugging BIG tables mysys/thr_mutex.c: Make safe_mutex safe for windows scripts/safe_mysqld.sh: Fix nice test and echo output sql/share/Makefile.am: Fix character sets sql/sql_string.cc: Fixes for AIX (which can't handle that the length argument is 0)
Diffstat (limited to 'client/mysql.cc')
-rw-r--r--client/mysql.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 71d9310785d..292a273594a 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -254,13 +254,9 @@ int main(int argc,char *argv[])
if (sql_connect(current_host,current_db,current_user,opt_password,
opt_silent))
{
- if (connected)
- mysql_close(&mysql);
- glob_buffer.free();
- old_buffer.free();
- batch_readline_end(status.line_buff);
- my_end(0);
- exit(1);
+ quick=1; // Avoid history
+ status.exit_status=1;
+ mysql_end(-1);
}
if (!status.batch)
ignore_errors=1; // Don't abort monitor
@@ -324,7 +320,8 @@ sig_handler mysql_end(int sig)
batch_readline_end(status.line_buff);
completion_hash_free(&ht);
#endif
- put_info(sig ? "Aborted" : "Bye", INFO_RESULT);
+ if (sig >= 0)
+ put_info(sig ? "Aborted" : "Bye", INFO_RESULT);
glob_buffer.free();
old_buffer.free();
my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR));
@@ -402,7 +399,7 @@ CHANGEABLE_VAR changeable_vars[] = {
static void usage(int version)
{
- printf("%s Ver 10.11 Distrib %s, for %s (%s)\n",
+ printf("%s Ver 10.12 Distrib %s, for %s (%s)\n",
my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
if (version)
return;
@@ -603,7 +600,7 @@ static int get_options(int argc, char **argv)
break;
case 'W':
#ifdef __WIN__
- opt_mysql_unix_port=MYSQL_NAMEDPIPE;
+ opt_mysql_unix_port=my_strdup(MYSQL_NAMEDPIPE,MYF(0));
#endif
break;
case 'V': usage(1); exit(0);
@@ -1013,7 +1010,7 @@ static void build_completion_hash(bool skip_rehash,bool write_info)
int i,j,num_fields;
DBUG_ENTER("build_completion_hash");
- if (status.batch || quick)
+ if (status.batch || quick || !current_db)
DBUG_VOID_RETURN; // We don't need completion in batches
completion_hash_clean(&ht);