[ 
https://issues.apache.org/jira/browse/TRAFODION-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14708608#comment-14708608
 ] 

Atanu Mishra commented on TRAFODION-247:
----------------------------------------

Hans Zeller (hans-zeller) wrote on 2014-07-02:  #3
Download full text (6.5 KiB)
Looks like the initial problems, reported on 05-02 and 05-14 are fixed in the 
meantime, probably by fixes for UCS2 columns that Qifan added. The last 
problem, the core dump reported on 06-09, remains. What happens there is that 
for the descending UCS2 column, we put a 0xFFFF wide character into one of the 
split key constants, and that gets interpreted in the Unicode lexer as an EOF. 
The fix is probably not to use 0xFFFF as a character, but instead to use the 
hex string form.

We only see this issue on the second statement, because only during the second 
statement do we parse this string. Here is the stack trace:

 yyULexer::constructStringLiteralWithCharSet (this=0x1be2af0, isHex=0, 
cs=CharInfo::UNICODE, lvalp=0x7ffffffd93d0, quote=39 L'\047') at 
../parser/ulexer.cpp:848
#1 0x00007ffff058dd9a in yyULexer::arkcmplex (this=0x1be2af0, 
lvalp=0x7ffffffd93d0) at ../parser/ulexer.cpp:1094
#2 0x00007ffff12ad5c3 in Parser::arkcmplex (this=0x7ffffffef160, 
lvalp=0x7ffffffd93d0) at ../sqlcomp/parser.h:166
#3 0x00007ffff12acf3c in arkcmplex (lvalp=0x7ffffffd93d0) at 
../sqlcomp/parser.cpp:1646
#4 0x00007ffff04bbe9a in arkcmpparse () at 
parser/linux/64bit/debug/sqlparser.cpp:41442
#5 0x00007ffff12a9ad7 in Parser::parseSQL (this=0x7ffffffef160, 
node=0x7ffffffef010, internalExpr=1, paramItemList=0x0) at 
../sqlcomp/parser.cpp:748
#6 0x00007ffff12aa78b in Parser::parseDML (this=0x7ffffffef160, 
instr=0x7fffd80e5060 "2,_UCS2'\357\277\210", '\357\277\277' <repeats 49 times>, 
"';", inlen=160, charset=CharInfo::UTF8, node=0x7ffffffef010, internalExpr=1, 
paramItemList=0x0) at ../sqlcomp/parser.cpp:952
#7 0x00007ffff12ab52c in Parser::getExprTree (this=0x7ffffffef160, 
str=0x7fffd80e5060 "2,_UCS2'\357\277\210", '\357\277\277' <repeats 49 times>, 
"';", strlength=160, strCharSet=CharInfo::UTF8, num_params=0, p1=0x0, p2=0x0, 
p3=0x0, p4=0x0, p5=0x0, p6=0x0, otherParams=0x0, internal_expr=1) at 
../sqlcomp/parser.cpp:1174
#8 0x00007ffff12ab92b in Parser::getItemExprTree (this=0x7ffffffef160, 
str=0x7fffd80e5060 "2,_UCS2'\357\277\210", '\357\277\277' <repeats 49 times>, 
"';", len=160, strCharSet=CharInfo::UTF8, num_params=0, p1=0x0, p2=0x0, p3=0x0, 
p4=0x0, p5=0x0, p6=0x0, paramItemList=0x0) at ../sqlcomp/parser.cpp:1260
#9 0x00007fffef9dd298 in getRangePartitionBoundaryValues 
(keyValueBuffer=0x1bdc2e8 "2,_UCS2'\357\277\210", '\357\277\277' <repeats 49 
times>, "'", keyValueBufferSize=159, heap=0x7fffd812a988, 
strCharSet=CharInfo::UTF8) at ../optimizer/NATable.cpp:1359
#10 0x00007fffefb1d2c1 in RangePartitionBoundaries::setupForStatement 
(this=0x7fffd8127a50, useStringVersion=1) at ../optimizer/PartFunc.cpp:3601
#11 0x00007fffefb2098c in RangePartitioningFunction::setupForStatement 
(this=0x7fffd81039a8) at ../optimizer/PartFunc.cpp:4573
#12 0x00007fffef9cee43 in NAFileSet::setupForStatement (this=0x7fffd8103c20) at 
../optimizer/NAFileSet.cpp:249
#13 0x00007fffef9ec37c in NATable::setupForStatement (this=0x7fffd8126268) at 
../optimizer/NATable.cpp:6146
#14 0x00007fffef9f0773 in NATableDB::get (this=0x7fffe7b09660, corrName=..., 
bindWA=0x7fffffff1430, inTableDescStruct=0x0) at ../optimizer/NATable.cpp:7229
#15 0x00007fffef75727a in BindWA::getNATable (this=0x7fffffff1430,...

Read more...

Hans Zeller (hans-zeller) wrote on 2014-07-29:  #4
Fix was delivered on July 24: https://review.trafodion.org/116

Changed in trafodion:
status: In Progress → Fix Committed
Stacey Johnson (sjohnson-w) on 2014-10-16
Changed in trafodion:
milestone:      none → r0.8
status: Fix Committed → Fix Released
Stacey Johnson (sjohnson-w) on 2014-10-16
Changed in trafodion:
milestone:      r0.8 → r0.9


> LP Bug: 1315567 - insert into salt table fails with ERROR[1123]
> ---------------------------------------------------------------
>
>                 Key: TRAFODION-247
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-247
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-general
>            Reporter: Julie Thai
>            Assignee: Hans Zeller
>            Priority: Critical
>             Fix For: 0.9 (pre-incubation)
>
>
> Create salt table with primary key on varchar ucs2 column. Insert into salt 
> table fails with ERROR[1123].
> From sqlci:
> >>CREATE TABLE f00(
> +> colkey int not null,
> +> colvchrucs2 varchar(100) character set ucs2 not null,
> +> primary key (colvchrucs2))
> +> salt using 3 partitions;
> --- SQL operation complete.
> >>
> >>INSERT INTO f00 VALUES (1, 'abcde'), (2, 'fghij'), (3, 'klmnopqrs'), (4, 
> >>'tuvwxyz'), (5, 'abc@#$%^&*()efgh');
> *** ERROR[1123] Not all of the partition key values () for object 
> TRAFODION.SEABASE.F00 could be processed. Please verify that the correct key 
> value data types were specified.
> *** ERROR[8822] The statement was not prepared.
> >>
> >>CREATE TABLE f01(
> +> colkey int not null,
> +> colvchrucs2 varchar(100) character set ucs2 not null,
> +> primary key (colvchrucs2));
> --- SQL operation complete.
> >>
> >>INSERT INTO f01 VALUES (1, 'abcde'), (2, 'fghij'), (3, 'klmnopqrs'), (4, 
> >>'tuvwxyz'), (5, 'abc@#$%^&*()efgh');
> --- 5 row(s) inserted.
> MY_SQROOT=/opt/home/thaiju/datalake_64_1
> who@host=tha...@g4t3029.houston.hp.com
> JAVA_HOME=/opt/home/tools/jdk1.7.0_09_64
> linux=2.6.32-279.el6.x86_64
> redhat=6.3
> Release 0.7.0 (Build release [39961], branch 39961-project/datalake_64_1, 
> date 02May14)
> To reproduce, in sqlci issue:
> DROP TABLE f00;
> DROP TABLE f01;
> CREATE TABLE f00(
>                colkey int not null,
>                colvchrucs2 varchar(100) character set ucs2 not null,
>                primary key (colvchrucs2))
>                salt using 3 partitions;
> INSERT INTO f00 VALUES (1, 'abcde'), (2, 'fghij'), (3, 'klmnopqrs'), (4, 
> 'tuvwxyz'), (5, 'abc@#$%^&*()efgh');
> CREATE TABLE f01(
>                colkey int not null,
>                colvchrucs2 varchar(100) character set ucs2 not null,
>                primary key (colvchrucs2));
> INSERT INTO f01 VALUES (1, 'abcde'), (2, 'fghij'), (3, 'klmnopqrs'), (4, 
> 'tuvwxyz'), (5, 'abc@#$%^&*()efgh');
> Also, try showddl and invoke.
> Then rerun reproducible script again but this time with primary key 
> DESCENDING.
> Again, try showddl and invoke.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to