You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:21:06 UTC
[jira] [Created] (TRAFODION-1268) LP Bug: 1463352 - The column
length returned is wrong when the column charset is UCS2
Alice Chen created TRAFODION-1268:
-------------------------------------
Summary: LP Bug: 1463352 - The column length returned is wrong when the column charset is UCS2
Key: TRAFODION-1268
URL: https://issues.apache.org/jira/browse/TRAFODION-1268
Project: Apache Trafodion
Issue Type: Bug
Components: client-odbc-linux
Reporter: YuBo
Defect Description:
When test column charset as UCS2, the column length returned is wrong, the expect value is 200K, but the actual values is 886.
Test Environment:
DB cluster: onyx13 (build: trafodion-20150605_0830)
Linux ODBC driver: clients-20150605_0830
Test Steps:
Step 1. create a table
571 sql = "create table tblcolumnsize200kWithUCS2(c1 char(100000) character set ucs2 collate default null, c2 char(100000) character set ucs2 collate default null)"
Sep 2. insert data into the table
573 a = u""
574 b = u""
575 for i in range(1, 100000, 1):
576 a = a + unicode('a') # print sys.maxunicode, if 65535 then ucs2, if 1114111 then ucs4, manually check
577 b = b + unicode('b')
578 a = a + unicode('E')
579 b = b + unicode('E')
580 sql = "insert into tblcolumnsize200kWithUCS2(c1, c2) values('" + a + "', '" + b +"')"
581 cursor.execute(sql)
Step 3. do compare between the expected value and the actual value
585 #print "---", rows
586 print "length of the result set ", len(rows)
587 self.assertEqual(len(rows), 1, 'get total rows from table wrong.')
588 len_a = len(rows[0][0]) # error: length=866
589 print "length of the first column value ", len_a
590 self.assertEqual(len_a, 100000, 'get length of the first column wrong.')
591 self.assertEqual(rows[0][0], a, 'value wrong betwen resultset and table.')
In the step 3, when execute the line 590, the expected value is 100000, but the actual value is 866. Here is the console output,
-bash-4.1$ python -m tests.ODBC.test_scenarios
sslength of the result set 1
length of the first column value 866
Fssss
======================================================================
FAIL: testBigColumnSize_UCS2 (__main__.ScenariosTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/designs/seaquest/yubo/traftests/pyframework_tra/tests/ODBC/test_scenarios.py", line 590, in testBigColumnSize_UCS2
self.assertEqual(len_a, 100000, 'get length of the first column wrong.')
AssertionError: get length of the first column wrong.
----------------------------------------------------------------------
Ran 7 tests in 13.882s
FAILED (failures=1, skipped=6)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)