You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Anoop Sharma (JIRA)" <ji...@apache.org> on 2018/04/27 04:42:00 UTC

[jira] [Commented] (TRAFODION-3047) Cannot get right result using prepare statement with dynamic parameters

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

Anoop Sharma commented on TRAFODION-3047:
-----------------------------------------

Could you add more information to this jira?

By incorrect result, do you mean that the row matching '4C6A337943' is not returned? What is the default charset set to? Iso88591 or utf8?

What is the DDL of involved tables? What is the datatype of dom.std_area_id

What are the explain and explain options 'f' for the 2 statements? Are there differences between them?

Does this issue show up from sqlci or trafci or both?

From sqlci, if you do 'prepare...' followed by 'describe s1', what is the param typed as?

If you run with 'cqd query_cache '0' ' , does it show the issue?

> Cannot get right result using prepare statement with dynamic parameters
> -----------------------------------------------------------------------
>
>                 Key: TRAFODION-3047
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3047
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>            Reporter: Yang, Yongfeng
>            Assignee: Yang, Yongfeng
>            Priority: Major
>
> prepare s1 from SELECT (SELECT 'Y'
>  FROM dual
>  WHERE EXISTS (SELECT 1
>  FROM dic
>  WHERE std_area_id = dom.std_area_id)) impact_yn
> , (SELECT cd_nm
>  FROM code
>  WHERE lang_cd = 'zh_CN'
>  AND up_cd_id = '6023'
>  AND cd_id = dom.dom_type_cd) dic_gbn_nm
> FROM dom
> WHERE dom.std_area_id = ?
>  AND dom.dom_type_cd = '0003';
>  
>  
> execute s1 using '4C6A337943';
> can not get result with prepare statement. But can get the get the right result with following statement.
> prepare s1 from SELECT (SELECT 'Y'
>  FROM dual
>  WHERE EXISTS (SELECT 1
>  FROM dic
>  WHERE std_area_id = dom.std_area_id)) impact_yn
> , (SELECT cd_nm
>  FROM code
>  WHERE lang_cd = 'zh_CN'
>  AND up_cd_id = '6023'
>  AND cd_id = dom.dom_type_cd) dic_gbn_nm
> FROM dom
> WHERE dom.std_area_id = '4C6A337943'
>  AND dom.dom_type_cd = '0003';
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)