File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
tests/functional/sqlancer Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ #coding:utf-8
2+
3+ """
4+ ID: n/a
5+ ISSUE: https://arxiv.org/pdf/2312.17510
6+ TITLE: PARTIAL INDICES. NATURAL RIGHT JOIN results in an unexpected "Unknown column" error
7+ DESCRIPTION:
8+ https://arxiv.org/pdf/2312.17510 page #2 listing 1
9+ NOTES:
10+ [05.06.2025] pzotov
11+ Support for partial indices in FB:
12+ https://github.com/FirebirdSQL/firebird/pull/7257
13+ """
14+
15+ import pytest
16+ from firebird .qa import *
17+
18+ db = db_factory ()
19+
20+ test_script = """
21+ --Listing 1. A bug found by QPG in SQLite due to an incorrect use of an
22+ --index in combination with a JOIN. Given the same SELECT, the left query
23+ --plan is produced if no index is present, while the right one uses the index.
24+ CREATE TABLE t1(a INT, b INT);
25+ CREATE TABLE t2(c INT);
26+ CREATE TABLE t3(d INT);
27+
28+ INSERT INTO t1(a) VALUES(2);
29+ INSERT INTO t3 VALUES(1);
30+ commit;
31+
32+ CREATE INDEX i0 ON t2(c)
33+ WHERE c = 3 -- ::: NB ::: partial index
34+ ;
35+
36+ SELECT *
37+ FROM t2
38+ RIGHT JOIN t3 ON d <> 0
39+ LEFT JOIN t1 ON c = 3
40+ WHERE t1.a <> 0; -- output must be empty resultset
41+ """
42+
43+ act = isql_act ('db' , test_script )
44+
45+ @pytest .mark .version ('>=5.0' )
46+ def test_1 (act : Action ):
47+ act .execute (combine_output = True )
48+ assert act .clean_stdout == ''
You can’t perform that action at this time.
0 commit comments