Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upArithmetic on optionals #842
Comments
killercup
added
the
enhancement
label
Apr 5, 2017
This comment has been minimized.
|
The ISO standard is that any operation on a null value returns null. I'm fine with adding ops for nullable values (preferably as a single blanket impl if possible) |
added a commit
to Eijebong/diesel
that referenced
this issue
Apr 6, 2017
added a commit
to Eijebong/diesel
that referenced
this issue
Apr 7, 2017
sgrif
closed this
in
3e59e91
Apr 20, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dbrgn commentedApr 5, 2017
•
edited
This does not work...
...if
read_countis nullable.According to my tests, Pg, MySQL and SQLite all return null for
SELECT NULL + 1.This page seems to agree: http://www-cs-students.stanford.edu/~wlam/compsci/sqlnulls
I didn't check the SQL ISO standard though.
Note also that aggregation function like
SUM()seem to ignore null values.Maybe addition and other arithmetic operations could be implemented on
Nullable<Integer>and others?