2021-04-26 20:07:00 +02:00
|
|
|
#coding:utf-8
|
|
|
|
#
|
|
|
|
# id: bugs.core_2651
|
|
|
|
# title: Incorrect "string right truncation" error with NONE column and multibyte connection charset
|
2021-11-16 19:44:53 +01:00
|
|
|
# decription:
|
2021-04-26 20:07:00 +02:00
|
|
|
# tracker_id: CORE-2651
|
|
|
|
# min_versions: []
|
|
|
|
# versions: 2.5
|
|
|
|
# qmid: None
|
|
|
|
|
|
|
|
import pytest
|
2021-11-16 19:44:53 +01:00
|
|
|
from firebird.qa import db_factory, python_act, Action
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
# version: 2.5
|
|
|
|
# resources: None
|
|
|
|
|
|
|
|
substitutions_1 = []
|
|
|
|
|
|
|
|
init_script_1 = """create table TEST_NONE
|
|
|
|
(VARCHAR_1 VARCHAR(1) CHARACTER SET NONE);
|
|
|
|
|
|
|
|
insert into test_none values (ascii_char(1));
|
|
|
|
"""
|
|
|
|
|
|
|
|
db_1 = db_factory(page_size=4096, sql_dialect=3, init=init_script_1)
|
|
|
|
|
|
|
|
# test_script_1
|
|
|
|
#---
|
|
|
|
# con = kdb.connect(dsn=dsn,user=user_name,password=user_password,charset='CP943C')
|
|
|
|
# c = con.cursor()
|
|
|
|
# try:
|
|
|
|
# c.execute("select * from TEST_NONE")
|
|
|
|
# except:
|
|
|
|
# print("Test FAILED")
|
|
|
|
# finally:
|
|
|
|
# con.close()
|
|
|
|
#---
|
|
|
|
|
2021-11-16 19:44:53 +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-16 19:44:53 +01:00
|
|
|
def test_1(act_1: Action):
|
|
|
|
with act_1.db.connect(charset='CP943C') as con:
|
|
|
|
c = con.cursor()
|
|
|
|
try:
|
|
|
|
c.execute("select * from TEST_NONE")
|
|
|
|
except:
|
|
|
|
pytest.fail("Test FAILED")
|
2021-04-26 20:07:00 +02:00
|
|
|
|
|
|
|
|