add load_infile option and more doc cleanups

This commit is contained in:
adustman
2005-01-23 04:49:04 +00:00
parent ebd7a3e62a
commit 1867e3accb
2 changed files with 23 additions and 5 deletions

View File

@ -440,9 +440,10 @@ _mysql_ConnectionObject_Initialize(
"named_pipe", "init_command",
"read_default_file", "read_default_group",
"client_flag", "ssl",
"local_infile",
NULL } ;
int connect_timeout = 0;
int compress = -1, named_pipe = -1;
int compress = -1, named_pipe = -1, local_infile = -1;
char *init_command=NULL,
*read_default_file=NULL,
*read_default_group=NULL;
@ -450,7 +451,7 @@ _mysql_ConnectionObject_Initialize(
self->converter = NULL;
self->open = 0;
check_server_init(-1);
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ssssisOiiisssiO:connect",
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ssssisOiiisssiOi:connect",
kwlist,
&host, &user, &passwd, &db,
&port, &unix_socket, &conv,
@ -458,7 +459,9 @@ _mysql_ConnectionObject_Initialize(
&compress, &named_pipe,
&init_command, &read_default_file,
&read_default_group,
&client_flag, &ssl))
&client_flag, &ssl,
&local_infile
))
return -1;
if (!conv)
@ -510,6 +513,9 @@ _mysql_ConnectionObject_Initialize(
if (read_default_group != NULL)
mysql_options(&(self->connection), MYSQL_READ_DEFAULT_GROUP, read_default_group);
if (local_infile != -1)
mysql_options(&(self->connection), MYSQL_OPT_LOCAL_INFILE, (char *) &local_infile);
#if HAVE_OPENSSL
if (ssl)
mysql_ssl_set(&(self->connection),
@ -580,6 +586,13 @@ read_default_file\n\
\n\
read_default_group\n\
see the MySQL documentation for mysql_options()\n\
\n\
client_flag\n\
client flags from MySQLdb.constants.CLIENT\n\
\n\
load_infile\n\
int, non-zero enables LOAD LOCAL INFILE, zero disables\n\
\n\
";
static PyObject *