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

sqlsmith bug hunt: Panics on temporal types expressions #3341

Closed
Tracked by #2571
neverchanje opened this issue Jun 20, 2022 · 7 comments · Fixed by #3737
Closed
Tracked by #2571

sqlsmith bug hunt: Panics on temporal types expressions #3341

neverchanje opened this issue Jun 20, 2022 · 7 comments · Fixed by #3737
Labels
good first issue Good for newcomers help wanted Issues that need help from contributors type/bug Something isn't working

Comments

@neverchanje
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

The compute node crashed on an unsupported expr.

hread 'tokio-runtime-worker' panicked at 'not implemented: The expression (Interval, Int32, Interval) using vectorized expression framework is not supported yet!', src/expr/src/expr/expr_binary_nonnull.rs:399:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/bb8c2f41174caceec00c28bc6c5c20ae9f9a175c/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/bb8c2f41174caceec00c28bc6c5c20ae9f9a175c/library/core/src/panicking.rs:142:14
   2: risingwave_expr::expr::expr_binary_nonnull::new_binary_expr
             at ./src/expr/src/expr/expr_binary_nonnull.rs:399:13
   3: risingwave_expr::expr::build_expr_from_prost::build_binary_expr_prost
             at ./src/expr/src/expr/build_expr_from_prost.rs:55:8
   4: risingwave_expr::expr::build_from_prost
             at ./src/expr/src/expr/mod.rs:89:23
   5: risingwave_expr::expr::build_expr_from_prost::build_binary_expr_prost
             at ./src/expr/src/expr/build_expr_from_prost.rs:54:22

To Reproduce
Steps to reproduce the behavior.

SELECT (REAL '28.105270471745335' + (SMALLINT '14' * SMALLINT '32')) * (INT '27' * SMALLINT '80') AS col_0, 'LZQwi2kZYv' AS col_1 FROM supplier AS t0, customer AS t1, supplier AS t2, customer AS t3, orders AS t4 WHERE INTERVAL '530856' <= (INTERVAL '849884' / INT '86')

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

@neverchanje neverchanje added type/bug Something isn't working help wanted Issues that need help from contributors labels Jun 20, 2022
@TennyZhuang TennyZhuang added the good first issue Good for newcomers label Jun 20, 2022
@xxchan
Copy link
Member

xxchan commented Jun 20, 2022

minimal reproduceble:
SELECT (INTERVAL '849884' / INT '86')

@xxchan
Copy link
Member

xxchan commented Jun 20, 2022

A similar one from #3342

select TIME '07:42:50' - INTERVAL '595191';

thread 'tokio-runtime-worker' panicked at 'not implemented: The expression (Time, Interval, Time) using vectorized expression framework is not supported yet!', src/expr/src/expr/expr_binary_nonnull.rs:370:13

@Graphcalibur
Copy link
Contributor

Related: #924

@neverchanje
Copy link
Contributor Author

neverchanje commented Jun 26, 2022

Until now Ive found several panic points related to temporal types, including:

  • SELECT (INTERVAL '849884' * REAL '86');
  • SELECT (INT '32' + DATE '2022-06-17')
  • SELECT (DATE '2022-06-17' + INT '32')
  • SELECT (DATE '2022-06-17' - INT '32')
  • SELECT (TIME '18:30:38' - INTERVAL '1')
  • SELECT (TIME '18:30:38' + INTERVAL '1')

@neverchanje neverchanje changed the title sqlsmith bug hunt: (Interval, Int32, Interval) using vectorized expression framework is not supported yet! sqlsmith bug hunt: Panics on temporal types expressions Jun 26, 2022
@xiangjinwu
Copy link
Contributor

Still missing implementation (#924):

  • interval * float
  • float * interval
  • interval + time
  • interval + timestamp with time zone
  • timestamp with time zone + interval
  • timestamp with time zone - interval
  • timestamp with time zone - timestamp with time zone

The following also looks incorrect:

dev=> select interval '1' year / 5;
        ?column?         
-------------------------
 2 mons 11 days 24:00:00
(1 row)

@shmiwy
Copy link
Contributor

shmiwy commented Jul 4, 2022

The following also looks incorrect:

https://github.com/singularity-data/risingwave/blob/722ba98b33fe87e8de028d31d57f7bd63d6bcd63/src/common/src/types/interval.rs#L204-L205

We shouldn't just throw away the decimals here

@skyzh
Copy link
Contributor

skyzh commented Jul 4, 2022

May submit a PR to fix? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Issues that need help from contributors type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants