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

Zhichun Wu commented on NIFI-5852:
----------------------------------

The issue still exists in 1.13.2. 
[getQueries|https://github.com/apache/nifi/blob/rel/nifi-1.13.2/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractExecuteSQL.java#L479]
 method should be enhanced with consideration of:
 # quotes like `WHERE "field;name" = 'some;value'`
{color:#c1c7d0}Note: in addition to single quotes and double quotes, backticks 
can be used in some databases too.{color}
 # single-line / multi-line comments like `--test;` and `/* test; */`
{color:#c1c7d0}Note: database like Cassandra supports single-line comments 
using double slash; and ClickHouse/PostgreSQL supports nested multi-line 
comments.{color}

Can we enhance the method to address most common cases? Then adding dialects as 
needed to support more database-specific features.


Let me know if you're good with the proposal and I can create a PR for the 
enhancement.

> ExecuteSQL Pre/Post SQL Don't Allow Semicolons in String Literals
> -----------------------------------------------------------------
>
>                 Key: NIFI-5852
>                 URL: https://issues.apache.org/jira/browse/NIFI-5852
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Peter Wicks
>            Priority: Minor
>
> In NIFI-5780 pre/post SQL statements were added to ExecuteSQL. If the SQL 
> statement contains a string constant, like `WHERE field='some;value'` then 
> the code breaks because it splits on semicolons no matter where they appear.
> Some form of smarter string parsing would allow for semicolons to appear 
> inside of strings.
> [~deonashh]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to