6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00
firebird-qa/tests/bugs/core_4752_test.py

43 lines
977 B
Python
Raw Permalink Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-24 20:27:02 +01:00
"""
ID: issue-5056
ISSUE: 5056
TITLE: EXECUTE STATEMENT using BLOB parameters results in "Invalid BLOB ID" error
DESCRIPTION:
JIRA: CORE-4752
FBTEST: bugs.core_4752
2022-01-24 20:27:02 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
db = db_factory()
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
test_script = """
2021-04-26 20:07:00 +02:00
recreate table tb(id int, b1 blob);
commit;
insert into tb(id) values(1);
insert into tb(id) values(2);
insert into tb(id) values(3);
commit;
2022-01-24 20:27:02 +01:00
2021-04-26 20:07:00 +02:00
set term ^;
execute block as
declare v_stt varchar(255);
declare v_blob_a blob = 'qwertyuioplkjhgfdsazxcvbnm';
declare v_blob_b blob = '1234567890asdfghjklmnbvcxz';
begin
v_stt = 'update tb set b1 = case when id in (1,2) then cast(? as blob) else cast(? as blob) end';
execute statement ( v_stt ) ( v_blob_a, v_blob_b );
end
^
2022-01-24 20:27:02 +01:00
set term ;^
2021-12-22 20:23:11 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-24 20:27:02 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
2022-01-25 22:55:48 +01:00
act.execute()