@@ -781,6 +781,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
781
781
MYSQLND_PACKET_ROW * row_packet = result -> unbuf -> row_packet ;
782
782
const MYSQLND_RES_METADATA * const meta = result -> meta ;
783
783
MYSQLND_CONN_DATA * const conn = result -> conn ;
784
+ void * checkpoint ;
784
785
785
786
DBG_ENTER ("mysqlnd_result_unbuffered::fetch_row" );
786
787
@@ -800,6 +801,9 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
800
801
/* Let the row packet fill our buffer and skip additional mnd_malloc + memcpy */
801
802
row_packet -> skip_extraction = row ? FALSE:TRUE;
802
803
804
+ checkpoint = result -> memory_pool -> checkpoint ;
805
+ mysqlnd_mempool_save_state (result -> memory_pool );
806
+
803
807
/*
804
808
If we skip rows (row == NULL) we have to
805
809
result->m.unbuffered_free_last_data() before it. The function returns always true.
@@ -824,6 +828,8 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
824
828
conn -> options -> int_and_float_native ,
825
829
conn -> stats );
826
830
if (PASS != rc ) {
831
+ mysqlnd_mempool_restore_state (result -> memory_pool );
832
+ result -> memory_pool -> checkpoint = checkpoint ;
827
833
DBG_RETURN (FAIL );
828
834
}
829
835
{
@@ -894,6 +900,9 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row)(MYSQLND_RES * result, void
894
900
result -> unbuf -> m .free_last_data (result -> unbuf , conn -> stats );
895
901
}
896
902
903
+ mysqlnd_mempool_restore_state (result -> memory_pool );
904
+ result -> memory_pool -> checkpoint = checkpoint ;
905
+
897
906
DBG_INF_FMT ("ret=%s fetched=%u" , ret == PASS ? "PASS" :"FAIL" , * fetched_anything );
898
907
DBG_RETURN (PASS );
899
908
}
0 commit comments