Fredy Wijaya has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/12052


Change subject: IMPALA-7939: Fix issue where CTE is categorized as DML statement
......................................................................

IMPALA-7939: Fix issue where CTE is categorized as DML statement

The logic that checks whether a CTE is DML or SELECT uses shlex that
splits the statement into tokens and check if any of the tokens matches
the DML regular expression. Before this patch, the shlex was set to
posix=True, which means the quotes are stripped from the token, e.g.
select a from foo where a = 'update' becomes
['select', 'a', 'from', 'foo', 'where', 'a', '=', 'update'].

This patch fixes the issue by setting posix=False in shlex that
preserves the quotes.
['select', 'a', 'from', 'foo', 'where', 'a', '=', '"update"']

Testing:
- Added a new shell test
- Ran all shell tests

Change-Id: I011b8e73a0477ac6b2357725452458f972785ae7
---
M shell/impala_shell.py
M tests/shell/test_shell_interactive.py
2 files changed, 11 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/52/12052/2
--
To view, visit http://gerrit.cloudera.org:8080/12052
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I011b8e73a0477ac6b2357725452458f972785ae7
Gerrit-Change-Number: 12052
Gerrit-PatchSet: 2
Gerrit-Owner: Fredy Wijaya <[email protected]>

Reply via email to