[jira] [Updated] (HIVE-28162) Incorrect argument replacement of Hive JDBC

2024-03-29 Thread TakawaAkirayo (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-28162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

TakawaAkirayo updated HIVE-28162:
-
Description: 
1.Description:
SQLs contains '?' only in the double quote or comment will meet below issue:

 
{code:java}
java.sql.SQLException: Parameter #1 is unset
    at 
org.apache.hive.jdbc.HivePreparedStatement.updateSql(HivePreparedStatement.java:122)
    at 
org.apache.hive.jdbc.HivePreparedStatement.execute(HivePreparedStatement.java:89)
 
{code}
2.Reproduce Examples:

The sql might contain comments and the ? should be an invalid placeholder if 
it's within the comment block
{code:java}
select 
-- ? some comment
field_a,
field_b
from table_any{code}

  was:
1.Description:
SQLs contains '?' only in the double quote or comment will meet below issue:

 
{code:java}
java.sql.SQLException: Parameter #1 is unset
    at 
org.apache.hive.jdbc.HivePreparedStatement.updateSql(HivePreparedStatement.java:122)
    at 
org.apache.hive.jdbc.HivePreparedStatement.execute(HivePreparedStatement.java:89)
 
{code}
2.Reproduce Examples:

1)Below sql contains regex expression within double quote, the ? below should 
be an invalid parameter placeholder similar to the case that within single quote
{code:java}
select 
field_a 
from table_a 
where field_b rlike "[a-zA-Z]+?"{code}
2)The sql might contain comments and the ? should be an invalid placeholder if 
it's within the comment block
{code:java}
select 
-- ? some comment
field_a,
field_b
from table_any{code}


> Incorrect argument replacement of Hive JDBC
> ---
>
> Key: HIVE-28162
> URL: https://issues.apache.org/jira/browse/HIVE-28162
> Project: Hive
>  Issue Type: Bug
>Affects Versions: All Versions
>Reporter: TakawaAkirayo
>Assignee: TakawaAkirayo
>Priority: Major
>  Labels: pull-request-available
>
> 1.Description:
> SQLs contains '?' only in the double quote or comment will meet below issue:
>  
> {code:java}
> java.sql.SQLException: Parameter #1 is unset
>     at 
> org.apache.hive.jdbc.HivePreparedStatement.updateSql(HivePreparedStatement.java:122)
>     at 
> org.apache.hive.jdbc.HivePreparedStatement.execute(HivePreparedStatement.java:89)
>  
> {code}
> 2.Reproduce Examples:
> The sql might contain comments and the ? should be an invalid placeholder if 
> it's within the comment block
> {code:java}
> select 
> -- ? some comment
> field_a,
> field_b
> from table_any{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (HIVE-28162) Incorrect argument replacement of Hive JDBC

2024-03-29 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-28162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated HIVE-28162:
--
Labels: pull-request-available  (was: )

> Incorrect argument replacement of Hive JDBC
> ---
>
> Key: HIVE-28162
> URL: https://issues.apache.org/jira/browse/HIVE-28162
> Project: Hive
>  Issue Type: Bug
>Affects Versions: All Versions
>Reporter: TakawaAkirayo
>Assignee: TakawaAkirayo
>Priority: Major
>  Labels: pull-request-available
>
> 1.Description:
> SQLs contains '?' only in the double quote or comment will meet below issue:
>  
> {code:java}
> java.sql.SQLException: Parameter #1 is unset
>     at 
> org.apache.hive.jdbc.HivePreparedStatement.updateSql(HivePreparedStatement.java:122)
>     at 
> org.apache.hive.jdbc.HivePreparedStatement.execute(HivePreparedStatement.java:89)
>  
> {code}
> 2.Reproduce Examples:
> 1)Below sql contains regex expression within double quote, the ? below should 
> be an invalid parameter placeholder similar to the case that within single 
> quote
> {code:java}
> select 
> field_a 
> from table_a 
> where field_b rlike "[a-zA-Z]+?"{code}
> 2)The sql might contain comments and the ? should be an invalid placeholder 
> if it's within the comment block
> {code:java}
> select 
> -- ? some comment
> field_a,
> field_b
> from table_any{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)