[ https://issues.apache.org/jira/browse/TRAFODION-2832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16284204#comment-16284204 ]
ASF GitHub Bot commented on TRAFODION-2832: ------------------------------------------- GitHub user sandhyasun opened a pull request: https://github.com/apache/incubator-trafodion/pull/1330 [TRAFODION-2832] Fix for hang when preparing insert statements using values tuple list… … into lob columns. The fix is to detect the values list at compile time and if the target type is LOB, return an error. Additional fix is to exclude Lob descriptor files from being classified as "special" type. This ensures they will be included in query cache. You can merge this pull request into a Git repository by running: $ git pull https://github.com/sandhyasun/incubator-trafodion traf_misc Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-trafodion/pull/1330.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1330 ---- commit 545318f32e636856f024d7c770ed6ca32bac8fc9 Author: Sandhya Sundaresan <sand...@apache.org> Date: 2017-12-07T21:17:57Z Fix for hang when preparing insert statements using values tuple list inot lob columns. The fix is to detect the values list at compile time and if the target type is LOB, return an error. Additional fix is to exclude LOb descriptor files from being classified as "special" type. This ensures they will be included in query cache. ---- > LOB: Insert hangs with a mutli-row insertion that requires internal > stringtolob() conversion > -------------------------------------------------------------------------------------------- > > Key: TRAFODION-2832 > URL: https://issues.apache.org/jira/browse/TRAFODION-2832 > Project: Apache Trafodion > Issue Type: Bug > Reporter: Sandhya Sundaresan > Assignee: Sandhya Sundaresan > > The LOB feature allows the user to specify a char string as the insert value. > EsgynDB will automatically convert it into a LOB datatype, just as if the > user has specified stringtolob() explicitly. The following execution output > shows that both insert..values('1') and insert..values(stringtolob('2')) work > fine. > The design has prohibited the user from using stringtolob() to insert > multiple rows at the same time. It's a 4483 error as shown by insert..values > (stringtolob('3')),(stringtolob('4')). However, if the user doesn't specify > stringtolob(), the multi-row insertion insert..values('5'),('6') doesn't > return such an error. It simply hangs, presumably because it tries to invoke > stringtolob() underneath and has run into the situation that the 4483 error > is designed to prevent. It probably needs to return the same error to avoid > such a hang problem. > >>cqd TRAF_BLOB_AS_VARCHAR 'OFF'; > --- SQL operation complete. > >>cqd TRAF_CLOB_AS_VARCHAR 'OFF'; > --- SQL operation complete. > >> > >>drop table if exists t cascade; > --- SQL operation complete. > >> > >>create table t (a clob); > --- SQL operation complete. > >>insert into t values ('1'); > --- 1 row(s) inserted. > >>insert into t values (stringtolob('2')); > --- 1 row(s) inserted. > >>select cast(lobtostring(a) as char(5)) from t; > (EXPR) > ------ > 1 > 2 > --- 2 row(s) selected. > >>insert into t values (stringtolob('3')),(stringtolob('4')); > *** ERROR[4483] This LOB conversion function is not allowed in the VALUES > clause with multiple input value rows. Use it with a single value row. > *** ERROR[8822] The statement was not prepared. > >>insert into t values ('5'),('6'); > ---------------------------------------------------------------- > To reproduce : > cqd TRAF_BLOB_AS_VARCHAR 'OFF'; > cqd TRAF_CLOB_AS_VARCHAR 'OFF'; > drop table if exists t cascade; > create table t (a clob); > insert into t values ('1'); > insert into t values (stringtolob('2')); > select cast(lobtostring(a) as char(5)) from t; > insert into t values (stringtolob('3')),(stringtolob('4')); > insert into t values ('5'),('6'); > drop table t cascade; -- This message was sent by Atlassian JIRA (v6.4.14#64029)