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

SQL*Plus @ with file path fails to load correct file #2383

Closed
KiruthikaSS opened this issue May 10, 2019 · 4 comments
Closed

SQL*Plus @ with file path fails to load correct file #2383

KiruthikaSS opened this issue May 10, 2019 · 4 comments

Comments

@KiruthikaSS
Copy link

@KiruthikaSS KiruthikaSS commented May 10, 2019

Which version and edition of Flyway are you using?

Flyway Pro Edition (trial) 5.2.4

If this is not the latest version, can you reproduce the issue with the latest one as well?

(Many bugs are fixed in newer releases and upgrading will often resolve the issue)

NA

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Java API

Which database are you using (type & version)?

Oracle RDS Instance Engine version: 12.2.0.1.ru-2019-01.rur-2019-01.r1

Which operating system are you using?

Windows 10

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)

I am using flyway pro with oracleSqlplus enabled. I created a folder structure to organize scripts based on objects. Trying to use @ (with path) in the flyway version scripts, which is not working.

folder structure,

db/migration/
- topFolder
    -folderA
        -AScript.sql
    -folderB
        -BScript.sql
    -folderCommon
        -AScript.sql
    -V1__ASCRIPT.sql
    -V2__BSCRIPT.sql
    -V3__ASCRIPT.sql

Content of:
V1__ASCRIPT.sql
@AScript.sql -> Which executes topFolder/folderA/Ascript.sql
V2__BScript.sql
@BScript.sql -> Which executes topFolder/folderB/Bscript.sql
V3__ASCRIPT.sql
@topFolder/folderCommon/AScript.sql -> Which is throwing me below error, org.flywaydb.core.api.FlywayException: SP2-0310: unable to open file "topFolder/folderCommon/AScript.sql"

What did you expect to see?

In V3__ASCRIPT.sql
@topFolder/folderCommon/AScript.sql
It should execute the AScript.sql from the folderCommon
NOTE: If @AScript.sql is given in V#__ASCRIPT.sql, then it is executing the topFolder/folderA/Ascript.sql

What did you see instead?

org.flywaydb.core.api.FlywayException: SP2-0310: unable to open file "topFolder/folderCommon/AScript.sql"

@axelfontaine axelfontaine added this to the Flyway 6.0.0 milestone May 10, 2019
@axelfontaine axelfontaine changed the title Getting FlywayException: SP2-0310: unable to open file - when sqlpus @ is used with file path SQL*Plus @ with file path fails to load correct file May 21, 2019
axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue May 21, 2019
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented May 21, 2019

Thank you very much for investigating and submitting the detailed report. We indeed incorrectly ignored the path. This has now been fixed.

This now also means that you now need to add a path where it was previously missing, but erroneously working such as in V1__ASCRIPT.sql which should now contain @topFolder/folderA/Ascript.sql instead of @AScript.sql.

@KiruthikaSS
Copy link
Author

@KiruthikaSS KiruthikaSS commented May 22, 2019

Thanks a lot Axel. Is there a way, I can use it now? 6.0.0-beta pro version is available? plz let me know.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented May 22, 2019

There is no public release yet. If you are a Pro or Enterprise Edition customer, you can contact us at your support email address and we'll send you a pre-release build.

@axelfontaine axelfontaine removed this from the Flyway 6.0.0 milestone May 22, 2019
@axelfontaine axelfontaine added this to the Flyway 6.0.0-beta2 milestone May 22, 2019
@rangaprasad557
Copy link

@rangaprasad557 rangaprasad557 commented Jan 28, 2020

Is this fix part of latest flyway version flyway-6.2.0? Still I could see same issue in flyway-6.2.0

dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
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
3 participants