-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid div by zero error when vectorization (#793)
* feat: avoid div by zero error when vectorization Signed-off-by: Jinser <cmdr.jv@gmail.com> * test: add nullable_operator to test div0 error Signed-off-by: Jinser <cmdr.jv@gmail.com> * fix: keep auto-vectorize when execute binary ops Signed-off-by: Jinser <cmdr.jv@gmail.com> * fix(planner): NULL when `eval_constant` div zero Signed-off-by: Jinser <cmdr.jv@gmail.com> * fix: safer (and correcter) `safen_dividend` Signed-off-by: Jinser <cmdr.jv@gmail.com> * test: add `x / 0` query Signed-off-by: Jinser <cmdr.jv@gmail.com> * fix clippy Signed-off-by: Jinser <cmdr.jv@gmail.com> --------- Signed-off-by: Jinser <cmdr.jv@gmail.com>
- Loading branch information
Showing
2 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
statement ok | ||
create table t(x int, y int) | ||
|
||
statement ok | ||
insert into t values (1, 2), (2, NULL) | ||
|
||
query I | ||
select x / y from t | ||
---- | ||
0 | ||
NULL | ||
|
||
query I | ||
select x / 0 from t | ||
---- | ||
NULL | ||
NULL | ||
|
||
statement ok | ||
drop table t |