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

Crash potentially caused by BETWEEN operator #7860

Closed
suyZhong opened this issue Nov 20, 2023 · 1 comment
Closed

Crash potentially caused by BETWEEN operator #7860

suyZhong opened this issue Nov 20, 2023 · 1 comment

Comments

@suyZhong
Copy link

Considering the test cases below

CREATE TABLE t0(c0 INT, PRIMARY KEY(c0)); 
SELECT c0 FROM t0 WHERE (1 NOT BETWEEN false AND c0);

These statements caused a segmentation fault.

root@0df1192c09b7:/app/firebird# isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> CREATE DATABASE 'test';
SQL> CONNECT 'test';
Commit current transaction (y/n)?y
Committing.
Database: 'test', User: SYSDBA
SQL> CREATE TABLE t0(c0 INT, PRIMARY KEY(c0)); 
SQL> SELECT c0 FROM t0 WHERE (1 NOT BETWEEN false AND c0);
Segmentation fault (core dumped)
root@0df1192c09b7:/app/firebird# cat src/jrd/build_no.h | grep VER_STRING
#define PRODUCT_VER_STRING "6.0.0.132"
#define FILE_VER_STRING "WI-T6.0.0.132"
#define LICENSE_VER_STRING "WI-T6.0.0.132"

I found this in version 6.0.0.132 where I built from source code a0ff6b9

@hvlad
Copy link
Member

hvlad commented Nov 24, 2023

The crash happens when execution plan contains Condition node and corresponding condition throws error when evaluated.

In the given case the error is conversion error from string "1" due to cast of integer literal 1 to the boolean data type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment