@@ -851,6 +851,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
851
851
MYSQLND_PACKET_ROW * row_packet ;
852
852
MYSQLND_CONN_DATA * conn = result -> conn ;
853
853
const MYSQLND_RES_METADATA * const meta = result -> meta ;
854
+ void * checkpoint ;
854
855
855
856
DBG_ENTER ("mysqlnd_stmt_fetch_row_unbuffered" );
856
857
@@ -873,6 +874,9 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
873
874
/* Let the row packet fill our buffer and skip additional malloc + memcpy */
874
875
row_packet -> skip_extraction = stmt && stmt -> result_bind ? FALSE:TRUE;
875
876
877
+ checkpoint = result -> memory_pool -> checkpoint ;
878
+ mysqlnd_mempool_save_state (result -> memory_pool );
879
+
876
880
/*
877
881
If we skip rows (stmt == NULL || stmt->result_bind == NULL) we have to
878
882
result->unbuf->m.free_last_data() before it. The function returns always true.
@@ -895,6 +899,8 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
895
899
conn -> options -> int_and_float_native ,
896
900
conn -> stats ))
897
901
{
902
+ mysqlnd_mempool_restore_state (result -> memory_pool );
903
+ result -> memory_pool -> checkpoint = checkpoint ;
898
904
DBG_RETURN (FAIL );
899
905
}
900
906
@@ -965,6 +971,9 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES * result, void * param, const unsi
965
971
}
966
972
}
967
973
974
+ mysqlnd_mempool_restore_state (result -> memory_pool );
975
+ result -> memory_pool -> checkpoint = checkpoint ;
976
+
968
977
DBG_INF_FMT ("ret=%s fetched_anything=%u" , ret == PASS ? "PASS" :"FAIL" , * fetched_anything );
969
978
DBG_RETURN (ret );
970
979
}
0 commit comments