2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
2022-01-21 18:49:26 +01:00
|
|
|
|
|
|
|
"""
|
|
|
|
ID: issue-3109
|
|
|
|
ISSUE: 3109
|
|
|
|
TITLE: Do not print "invalid request BLR" for par.cpp errors with valid BLR
|
|
|
|
DESCRIPTION:
|
|
|
|
JIRA: CORE-2712
|
2022-02-02 15:46:19 +01:00
|
|
|
FBTEST: bugs.core_2712
|
2022-01-21 18:49:26 +01:00
|
|
|
"""
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
import pytest
|
2022-01-21 18:49:26 +01:00
|
|
|
from firebird.qa import *
|
2021-11-16 19:44:53 +01:00
|
|
|
from firebird.driver import DatabaseError
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-21 18:49:26 +01:00
|
|
|
db = db_factory()
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2022-01-21 18:49:26 +01:00
|
|
|
act = python_act('db', substitutions=[('table id [0-9]+ is not defined', 'table is not defined')])
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
@pytest.mark.version('>=3.0')
|
2022-01-21 18:49:26 +01:00
|
|
|
def test_1(act: Action, capsys):
|
|
|
|
with act.db.connect() as att1:
|
2021-11-16 19:44:53 +01:00
|
|
|
cur1 = att1.cursor()
|
|
|
|
cur1.execute("recreate table test(x int)")
|
|
|
|
att1.commit()
|
|
|
|
cur1.execute("insert into test values(1)")
|
|
|
|
att1.commit()
|
2022-01-21 18:49:26 +01:00
|
|
|
with act.db.connect() as att2:
|
2021-11-16 19:44:53 +01:00
|
|
|
cur2 = att2.cursor()
|
|
|
|
cur2.execute("select 1 from rdb$database")
|
2021-04-26 20:07:00 +02:00
|
|
|
|
2021-11-16 19:44:53 +01:00
|
|
|
cur1.execute("drop table test")
|
|
|
|
with pytest.raises(DatabaseError, match='.*table id [0-9]+ is not defined.*'):
|
|
|
|
cur2.prepare("update test set x=-x")
|
|
|
|
att2.commit()
|