6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/bugs/core_0210_test.py

107 lines
1.9 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
#
# id: bugs.core_0210
# title: CS server crash altering SP in 2 connect
2021-11-10 19:02:05 +01:00
# decription:
#
2021-04-26 20:07:00 +02:00
# tracker_id: CORE-0210
# min_versions: ['2.5.0']
# versions: 2.5
# qmid: None
import pytest
2021-11-10 19:02:05 +01:00
from firebird.qa import db_factory, python_act, Action
from firebird.driver import TPB, Isolation
2021-04-26 20:07:00 +02:00
# version: 2.5
# resources: None
substitutions_1 = []
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
# test_script_1
#---
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# import os
# import fdb
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# os.environ["ISC_USER"] = user_name
# os.environ["ISC_PASSWORD"] = user_password
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# db_conn.close()
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# stm1='''create or alter procedure sp_test as
# begin
# exit;
# end
# '''
# stm2='''create or alter procedure sp_test as
# declare x int;
# begin
# exit;
# end
# '''
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# con1 = fdb.connect(dsn=dsn)
# con2 = fdb.connect(dsn=dsn)
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# xtpb = ( [ fdb.isc_tpb_concurrency ] )
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# con1.begin( tpb = xtpb )
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# cur1=con1.cursor()
# cur2=con2.cursor()
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# cur1.execute(stm1)
# con1.commit()
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# con2.begin( tpb = xtpb )
# cur2.execute(stm2)
# con2.commit()
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# con1.begin( tpb = xtpb )
# cur1.execute(stm1)
# con1.commit()
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
# con1.close()
# con2.close()
2021-11-10 19:02:05 +01:00
#
2021-04-26 20:07:00 +02:00
#---
2021-11-10 19:02:05 +01:00
act_1 = python_act('db_1', substitutions=substitutions_1)
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=2.5')
2021-11-10 19:02:05 +01:00
def test_1(act_1: Action):
stm1 = '''create or alter procedure sp_test as
begin
exit;
end
'''
stm2 = '''create or alter procedure sp_test as
declare x int;
begin
exit;
end
'''
tpb = TPB(isolation=Isolation.CONCURRENCY).get_buffer()
with act_1.db.connect() as con1, act_1.db.connect() as con2:
con1.begin(tpb)
cur1 = con1.cursor()
cur2 = con2.cursor()
cur1.execute(stm1)
con1.commit()
con2.begin(tpb)
cur2.execute(stm2)
con2.commit()
con1.begin(tpb)
cur1.execute(stm1)
con1.commit()
2021-04-26 20:07:00 +02:00