Call ResultSet.next() function failed when expect to select 200k utf8 column size from a table

Bug #1451707 reported by Yu Bo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Committed
High
Weiqing Xu

Bug Description

Defect Description:

There is a table that columns charset as utf8, when expect to return 200K column size, it is failed to call ResultSet.next() function.

Test Environment:

sqws139.houston.hp.com, T2 driver.

Test Steps:

Step 1. Create a table as below,

sql = "create table tblcolumnsize200kWithUTF8(c1 char(50000) character set UTF8 collate default null, c2 char(50000) character set UTF8 collate default null)";
iRet = stmt.executeUpdate(sql);

Step 2. Insert 20K utf8 column size into the above table.

Step 3. Execute query as below,

sql = "select left(rtrim(t.c1), 50000) as o1 from tblcolumnsize200kWithUTF8 as t";
rs = stmt.executeQuery(sql);

Step 4. Compare the first column o1 size returned from ResultSet object.

rs.next();
assertEquals(50000, (URLDecoder.decode(rs.getObject(1).toString(), "UTF-8")).length());

At the Step 4, it will throw an exception as below,

java.lang.NegativeArrayizeException

                 at org.trafodion.jdbc.t2.SQLMXResultSet.fetchN(Native Method)
                 at org.trafodion.jdbc.t2.SQLMXResultSet.next(SQLMXResultSet.java:2478)
                 ...

Changed in trafodion:
assignee: nobody → xiu-zhu.zhang (xiu-zhu-zhang)
Changed in trafodion:
status: New → In Progress
Changed in trafodion:
importance: Undecided → High
Changed in trafodion:
milestone: none → r2.0
Yu Bo (byu)
description: updated
Yu Bo (byu)
summary: - Call ResultSet.next() function failed when expect to select 20k utf8
+ Call ResultSet.next() function failed when expect to select 200k utf8
column size from a table
Changed in trafodion:
assignee: xiu-zhu.zhang (xiu-zhu-zhang) → Weiqing Xu (wei-qing-xu)
Revision history for this message
Weiqing Xu (wei-qing-xu) wrote :

Here is the code review link: https://review.trafodion.org/#/c/1671/

Changed in trafodion:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.