Commit f587e985 authored by jani@dsl-jkl1657.dial.inet.fi's avatar jani@dsl-jkl1657.dial.inet.fi
Browse files

Fixed a bug in mysql client.

parent 9e9265fd
Loading
Loading
Loading
Loading
+15 −19
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@
#include <signal.h>
#include <violite.h>

const char *VER= "12.8";
const char *VER= "12.9";

/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH	     1024
@@ -617,13 +617,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
      {
	if (opt_outfile)
	  end_tee();
	opt_outfile= 0;
      }
      else
	if (!opt_outfile)
	{
	  strmov(outfile, argument);
	  opt_outfile= 1;
	  init_tee();
	}
      break;
@@ -631,7 +629,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
      printf("WARNING: option depricated; use --disable-tee instead.\n");
      if (opt_outfile)
	end_tee();
      opt_outfile= 0;
      break;
    case OPT_PAGER:
      opt_nopager= 0;
@@ -1510,17 +1507,22 @@ static void end_pager()

static void init_tee()
{
  if (opt_outfile)
    end_tee();
  if (!(OUTFILE= my_fopen(outfile, O_APPEND | O_WRONLY, MYF(MY_WME))))
  {
    opt_outfile= 0;
    init_pager();
    return;
  }
  opt_outfile= 1;
  tee_fprintf(stdout, "Logging to file '%s'\n", outfile);
}

static void end_tee()
{
  my_fclose(OUTFILE, MYF(0));
  opt_outfile= 0;
  return;
}

@@ -1826,7 +1828,7 @@ com_tee(String *buffer, char *line __attribute__((unused)))
  {
    if (!strlen(outfile))
    {
      printf("No previous outfile available, you must give the filename!\n");
      printf("No previous outfile available, you must give a filename!\n");
      opt_outfile= 0;
      return 0;
    }
@@ -1846,12 +1848,7 @@ com_tee(String *buffer, char *line __attribute__((unused)))
    printf("No outfile specified!\n");
    return 0;
  }
  if (!opt_outfile)
  {
  init_tee();
    opt_outfile=1;
  }
  tee_fprintf(stdout, "Logging to file '%s'\n", outfile);
  return 0;
}

@@ -1861,7 +1858,6 @@ com_notee(String *buffer __attribute__((unused)),
{
  if (opt_outfile)
    end_tee();
  opt_outfile=0;
  tee_fprintf(stdout, "Outfile disabled.\n");
  return 0;
}
@@ -2284,11 +2280,11 @@ com_status(String *buffer __attribute__((unused)),
    }
#ifdef HAVE_OPENSSL
    if (mysql.net.vio->ssl_ && SSL_get_cipher(mysql.net.vio->ssl_))
      tee_fprintf(stdout, "SSL cipher in use is %s\n",
      tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n",
		  SSL_get_cipher(mysql.net.vio->ssl_));
    else
#endif /* HAVE_OPENSSL */
      tee_puts("SSL is not in use\n", stdout);
      tee_puts("SSL:\t\t\tNot in use", stdout);
  }
  else
  {