Weiqing Xu created TRAFODION-2753:
-------------------------------------

             Summary: LOB: filetolob() no longer works in trafci
                 Key: TRAFODION-2753
                 URL: https://issues.apache.org/jira/browse/TRAFODION-2753
             Project: Apache Trafodion
          Issue Type: Bug
          Components: client-jdbc-t4
            Reporter: Weiqing Xu


As shown below, while filetolob() still works fine in sqlci, it no longer works 
in trafci. Instead of returning a LOB handle, it returns what looks to be the 
text content of the data.

This is seen on the AdvEnt2.3 20170818 daily build. It is a regression 
introduced sometime between the 20170811 daily build and the 20170818 daily 
build, as it still worked fine in the 20170811 daily build. This is a test 
stopper for testing LOB in SQL, as the tests use this function to verify 
various LOB features.

$ cat /home/trafodion/QALibs/LOB/mydata.txt
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789

$ sqlci -i mytest.sql
EsgynDB Advanced Conversational Interface 2.3.0
Copyright (c) 2015-2017 Esgyn Corporation
>>cqd TRAF_BLOB_AS_VARCHAR 'OFF';

--- SQL operation complete.
>>cqd TRAF_CLOB_AS_VARCHAR 'OFF';

--- SQL operation complete.
>>
>>drop schema if exists mytest cascade;

--- SQL operation complete.
>>create schema mytest;

--- SQL operation complete.
>>set schema mytest;

--- SQL operation complete.
>>
>>create table mytable (c blob);

--- SQL operation complete.
>>insert into mytable values 
>>(filetolob('/home/trafodion/QALibs/LOB/mydata.txt'));

--- 1 row(s) inserted.
>>select * from mytable;

C
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

LOBH000000020001007893937971681307861878939379721266258218212370094955192082020"TRAFODION"."MYTEST"
 

--- 1 row(s) selected.
>>
>>drop schema mytest cascade;

--- SQL operation complete.
>>exit;


$ trafci

Welcome to EsgynDB Command Interface
Copyright (c) 2015-2017 Esgyn Corporation

Host Name/IP Address: nap011.esgyn.local:23400
User Name: zz

Connected to EsgynDB Advanced

SQL>obey mytest.sql;

SQL>cqd TRAF_BLOB_AS_VARCHAR 'OFF';

--- SQL operation complete.

SQL>cqd TRAF_CLOB_AS_VARCHAR 'OFF';

--- SQL operation complete.

SQL>drop schema if exists mytest cascade;

--- SQL operation complete.

SQL>create schema mytest;

--- SQL operation complete.

SQL>set schema mytest;

--- SQL operation complete.

SQL>create table mytable (c blob);

--- SQL operation complete.

SQL>insert into mytable values 
(filetolob('/home/trafodion/QALibs/LOB/mydata.txt'));

--- 1 row(s) inserted.

SQL>select * from mytable;

C
--------------------------------------------------------------------------------------------------------------------------------
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789


--- 1 row(s) selected.

SQL>drop schema mytest cascade;

--- SQL operation complete.
Steps To Reproduce      Create a text file 
/home/trafodion/QALibs/LOB/mydata.txt with the following content (Change the 
directory name in the sql statement if desired. Make sure that the file is on 
every node if using trafci on a multi-node system):

$ cat /home/trafodion/QALibs/LOB/mydata.txt
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789

Execute the following statements from trafci:

cqd TRAF_BLOB_AS_VARCHAR 'OFF';
cqd TRAF_CLOB_AS_VARCHAR 'OFF';

drop schema if exists mytest cascade;
create schema mytest;
set schema mytest;

create table mytable (c blob);
insert into mytable values (filetolob('/home/trafodion/QALibs/LOB/mydata.txt'));
select * from mytable;

drop schema mytest cascade;



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to