@@ -651,6 +651,7 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
651
651
MYSQLND_PACKET_ROW * row_packet = result -> unbuf -> row_packet ;
652
652
MYSQLND_RES_METADATA * const meta = result -> meta ;
653
653
MYSQLND_CONN_DATA * const conn = result -> conn ;
654
+ void * checkpoint ;
654
655
655
656
DBG_ENTER ("mysqlnd_result_unbuffered::fetch_row_c" );
656
657
@@ -670,6 +671,9 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
670
671
/* Let the row packet fill our buffer and skip additional mnd_malloc + memcpy */
671
672
row_packet -> skip_extraction = FALSE;
672
673
674
+ checkpoint = result -> memory_pool -> checkpoint ;
675
+ mysqlnd_mempool_save_state (result -> memory_pool );
676
+
673
677
/*
674
678
If we skip rows (row == NULL) we have to
675
679
result->m.unbuffered_free_last_data() before it. The function returns always true.
@@ -694,6 +698,8 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
694
698
conn -> options -> int_and_float_native ,
695
699
conn -> stats );
696
700
if (PASS != rc ) {
701
+ mysqlnd_mempool_restore_state (result -> memory_pool );
702
+ result -> memory_pool -> checkpoint = checkpoint ;
697
703
DBG_RETURN (FAIL );
698
704
}
699
705
{
@@ -757,6 +763,9 @@ MYSQLND_METHOD(mysqlnd_result_unbuffered, fetch_row_c)(MYSQLND_RES * result, voi
757
763
result -> unbuf -> m .free_last_data (result -> unbuf , conn -> stats );
758
764
}
759
765
766
+ mysqlnd_mempool_restore_state (result -> memory_pool );
767
+ result -> memory_pool -> checkpoint = checkpoint ;
768
+
760
769
DBG_INF_FMT ("ret=%s fetched=%u" , ret == PASS ? "PASS" :"FAIL" , * fetched_anything );
761
770
DBG_RETURN (PASS );
762
771
}
0 commit comments