File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
* Fixed missing GC registration of init values in aggregate functions.
4
4
5
+ * Fixed call to final aggregate function when no step function was called.
6
+
5
7
* Fixed incorrect required minimum OCaml version (now 4.12).
6
8
7
9
Original file line number Diff line number Diff line change @@ -1457,9 +1457,14 @@ static void caml_sqlite3_user_function_##NAME(sqlite3_context *ctx) \
1457
1457
agg_ctx *agg_ctx = sqlite3_aggregate_context(ctx, sizeof(agg_ctx)); \
1458
1458
value v_res; \
1459
1459
caml_leave_blocking_section(); \
1460
- v_res = caml_callback_exn(GET_FUN, agg_ctx->v_acc); \
1461
- set_sqlite3_result(ctx, v_res); \
1462
- REMOVE_ROOT; \
1460
+ if (!agg_ctx->initialized) { \
1461
+ v_res = caml_callback_exn(GET_FUN, Field(data->v_fun, 1)); \
1462
+ set_sqlite3_result(ctx, v_res); \
1463
+ } else { \
1464
+ v_res = caml_callback_exn(GET_FUN, agg_ctx->v_acc); \
1465
+ set_sqlite3_result(ctx, v_res); \
1466
+ REMOVE_ROOT; \
1467
+ } \
1463
1468
caml_enter_blocking_section(); \
1464
1469
}
1465
1470
You can’t perform that action at this time.
0 commit comments