Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ac1fb2d

Browse filesBrowse files
committed
mysql_affected_rows may return -1
1 parent 42c2b22 commit ac1fb2d
Copy full SHA for ac1fb2d

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎_mysql.c

Copy file name to clipboardExpand all lines: _mysql.c
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,9 +827,13 @@ _mysql_ConnectionObject_affected_rows(
827827
_mysql_ConnectionObject *self,
828828
PyObject *args)
829829
{
830+
my_ulonglong ret;
830831
if (!PyArg_ParseTuple(args, "")) return NULL;
831832
check_connection(self);
832-
return PyLong_FromUnsignedLongLong(mysql_affected_rows(&(self->connection)));
833+
ret = mysql_affected_rows(&(self->connection));
834+
if (ret == (my_ulonglong)-1)
835+
return PyInt_FromLong(-1);
836+
return PyLong_FromUnsignedLongLong(ret);
833837
}
834838

835839
static char _mysql_debug__doc__[] =

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.