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
Andy/div by zero #108
Andy/div by zero #108
Conversation
Signed-off-by: Andy Arthur <andy@liquidata.co>
Signed-off-by: Andy Arthur <andy@liquidata.co>
0ef939e
to
8f83ca2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should follow the default mysql 8.0 behavior, which is to evaluate to NULL.
Also please add an engine test.
Signed-off-by: Andy Arthur <andy@liquidata.co>
👌 |
Signed-off-by: Andy Arthur <andy@liquidata.co>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should follow up to make the behavior the same for floats and ints.
[]sql.Row{{sql.Null}}, | ||
}, | ||
{ "SELECT 1.0/0.0 FROM dual", | ||
[]sql.Row{{float64(math.Inf(1))}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be null too. Floats and ints should have the same behavior.
This fixes a panic for
select 1/0 from dual
MySQL also errors on divide by zero in at least some configs
I can change this to return
NULL
if that's preferable.