#293 datatype mismatch in _mysql_ConnectionObject_kill

MySQLdb (285)
Tom Lane

In MySQL-python-1.2.3c1, _mysql_ConnectionObject_kill() contains

unsigned long pid;

if (!PyArg_ParseTuple(args, "i:kill", &pid)) return NULL;

which is wrong and will produce seriously incorrect behavior on any 64-bit big-endian architecture. (It might work by chance on little-endian.)

My inclination is to change to "l:kill" (letter ell). Another possibility is "k" to exactly match the unsigned long variable, but that will fail in pre-2.3 Python,
and doesn't really seem to offer much that "l" wouldn't. Or you could change the variable to int, but unsigned long matches mysql_kill so it's probably
best to leave the variable alone and fix the format spec.

Originally reported at https://bugzilla.redhat.com/show_bug.cgi?id=538234


  • Kyle VanderBeek

    Kyle VanderBeek - 2009-12-07

    We only support python >= 2.3, so I'll fix this with "k" shortly. Ignoring signedness and using "l" would just leave a different type of odd behavior to crop up later.

  • Kyle VanderBeek

    Kyle VanderBeek - 2009-12-08

    Change committed to both 1.2br and trunk.

  • Kyle VanderBeek

    Kyle VanderBeek - 2010-06-17

    Fix is in 1.2.3, released.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks