2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-18 20:45:21 +01:00
"""
ID : issue - 1021
ISSUE : 1021
TITLE : Blob Type 1 compatibility with VarChar
DESCRIPTION :
JIRA : CORE - 655
2022-02-02 15:46:19 +01:00
FBTEST : bugs . core_0655
2022-01-18 20:45:21 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
import pytest
from firebird . qa import *
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
init_script = """ create table t1 (f1 BLOB SUB_TYPE 1 SEGMENT SIZE 80);
2021-04-26 20:07:00 +02:00
insert into t1 values ( ' Firebird ' ) ;
"""
2022-01-18 20:45:21 +01:00
db = db_factory ( page_size = 4096 , init = init_script )
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
test_script = """ select cast(lower(f1) as varchar(20)) lf1, cast(upper(f1) as varchar(20)) uf1, cast(trim(f1)|| ' 2.1 ' as varchar(20))tf1, cast(f1|| ' 2.1 ' as varchar(20)) cf1, cast(substring(f1 from 1 for 5) as varchar(20)) sf1 from t1;
2021-04-26 20:07:00 +02:00
"""
2022-01-18 20:45:21 +01:00
act = isql_act ( ' db ' , test_script )
2021-04-26 20:07:00 +02:00
2022-01-18 20:45:21 +01:00
expected_stdout = """ Database: test.fdb, User: SYSDBA
2021-04-26 20:07:00 +02:00
SQL >
LF1 UF1 TF1 CF1 SF1
== == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
firebird FIREBIRD Firebird2 .1 Firebird 2.1 Fireb
SQL > """
2022-01-18 20:45:21 +01:00
@pytest.mark.version ( ' >=3 ' )
def test_1 ( act : Action ) :
act . expected_stdout = expected_stdout
act . execute ( )
assert act . clean_stdout == act . clean_expected_stdout
2021-04-26 20:07:00 +02:00