mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 21:43:06 +01:00
Added/Updated tests\bugs\gh_7167_test.py: re-implemented in order to run both on Windows and Linux. See notes.
This commit is contained in:
parent
6f839d8f1f
commit
127e46a764
@ -7,23 +7,28 @@ TITLE: Incorrect transliteration of field names in constraint violation er
|
|||||||
DESCRIPTION:
|
DESCRIPTION:
|
||||||
NOTES:
|
NOTES:
|
||||||
[28.02.2023] pzotov
|
[28.02.2023] pzotov
|
||||||
Confirmed bug on 4.0.1.2692.
|
Confirmed bug on 4.0.1.2692 Windows and Linux.
|
||||||
Checked on 5.0.0.961, 4.0.3.2903 - all OK.
|
NB: on Linux we have to write SQL script into file with encoding = cp1251
|
||||||
|
and run it as script, otherwise issue not reproduced.
|
||||||
|
|
||||||
|
Checked on Windows and Linux, builds 5.0.0.961, 4.0.3.2903 - all OK.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from firebird.qa import *
|
from firebird.qa import *
|
||||||
|
from pathlib import Path
|
||||||
|
import time
|
||||||
|
|
||||||
db = db_factory(charset = 'win1251')
|
db = db_factory(charset = 'win1251')
|
||||||
act = python_act('db')
|
act = python_act('db', substitutions = [('After line \\d+ in file .*', '')])
|
||||||
|
tmp_sql = temp_file('tmp_gh_7167.tmp.sql')
|
||||||
expected_stdout = """
|
expected_stdout = """
|
||||||
Statement failed, SQLSTATE = 23000
|
Statement failed, SQLSTATE = 23000
|
||||||
violation of PRIMARY or UNIQUE KEY constraint "уни" on table "абв"
|
violation of PRIMARY or UNIQUE KEY constraint "уни" on table "абв"
|
||||||
-Problematic key value is ("аб" = 'аб', "вг" = 'аб', "де" = 'аб')
|
-Problematic key value is ("аб" = 'аб', "вг" = 'аб', "де" = 'аб')
|
||||||
"""
|
"""
|
||||||
@pytest.mark.version('>=4.0.2')
|
@pytest.mark.version('>=4.0.2')
|
||||||
def test_1(act: Action):
|
def test_1(act: Action, tmp_sql: Path):
|
||||||
test_sql = """
|
test_sql = """
|
||||||
create table "абв" (
|
create table "абв" (
|
||||||
"аб" varchar(5) character set win1251,
|
"аб" varchar(5) character set win1251,
|
||||||
@ -34,6 +39,7 @@ def test_1(act: Action):
|
|||||||
insert into "абв" values ('аб','аб','аб');
|
insert into "абв" values ('аб','аб','аб');
|
||||||
insert into "абв" values ('аб','аб','аб');
|
insert into "абв" values ('аб','аб','аб');
|
||||||
"""
|
"""
|
||||||
|
tmp_sql.write_bytes(test_sql.encode('cp1251'))
|
||||||
act.expected_stdout = expected_stdout
|
act.expected_stdout = expected_stdout
|
||||||
act.isql(switches=['-q'], charset = 'win1251', input = test_sql, combine_output = True)
|
act.isql(switches=['-q'], charset = 'win1251', input_file = tmp_sql, combine_output = True)
|
||||||
assert act.clean_stdout == act.clean_expected_stdout
|
assert act.clean_stdout == act.clean_expected_stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user