@@ -797,6 +797,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
797
797
MYSQLND_PACKET_ROW * row_packet ;
798
798
MYSQLND_CONN_DATA * conn = result -> conn ;
799
799
const MYSQLND_RES_METADATA * const meta = result -> meta ;
800
+ void * checkpoint ;
800
801
801
802
DBG_ENTER ("mysqlnd_stmt_fetch_row_unbuffered" );
802
803
@@ -819,6 +820,9 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
819
820
/* Let the row packet fill our buffer and skip additional malloc + memcpy */
820
821
row_packet -> skip_extraction = stmt && stmt -> result_bind ? FALSE:TRUE;
821
822
823
+ checkpoint = result -> memory_pool -> checkpoint ;
824
+ mysqlnd_mempool_save_state (result -> memory_pool );
825
+
822
826
/*
823
827
If we skip rows (stmt == NULL || stmt->result_bind == NULL) we have to
824
828
result->unbuf->m.free_last_data() before it. The function returns always true.
@@ -841,6 +845,8 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
841
845
conn -> options -> int_and_float_native ,
842
846
conn -> stats ))
843
847
{
848
+ mysqlnd_mempool_restore_state (result -> memory_pool );
849
+ result -> memory_pool -> checkpoint = checkpoint ;
844
850
DBG_RETURN (FAIL );
845
851
}
846
852
@@ -900,6 +906,9 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
900
906
}
901
907
}
902
908
909
+ mysqlnd_mempool_restore_state (result -> memory_pool );
910
+ result -> memory_pool -> checkpoint = checkpoint ;
911
+
903
912
DBG_INF_FMT ("ret=%s fetched_anything=%u" , ret == PASS ? "PASS" :"FAIL" , * fetched_anything );
904
913
DBG_RETURN (ret );
905
914
}
0 commit comments