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

ORA-00911: Invalid character on 'From' #1080

Closed
MingoDynasty opened this issue Aug 11, 2015 · 4 comments
Closed

ORA-00911: Invalid character on 'From' #1080

MingoDynasty opened this issue Aug 11, 2015 · 4 comments

Comments

@MingoDynasty
Copy link

@MingoDynasty MingoDynasty commented Aug 11, 2015

[ERROR] SQL State : 22019
[ERROR] Error Code : 911
[ERROR] Message : ORA-00911: invalid character

Taken from the Flyway First Steps documentation:

File V1__foo.sql:
create table PERSON (
ID int not null,
NAME varchar(100) not null
);

File V2__bar.sql:
insert into PERSON (ID, NAME) values (1, 'From');
insert into PERSON (ID, NAME) values (2, 'Mr. Foo');
insert into PERSON (ID, NAME) values (3, 'Ms. Bar');

Flyway fails to execute the first line of V2__bar.sql, because of the 'From' word. Changing it to anything else works. Tried Flyway 3.2.1 and 3.2; both have the issue. I tried Flyway 3.1 and did not encounter this issue.

@SCHERPEREEL
Copy link

@SCHERPEREEL SCHERPEREEL commented Sep 3, 2015

When the label starts with "Then" we have the same error
insert into PERSON (ID, NAME) values (1, 'Thendkdkdkdkdk");

@aetelani
Copy link

@aetelani aetelani commented Sep 3, 2015

Different capitalization doesn't seem to help either. Had to downgrade flyway to 3.1

@lzuyderhoff
Copy link

@lzuyderhoff lzuyderhoff commented Sep 11, 2015

Same issue for me with a label ending with the character 'N'.

After debugging flyway:migrate (Version 3.2), I think the problem comes from the method : OracleSqlStatementBuilder.cleanToken(String token);

Looking at the code I think the bug can occur if one the following conditions applies on the label :
starts with : USING or THEN or FROM
AND/OR
ends with : N or IF of ELSIF or SELECT or IMMEDIATE or RETURN or IS

I hope it can helps.

ysobj added a commit to ysobj/flyway that referenced this issue Sep 18, 2015
@ysobj ysobj mentioned this issue Sep 18, 2015
@axelfontaine axelfontaine added this to the Flyway 4.0 milestone Oct 3, 2015
axelfontaine added a commit that referenced this issue Oct 3, 2015
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Oct 3, 2015
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Oct 3, 2015

Thank you reporting and investigating and thank you @ysobj for the fix!

Merged.

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
5 participants