Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support single quotes nested in double quotes in SQL scripts [SPR-13218] #17809

Closed
spring-issuemaster opened this issue Jul 10, 2015 · 1 comment
Closed
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Jul 10, 2015

Nicolas Debeissat opened SPR-13218 and commented

Status Quo

Some databases (e.g., Oracle) permit double quoted column aliases that include case-sensitive characters, single quotes, and other special special characters.

For example, in the following SQL statement that is used to populate an embedded database from scripts with Spring, the single quote should not be interpreted as a literal.

select address as "programmer's address" from programmer

Analysis

Spring's ScriptUtils currently interprets a single quote nested in double quotes as the start of a string literal, causing the parsing of the SQL statement to fail.

Deliverables

  1. Ensure that single quotes nested in double quotes do not result in a parsing error.

Affects: 4.0.3

Reference URL: #835

Issue Links:

  • #19952 Oracle SQL hints are ignored as comments in ScriptUtils

Referenced from: commits 629bcb6

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jul 14, 2015

Sam Brannen commented

Completed as described in GitHub commit 649d145:

Support single quotes nested in double quotes in SQL scripts

Some databases such as Oracle permit double quoted column aliases that
contain case-sensitive characters, single quotes, and other special
characters; however, prior to this commit, SqlScripts interpreted a
single quote nested within double quotes as the start of a string
literal resulting in improper parsing.

This commit addresses this issue by ensuring that double quoted strings
such as column aliases are properly parsed even when containing single
quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.