|
| 1 | +#coding:utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | +ID: issue-7998 |
| 5 | +ISSUE: https://github.com/FirebirdSQL/firebird/issues/7998 |
| 6 | +TITLE: Crash during partial index checking if the condition raises a conversion error |
| 7 | +NOTES: |
| 8 | + [10.02.2024] pzotov |
| 9 | + Confirmed bug on 6.0.0.250, ISQL issues errors and hangs (does not return control to OS): |
| 10 | + Statement failed, SQLSTATE = 22018 |
| 11 | + Error during savepoint backout - transaction invalidated |
| 12 | + -conversion error from string "2" |
| 13 | + Statement failed, SQLSTATE = 25000 |
| 14 | + transaction marked invalid and cannot be committed |
| 15 | + Checked on 6.0.0.257 -- all fine. |
| 16 | +""" |
| 17 | + |
| 18 | +import pytest |
| 19 | +from firebird.qa import * |
| 20 | + |
| 21 | +db = db_factory() |
| 22 | + |
| 23 | +test_script = """ |
| 24 | + recreate table t0(c0 varchar(500), c1 int); |
| 25 | + create unique index t0i0 on t0(c0 , c1 ) where (t0.c1 between false and true); |
| 26 | + insert into t0(c0, c1) values (1, 2); |
| 27 | +""" |
| 28 | + |
| 29 | +act = isql_act('db', test_script, substitutions = [('[ \t]+', ' ')]) |
| 30 | + |
| 31 | +expected_stdout = """ |
| 32 | + Statement failed, SQLSTATE = 22018 |
| 33 | + conversion error from string "2" |
| 34 | +""" |
| 35 | + |
| 36 | +@pytest.mark.version('>=5.0.1') |
| 37 | +def test_1(act: Action): |
| 38 | + act.expected_stdout = expected_stdout |
| 39 | + act.execute(combine_output = True) |
| 40 | + assert act.clean_stdout == act.clean_expected_stdout |
0 commit comments