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

ASF GitHub Bot commented on TRAFODION-2104:
-------------------------------------------

Github user sureshsubbiah commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/653#discussion_r74420605
  
    --- Diff: core/conn/odb/src/odb.c ---
    @@ -9889,7 +9889,9 @@ static void Oextract(int eid)
                 if ( etab[eid].fho ) {
                     (*hdfswrite)(hfs, etab[eid].fho, (void *)xbuff, xbuffl);
                 } else {
    -                (void)fwrite ( xbuff, 1, xbuffl, etab[eid].fo );
    +                if ( etab[eid].fo == stdout ) {
    --- End diff --
    
    If the current problem is that  etab[eid].fo was NULL and we tried to write 
to it, will it not be better if the change was 
    if ( etab[eid].fo ) {
    fwrite (...)
    }
    This way we can handle cases where etab[eid].fo is a generic file handle 
too.
    Maybe the concern is on Line 9882 we have already called fclose on this 
file handle   (if its not stdout) ?
    This change is safe. You could think about whether it could be made more 
general. 


> odb crashed when extract single table using xml format in linux
> ---------------------------------------------------------------
>
>                 Key: TRAFODION-2104
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2104
>             Project: Apache Trafodion
>          Issue Type: Bug
>         Environment: centos6.7
> HBase 1.0.0 - cdh 5.4.8
>            Reporter: zhangliang
>            Assignee: zhangliang
>            Priority: Minor
>
> function pass and extract correct file, but odb crashed at last 
> Usecase : Extract single table using xml format
> Command : ./odb64luo -u trafodion -p traf123 -d traf -e 
> src=trafodion.odb_test_extract.person_e:tgt=output_data/ext_xml_%t.csv:rows=m10:fs=,:trim:sq=\":xml
> Result : failed
> During : 14s
> Details :
> Connected to Trafodion
> [0] odb(13001) [2016-07-07 16:58:37] - [Trafodion ODBC Driver][Trafodion 
> Database] SQL WARNING:*** WARNING[6008] Statistics for column (PID) from 
> table TRAFODION.ODB_TEST_EXTRACT.PERSON_E were not available. As a result, 
> the access path chosen might not be the best possible. [2016-07-07 16:58:17] 
> (State: 01000 Native Err: 6008)
> odb [2016-07-07 16:58:37]: starting ODBC connection(s)... 0
> [0] odb(3206) [2016-07-07 16:58:38] - [Trafodion ODBC Driver][Trafodion 
> Database] SQL WARNING:*** WARNING[6008] Statistics for column (PID) from 
> table TRAFODION.ODB_TEST_EXTRACT.PERSON_E were not available. As a result, 
> the access path chosen might not be the best possible. [2016-07-07 16:58:18] 
> (State: 01000 Native Err: 6008)
> [0] 29,704 records extracted
> [0] 59,408 records extracted
> [0] 89,112 records extracted
> [0] 118,816 records extracted
> [0] 148,520 records extracted
> [0] 178,224 records extracted
> [0] 207,928 records extracted
> [0] 237,632 records extracted
> [0] 267,336 records extracted
> [0] 297,040 records extracted
> [0] 326,744 records extracted
> [0] 356,448 records extracted
> [0] 386,152 records extracted
> [0] 415,856 records extracted
> [0] 445,560 records extracted
> [0] 475,264 records extracted
> [0] 504,968 records extracted
> [0] 534,672 records extracted
> [0] 564,376 records extracted
> [0] 594,080 records extracted
> [0] 623,784 records extracted
> [0] 653,488 records extracted
> [0] 683,192 records extracted
> [0] 712,896 records extracted
> [0] 742,600 records extracted
> [0] 772,304 records extracted
> [0] 802,008 records extracted
> [0] 831,712 records extracted
> [0] 861,416 records extracted
> [0] 891,120 records extracted
> [0] 920,824 records extracted
> [0] 950,528 records extracted
> [0] 980,232 records extracted
> [0] 1,000,000 records extracted
> sh: line 1: 34333 Segmentation fault      ./odb64luo -u trafodion -p traf123 
> -d traf -e 
> src=trafodion.odb_test_extract.person_e:tgt=output_data/ext_xml_%t.csv:rows=m10:fs=,:trim:sq=\":xml



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

Reply via email to