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

Cannot execute PostgreSQL migration that contains "?" operator for jsonb #2329

Closed
alexander-semenets-dev opened this issue Mar 18, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@alexander-semenets-dev
Copy link

commented Mar 18, 2019

Which version and edition of Flyway are you using?

6.0.0-beta

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

Java API

Which database are you using (type & version)?

PostgreSQL 11

Which operating system are you using?

Windows 10

What did you do?

My migration contains script similar to this simplified code:

SELECT 1
WHERE '{ "field": 1 }'::jsonb ? 'field';
What did you expect to see?

Executed migration

What did you see instead?

Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Unable to parse statement in V20190318193024__test.sql at line 1 col 1: Unknown char ? encountered on line 2 at column 31

I investigated and debugged code of Parser java class and didn't found any logic for handling this operator.

If I am wrong in something please correct me. Thanks!

@alexander-semenets-dev

This comment has been minimized.

Copy link
Author

commented Mar 19, 2019

Part of stack trace:
Caused by: org.flywaydb.core.api.FlywayException: Unknown char ? encountered on line 2 at column 31
at org.flywaydb.core.internal.parser.Parser.readToken(Parser.java:453)
at org.flywaydb.core.internal.parser.Parser.getNextStatement(Parser.java:149)

@axelfontaine

This comment has been minimized.

Copy link
Contributor

commented Apr 9, 2019

Good catch and many thanks for the clear steps how to reproduce. We did indeed miss this case. Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.