summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-08-09 16:47:16 +0300
committermonty@hundin.mysql.fi <>2002-08-09 16:47:16 +0300
commitac6e640c4dede507d9d9c8f43836785e4b47ae63 (patch)
tree9e6ce887604db3116c5f936a79eaa6915877323e /client
parent7616da973d744d84d6e5abd9f4d1a8fbd2d74811 (diff)
downloadmariadb-git-ac6e640c4dede507d9d9c8f43836785e4b47ae63.tar.gz
Fix for SSL and new my_getopt
Fix for syntax error bug in SET TRANSACTION ISOLATION
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc11
-rw-r--r--client/mysqladmin.c6
-rw-r--r--client/mysqlcheck.c4
-rw-r--r--client/mysqldump.c4
-rw-r--r--client/mysqlimport.c4
-rw-r--r--client/mysqlshow.c4
6 files changed, 19 insertions, 14 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 460d47c75da..77823b1087f 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -391,13 +391,6 @@ int main(int argc,char *argv[])
sig_handler mysql_end(int sig)
{
mysql_close(&mysql);
-#ifdef HAVE_OPENSSL
- my_free(opt_ssl_key,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_cert,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_ca,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_capath,MYF(MY_ALLOW_ZERO_PTR));
- my_free(opt_ssl_cipher,MYF(MY_ALLOW_ZERO_PTR));
-#endif
#ifdef HAVE_READLINE
if (!status.batch && !quick && !opt_html && !opt_xml)
{
@@ -709,7 +702,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case '?':
usage(0);
exit(0);
-#include "sslopt-case.h"
}
return 0;
}
@@ -2209,6 +2201,9 @@ sql_real_connect(char *host,char *database,char *user,char *password,
if (using_opt_local_infile)
mysql_options(&mysql,MYSQL_OPT_LOCAL_INFILE, (char*) &opt_local_infile);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
diff --git a/client/mysqladmin.c b/client/mysqladmin.c
index d6232a38f64..a62d587f3b1 100644
--- a/client/mysqladmin.c
+++ b/client/mysqladmin.c
@@ -222,7 +222,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
else
option_wait= ~0;
break;
-#include "sslopt-case.h"
case '?':
case 'I': /* Info */
error++;
@@ -275,10 +274,13 @@ int main(int argc,char *argv[])
mysql_options(&mysql,MYSQL_OPT_CONNECT_TIMEOUT, (char*) &tmp);
}
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
-#endif /* HAVE_OPENSSL */
+#endif
if (sql_connect(&mysql, option_wait))
error = 1;
else
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 948f9ca8477..fdc7b5cf4d7 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -246,7 +246,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
verbose++;
break;
case 'V': print_version(); exit(0);
-#include "sslopt-case.h"
}
return 0;
}
@@ -530,6 +529,9 @@ static int dbConnect(char *host, char *user, char *passwd)
if (opt_compress)
mysql_options(&mysql_connection, MYSQL_OPT_COMPRESS, NullS);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 4c1e714682b..6a26f4167f7 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -352,7 +352,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case (int) OPT_TABLES:
opt_databases=0;
break;
-#include "sslopt-case.h"
}
return 0;
}
@@ -458,6 +457,9 @@ static int dbConnect(char *host, char *user,char *passwd)
if (opt_compress)
mysql_options(&mysql_connection,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 1933ea41bcf..e7af106abbb 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -193,7 +193,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case '?':
usage();
exit(0);
-#include "sslopt-case.h"
}
return 0;
}
@@ -348,6 +347,9 @@ static MYSQL *db_connect(char *host, char *database, char *user, char *passwd)
mysql_options(&mysql_connection,MYSQL_OPT_LOCAL_INFILE,
(char*) &opt_local_file);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 81b4d2ab4f7..718716b60be 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -85,6 +85,9 @@ int main(int argc, char **argv)
if (opt_compress)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
@@ -218,7 +221,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_mysql_unix_port=MYSQL_NAMEDPIPE;
#endif
break;
-#include "sslopt-case.h"
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
break;