summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-03-12 11:38:22 +0200
committerunknown <monty@hundin.mysql.fi>2002-03-12 11:38:22 +0200
commit4c221321b624e55238c641b515e24ad1091cdc93 (patch)
treec217663c9f7a4fba0c5a00acb72b3e980954f780 /client
parentc13baf70ec937501389ed6e9f94c98635f1c1b76 (diff)
downloadmariadb-git-4c221321b624e55238c641b515e24ad1091cdc93.tar.gz
Added help for --local-infile
Fix for bug on intel where (int32) 1 << 32 == 1, which gave problems when using 32 keys. Allow SET PASSWORD for anonymous user Docs/manual.texi: Changelog client/mysql.cc: Added help for --local-infile client/mysqlimport.c: Merge with 4.0. Patch for LOCAL INFILE handling configure.in: cleanup include/global.h: Fix for bug on intel where (int32) 1 << 32 == 1 mysql-test/r/create.result: Test of CREATE TABLE with 32 keys mysql-test/t/create.test: Test of CREATE TABLE with 32 keys scripts/mysqlhotcopy.sh: Patch for databasenames with space. sql/ha_isam.cc: Fix for bug on intel where (int32) 1 << 32 == 1 sql/ha_myisam.cc: Fix for bug on intel where (int32) 1 << 32 == 1 sql/ha_myisammrg.cc: Fix for bug on intel where (int32) 1 << 32 == 1 sql/mysqld.cc: Added help for --local-infile sql/sql_acl.cc: Allow SET PASSWORD of anonymous user sql/table.cc: Fix for bug on intel where (int32) 1 << 32 == 1
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc1
-rw-r--r--client/mysqlimport.c21
2 files changed, 13 insertions, 9 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index ab8740dbe3c..22213b8edf5 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -487,6 +487,7 @@ static void usage(int version)
-i, --ignore-space Ignore space after function names.\n\
-h, --host=... Connect to host.\n\
-H, --html Produce HTML output.\n\
+ --local-infile=[1|0] Enable/disable LOAD DATA LOCAL INFILE\n\
-L, --skip-line-numbers\n\
Don't write line number for errors.\n");
#ifndef __WIN__
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index d8f763b9653..d1140c74358 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -1,15 +1,15 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-
+/* Copyright (C) 2000 MySQL AB
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
@@ -25,7 +25,7 @@
** * *
** *************************
*/
-#define IMPORT_VERSION "2.7"
+#define IMPORT_VERSION "2.8"
#include "client_priv.h"
#include "mysql_version.h"
@@ -336,7 +336,7 @@ static int write_to_table(char *filename, MYSQL *sock)
if (ignore)
end= strmov(end, " IGNORE");
end= strmov(strmov(end, " INTO TABLE "), tablename);
-
+
if (fields_terminated || enclosed || opt_enclosed || escaped)
end= strmov(end, " FIELDS");
end= add_load_option(end, fields_terminated, " TERMINATED BY");
@@ -397,10 +397,13 @@ static MYSQL *db_connect(char *host, char *database, char *user, char *passwd)
mysql_init(&mysql_connection);
if (opt_compress)
mysql_options(&mysql_connection,MYSQL_OPT_COMPRESS,NullS);
+ if (opt_local_file)
+ mysql_options(&mysql_connection,MYSQL_OPT_LOCAL_INFILE,
+ (char*) &opt_local_file);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
- opt_ssl_capath);
+ opt_ssl_capath, opt_ssl_cipher);
#endif
if (!(sock= mysql_real_connect(&mysql_connection,host,user,passwd,
database,opt_mysql_port,opt_mysql_unix_port,
@@ -482,7 +485,7 @@ static char *add_load_option(char *ptr, const char *object,
** This is done by doubleing ' and add a end -\ if needed to avoid
** syntax errors from the SQL parser.
*/
-
+
static char *field_escape(char *to,const char *from,uint length)
{
const char *end;
@@ -505,7 +508,7 @@ static char *field_escape(char *to,const char *from,uint length)
*to++= '\\';
return to;
}
-
+
int main(int argc, char **argv)