[
https://issues.apache.org/jira/browse/HIVE-11723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14906711#comment-14906711
]
Yongzhi Chen commented on HIVE-11723:
-------------------------------------
With the fix, the string literal in values clause is consistent with other
string literals in a query. For example, after the fix, the following two
inserts will have same behavior: insert Cooper's to the final table. Before the
fix only the second statement insert Cooper's, the first insert Cooper\'s.
{noformat}
insert into t_hive VALUES ('Cooper\'s');
insert into t_hive select 'Cooper\'s' from src limit 1;
{noformat}
How do you think [~szehon]?
> Incorrect string literal escaping
> ---------------------------------
>
> Key: HIVE-11723
> URL: https://issues.apache.org/jira/browse/HIVE-11723
> Project: Hive
> Issue Type: Bug
> Affects Versions: 1.2.0, 1.1.1, 2.0.0
> Reporter: Uri Laserson
> Assignee: Yongzhi Chen
> Attachments: HIVE-11723.1.patch
>
>
> When I execute the following queries
> {code}
> CREATE TABLE t_hive (f1 STRING);
> INSERT INTO t_hive VALUES ('Cooper\'s');
> SELECT * FROM t_hive;
> {code}
> via the Hive shell or through HiveServer2 directly (via impyla), I would
> expect that the result to be
> {code}
> Cooper's
> {code}
> but instead I actually get
> {code}
> Cooper\'s
> {code}
> Actually, I'm not sure how that {{INSERT}} query is not even a syntax error.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)