File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1484,6 +1484,26 @@ _mysql_ResultObject_fetch_row(
1484
1484
return NULL ;
1485
1485
}
1486
1486
1487
+ static const char _mysql_ResultObject_discard__doc__ [] =
1488
+ "discard() -- Discard remaining rows in the resultset." ;
1489
+
1490
+ static PyObject *
1491
+ _mysql_ResultObject_discard (
1492
+ _mysql_ResultObject * self ,
1493
+ PyObject * noargs )
1494
+ {
1495
+ check_result_connection (self );
1496
+
1497
+ MYSQL_ROW row ;
1498
+ while (NULL != (row = mysql_fetch_row (self -> result ))) {
1499
+ // do nothing
1500
+ }
1501
+ if (mysql_errno (self -> conn )) {
1502
+ return _mysql_Exception (self -> conn );
1503
+ }
1504
+ Py_RETURN_NONE ;
1505
+ }
1506
+
1487
1507
static char _mysql_ConnectionObject_change_user__doc__ [] =
1488
1508
"Changes the user and causes the database specified by db to\n\
1489
1509
become the default (current) database on the connection\n\
@@ -2473,6 +2493,12 @@ static PyMethodDef _mysql_ResultObject_methods[] = {
2473
2493
METH_VARARGS | METH_KEYWORDS ,
2474
2494
_mysql_ResultObject_fetch_row__doc__
2475
2495
},
2496
+ {
2497
+ "discard" ,
2498
+ (PyCFunction )_mysql_ResultObject_discard ,
2499
+ METH_NOARGS ,
2500
+ _mysql_ResultObject_discard__doc__
2501
+ },
2476
2502
{
2477
2503
"field_flags" ,
2478
2504
(PyCFunction )_mysql_ResultObject_field_flags ,
You can’t perform that action at this time.
0 commit comments