Menu

#328 typo in _msql.c

MySQLdb-1.2
open
nobody
None
1
2014-08-19
2012-11-28
No

Hi,

in Version MySQL-python-1.2.4b4 there seems to be a minor typo in _mysql.c which prevents from building correctly.
GCC will complain about:
_mysql.c:602: error: expected expression before ‘)’ token
error: command 'gcc' failed with exit status 1

(I apologize for the ugliness, but neither formatting the stuff below as code nor as preformated text, really gave a nice solution. However I hope one gets the point )

the code around line 602 is this:
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
#ifdef HAVE_MYSQL_OPT_READ_TIMEOUT
"|ssssisOiiisssiOii:connect",
#else
"|ssssisOiiisssiOi:connect",
#endif
kwlist,
&host, &user, &passwd, &db,
&port, &unix_socket, &conv,
&connect_timeout,
&compress, &named_pipe,
&init_command, &read_default_file,
&read_default_group,
&client_flag, &ssl,
&local_infile,
#ifdef HAVE_MYSQL_OPT_READ_TIMEOUT
&read_timeout
#endif
))
return -1;

and obviously, when HAVE_MYSQL_OPT_READ_TIMEOUT is not defined, there will be a trailing comma after &local_infile, inside the braces.
So it should rather be:
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
#ifdef HAVE_MYSQL_OPT_READ_TIMEOUT
"|ssssisOiiisssiOii:connect",
#else
"|ssssisOiiisssiOi:connect",
#endif
kwlist,
&host, &user, &passwd, &db,
&port, &unix_socket, &conv,
&connect_timeout,
&compress, &named_pipe,
&init_command, &read_default_file,
&read_default_group,
&client_flag, &ssl,
&local_infile
#ifdef HAVE_MYSQL_OPT_READ_TIMEOUT
, &read_timeout
#endif
))
return -1;

I apologize, if this bug is already solved in the svn. I am not really a developer and not familiar with all this stuff here. I just was not able to build the tar-ball and thought, maybe there are other users out there, having the same prob. So sorry in case of doubling tickets here....

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.