6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 05:53:06 +01:00
firebird-qa/tests/bugs/core_0967_test.py

34 lines
775 B
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-18 20:45:21 +01:00
"""
ID: issue-1370
ISSUE: 1370
TITLE: SQL with incorrect characters (outside the ASCII range) may be processed wrongly
DESCRIPTION:
JIRA: CORE-967
FBTEST: bugs.core_0967
2022-01-18 20:45:21 +01:00
"""
2021-04-26 20:07:00 +02:00
import pytest
2022-01-18 20:45:21 +01:00
from firebird.qa import *
2021-11-10 19:02:05 +01:00
from firebird.driver import DatabaseError
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
init_script = """create table t (i integer);
2021-04-26 20:07:00 +02:00
insert into t values (0);
commit;
"""
2022-01-18 20:45:21 +01:00
db = db_factory(init=init_script)
2021-11-10 19:02:05 +01:00
2022-01-18 20:45:21 +01:00
act = python_act('db')
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=2.1')
2022-01-18 20:45:21 +01:00
def test_1(act: Action):
with act.db.connect() as con:
2021-11-10 19:02:05 +01:00
c = con.cursor()
with pytest.raises(DatabaseError, match="Dynamic SQL Error\n-SQL error code = -104\n-Token unknown - line 1, column 17\n.*") as excinfo:
c.execute('update t set i=1'+chr(238)+' where 1=0')
2021-04-26 20:07:00 +02:00