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

fix crash on x % 0` #1799

Merged
merged 1 commit into from
Jul 24, 2015
Merged

fix crash on x % 0` #1799

merged 1 commit into from
Jul 24, 2015

Conversation

tbg
Copy link
Member

@tbg tbg commented Jul 24, 2015

found via go-fuzz

ping @dvyukov for your trophy list.

@tbg tbg added the PTAL label Jul 24, 2015
@dvyukov
Copy link

dvyukov commented Jul 24, 2015

added to trophy list

@@ -231,6 +232,10 @@ var binOps = map[binArgs]func(Datum, Datum) (Datum, error){
},

binArgs{Mod, intType, intType}: func(left Datum, right Datum) (Datum, error) {
r := right.(DInt)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no need for this local

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, meant to use it below instead of right.(DInt). Will fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tamird
Copy link
Contributor

tamird commented Jul 24, 2015

LGTM

1 % 0 now returns an error (as does Postgres 9.3; MySQL goes for NULL)

found via go-fuzz
@petermattis
Copy link
Collaborator

LGTM

See #1622.

tbg added a commit that referenced this pull request Jul 24, 2015
@tbg tbg merged commit 6734f42 into cockroachdb:master Jul 24, 2015
@tbg tbg removed the PTAL label Jul 24, 2015
@tbg tbg deleted the mod_zero branch July 24, 2015 17:44
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.

None yet

4 participants