Repository navigation
Commit b43bddd
fix(cypher): classify aggregation columns by is_aggregate_func, not a bare func check
RETURN/WITH aggregation classified each projected column with a bare
`if (item->func)` check to decide group-key vs. aggregate value. That
check is true for any function call, so type()/labels()/id()/keys()/
properties() were routed into the aggregate branch alongside real
aggregates and formatted via format_agg_value's default case, which
emits the row count instead of the function's actual value.
Swap the five call sites (ret_agg_build_key, ret_agg_emit_row,
with_agg_build_key, with_agg_find_or_create, with_agg_accumulate) to
is_aggregate_func(), the predicate already used correctly one level up
to decide whether a query needs aggregation at all. Group-key columns
carrying a non-aggregate function now project through the existing
project_item() helper instead of binding_get_virtual(), since they
need to evaluate the function rather than read a raw property.
Fixes DeusData#1111 (the type(r)/count(*) half; the inline-property-map half
of that issue does not reproduce on current HEAD)
Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>1 parent 8f06867 commit b43bddd
2 files changed
Lines changed: 55 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3731 | 3731 | | |
3732 | 3732 | | |
3733 | 3733 | | |
3734 | | - | |
| 3734 | + | |
3735 | 3735 | | |
3736 | 3736 | | |
3737 | | - | |
| 3737 | + | |
| 3738 | + | |
3738 | 3739 | | |
3739 | 3740 | | |
3740 | 3741 | | |
| |||
3770 | 3771 | | |
3771 | 3772 | | |
3772 | 3773 | | |
3773 | | - | |
| 3774 | + | |
3774 | 3775 | | |
3775 | 3776 | | |
3776 | 3777 | | |
3777 | | - | |
| 3778 | + | |
| 3779 | + | |
3778 | 3780 | | |
3779 | 3781 | | |
3780 | 3782 | | |
| |||
3792 | 3794 | | |
3793 | 3795 | | |
3794 | 3796 | | |
3795 | | - | |
| 3797 | + | |
3796 | 3798 | | |
3797 | 3799 | | |
3798 | 3800 | | |
| |||
3887 | 3889 | | |
3888 | 3890 | | |
3889 | 3891 | | |
3890 | | - | |
| 3892 | + | |
3891 | 3893 | | |
3892 | 3894 | | |
3893 | 3895 | | |
| |||
4186 | 4188 | | |
4187 | 4189 | | |
4188 | 4190 | | |
4189 | | - | |
| 4191 | + | |
4190 | 4192 | | |
4191 | 4193 | | |
4192 | 4194 | | |
| |||
4238 | 4240 | | |
4239 | 4241 | | |
4240 | 4242 | | |
4241 | | - | |
| 4243 | + | |
4242 | 4244 | | |
4243 | 4245 | | |
4244 | 4246 | | |
| |||
4262 | 4264 | | |
4263 | 4265 | | |
4264 | 4266 | | |
4265 | | - | |
| 4267 | + | |
4266 | 4268 | | |
4267 | 4269 | | |
4268 | 4270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2523 | 2523 | | |
2524 | 2524 | | |
2525 | 2525 | | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
2526 | 2548 | | |
2527 | 2549 | | |
2528 | 2550 | | |
| |||
2707 | 2729 | | |
2708 | 2730 | | |
2709 | 2731 | | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
| 2750 | + | |
| 2751 | + | |
2710 | 2752 | | |
2711 | 2753 | | |
2712 | 2754 | | |
| |||
3402 | 3444 | | |
3403 | 3445 | | |
3404 | 3446 | | |
| 3447 | + | |
3405 | 3448 | | |
3406 | 3449 | | |
3407 | 3450 | | |
| |||
3415 | 3458 | | |
3416 | 3459 | | |
3417 | 3460 | | |
| 3461 | + | |
3418 | 3462 | | |
3419 | 3463 | | |
3420 | 3464 | | |
| |||
0 commit comments