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

Handle Oracle java source #800



Copy link

@dan-nawrocki dan-nawrocki commented Jul 14, 2014

I'm using flyway on a very large Oracle schema. One of the issues I found was that attempting to run a SQL script with embedded Java code caused the JDBC layer to interpret the Java code as a stored procedure, which obviously threw ORA- errors. The same SQL script runs fine in sqlplus.

This pull request has two parts. The first fixes the parsing code to look for the '/' delimiter after starting a Java block. The second is the addition of a flag to selectively turn on/off JDBC escape processing. I chose to use a Boolean for this to represent the three possible values for the JDBC escape processing flag: true=on, false=off, null=driver default. The way that it's currently written, JDBC escape processing can only be disabled for SQL parsed from a migration file; it is not used for the schema_version table updates as that was giving me some trouble.

Let me know if there's anything you'd like me to add in order to get this in to 3.1.

Copy link

@axelfontaine axelfontaine commented Aug 3, 2014

Hi Dan,

thanks for the pull request. I ended up disabling the escape processing for all statements (doesn't really make sense in Flyway's context anyway) and manually merging the rest of your code.

I've added you to the hall of fame page.

Keep up the great work,

axelfontaine added a commit that referenced this pull request Aug 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants