You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using aggregate views of mean() with GROUP BY, sometimes results in: Error: There was a problem with the database: Cannot perform division with '0' and '0'
This seems to have been introduced in 1.4.0
Steps to reproduce
REMOVE TABLE happy;
REMOVE TABLE happy_aggr;
REMOVE TABLE happy_sums;
REMOVE TABLE happy_aggr2;
DEFINE TABLE happy_aggr AS select math::mean(val) as val, year, month, day FROM happy GROUP BY year, month, day;
DEFINE TABLE happy_sums AS select math::sum(val) as val, year, month, day FROM happy_aggr GROUP BY year, month, day;
DEFINE TABLE happy_sums AS select math::mean(val) as val, year, month, day FROM happy_sums GROUP BY year, month, day;
CREATE happy:10 SET year=2024, month=1, day=NONE, val=23;
CREATE happy:11 SET year=2024, month=1, day=NONE, val=23;
CREATE happy:12 SET year=2024, month=1, day=NONE, val=231231;
Expected behaviour
There is no division by zero in mean or sum, so there should be no division by zero error.
SurrealDB version
v1.4.0
Contact Details
No response
Is there an existing issue for this?
I have searched the existing issues
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Hopefully this is just a simple check in the functions for empty sets. Otherwise I think the error for the other statements would be caused by the average statement triggering it.
Describe the bug
Using aggregate views of mean() with GROUP BY, sometimes results in:
Error: There was a problem with the database: Cannot perform division with '0' and '0'
This seems to have been introduced in 1.4.0
Steps to reproduce
Expected behaviour
There is no division by zero in mean or sum, so there should be no division by zero error.
SurrealDB version
v1.4.0
Contact Details
No response
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: