Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Fix aggregate method sum() to always return numeric #15345

Merged
merged 1 commit into from
Sep 8, 2016
Merged

[5.3] Fix aggregate method sum() to always return numeric #15345

merged 1 commit into from
Sep 8, 2016

Conversation

themsaid
Copy link
Member

@themsaid themsaid commented Sep 8, 2016

Changed here: #14793
Reverted here: #14994

However while reverting the sum() method didn't actually get back to the original form, in the current state it may return null in case there are no records.

This PR insures the return value is always numeric.

@taylorotwell taylorotwell merged commit 17e3367 into laravel:5.3 Sep 8, 2016
@arrilot
Copy link
Contributor

arrilot commented Sep 8, 2016

@themsaid What if aggregate returns a negative number? Isn't is_null what we need here?

@themsaid themsaid deleted the buildersum branch September 8, 2016 18:11
@themsaid
Copy link
Member Author

themsaid commented Sep 8, 2016

What's wrong about a negative number?

@arrilot
Copy link
Contributor

arrilot commented Sep 8, 2016

Ah, my bad, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants