Skip to content

Commit a78e078

Browse files
committed
Added/Updated tests\functional\sqlancer\tidb_challenge_19_test.py: adapted from article provided in SQLancer documentation.
1 parent 28a8a5e commit a78e078

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#coding:utf-8
2+
3+
"""
4+
ID: n/a
5+
ISSUE: https://github.com/tidb-challenge-program/bug-hunting-issue/issues/19
6+
TITLE: Incorrect result for LEFT JOIN and CASE operator
7+
DESCRIPTION:
8+
https://github.com/sqlancer/sqlancer/blob/main/CONTRIBUTING.md#unfixed-bugs
9+
https://github.com/sqlancer/sqlancer/blob/4c20a94b3ad2c037e1a66c0b637184f8c20faa7e/src/sqlancer/tidb/TiDBBugs.java
10+
"""
11+
12+
import pytest
13+
from firebird.qa import *
14+
15+
db = db_factory()
16+
17+
test_script = """
18+
set list on;
19+
CREATE TABLE t0(c0 INT);
20+
CREATE TABLE t1(c0 INT);
21+
INSERT INTO t0 VALUES (0);
22+
INSERT INTO t1 VALUES (0);
23+
SELECT * FROM t1 LEFT JOIN t0 ON t0.c0 = t1.c0 WHERE (CASE t0.c0 WHEN 0 THEN t1.c0 ELSE 1 END) <> 0; -- expected: {}, actual: {0|NULL}
24+
"""
25+
26+
act = isql_act('db', test_script)
27+
28+
@pytest.mark.version('>=3.0')
29+
def test_1(act: Action):
30+
act.execute(combine_output = True)
31+
assert act.clean_stdout == ''

0 commit comments

Comments
 (0)