Closed ycybfhb closed 1 month ago
Thank you @ycybfhb for reporting.
Just reproduced locally using 2024.1 version.
Simpler repro: (texticregexeq
is the same as ~*
, but easier to grep for in the codebase)
create table test_texticregex (t text);
insert into test_texticregex values ('a'), ('b'), (NULL), ('d');
explain (analyze, costs off, timing off, summary off) select * from test_texticregex where texticregexeq(t, t);
QUERY PLAN
------------------------------------------------------
Seq Scan on test_texticregex (actual rows=2 loops=1)
Storage Filter: texticregexeq(t, t)
(2 rows)
varies between 1, 2 or 3 rows.
There's no consistent row that gets excluded. Every permutation of a, b, d
is possible.
Jira Link: DB-11908
Description
Basic Information
Version:
Deploy:
Reproduce
Firstly, connect to the Yugabyte databases for multi-node and single-node deployments respectively via the
psql
command.Secondly, execute the statements in
init.sql
to create tables in both databases respectively.Finally, execute the statements in
error.sql
in both databases, and find that the two databases return results with different numbers of rows.The expression
(cast(ref_0.c_fi369lv as char) ~* cast(ref_0.c_fi369lv as char))
will always return true ifref_0.c_fi369lv
is not null. Thus, under correct condition, both databases should return the same results.init.sql: init.sql.txt error.sql: error.sql.txt
Results
yb-tserver:
yb-tserver-single:
About Us
We are the BASS team from the School of Cyber Science and Technology at Beihang University. Our main focus is on system software security, operating systems, and program analysis research, as well as the development of automated program testing frameworks for detecting software defects. Using our self-developed database vulnerability testing tool, we have identified the above-mentioned vulnerabilities in Yugabyte that may lead to database crashes.
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information