mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 11:10:58 +08:00
Patch 4/4: Fix TEXT vs. BLOB conversion.
This patch assumes an applied patch 3 (https://sourceforge.net/p/mysql-python/patches/79/). Looks a bit like a hack, but the infrastructure doesn't seem to allow anything else. And it works here very well. I'm not sure, how it works with very old mysql versions (<= 4.0). https://sourceforge.net/p/mysql-python/patches/80/
This commit is contained in:
@ -471,13 +471,17 @@ _mysql_ResultObject_Initialize(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (PyTuple_Check(t) && PyTuple_GET_SIZE(t) == 2) {
|
if (PyTuple_Check(t) && PyTuple_GET_SIZE(t) == 2) {
|
||||||
long mask;
|
long mask, flags;
|
||||||
PyObject *pmask=NULL;
|
PyObject *pmask=NULL;
|
||||||
pmask = PyTuple_GET_ITEM(t, 0);
|
pmask = PyTuple_GET_ITEM(t, 0);
|
||||||
fun2 = PyTuple_GET_ITEM(t, 1);
|
fun2 = PyTuple_GET_ITEM(t, 1);
|
||||||
if (PyInt_Check(pmask)) {
|
if (PyInt_Check(pmask)) {
|
||||||
mask = PyInt_AS_LONG(pmask);
|
mask = PyInt_AS_LONG(pmask);
|
||||||
if (mask & fields[i].flags) {
|
flags = fields[i].flags;
|
||||||
|
if (fields[i].charsetnr != 63) { /* maaagic */
|
||||||
|
flags &= ~BINARY_FLAG;
|
||||||
|
}
|
||||||
|
if (mask & flags) {
|
||||||
Py_DECREF(t);
|
Py_DECREF(t);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user