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

Init script parsing issue of line endings on windows #1465

Closed
Mawster opened this issue May 14, 2019 · 3 comments
Closed

Init script parsing issue of line endings on windows #1465

Mawster opened this issue May 14, 2019 · 3 comments

Comments

@Mawster
Copy link

Mawster commented May 14, 2019

Hi guyz,

I'm working on a windows machine and the files of the project have windows line endings. We have a script which should initialize our oracle database - so we added the "withInitScript" option on container start.

As soon as the initialization starts we get the following error:
java.sql.SQLException: Invalid SQL type: sqlKind = UNINITIALIZED

So I tried just a little test statement:
CREATE TABLE Persons ( PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255) );

Still the same error. So I debugged into the code and found the Problem:
The last statement which should be executed was:
\r
and so the init script failed.

After switching from CRLF to LF everything works, but I would say also Windows line endings should be handled properly?

It should be just a small change in ScriptUtils.java Line 186 ?

@kiview
Copy link
Member

kiview commented May 14, 2019

Thanks for raising the issue and investigating the problem @Mawster.
I don't think the problem is in line 186 though, since this code handles comments (although this is also a problem there).

We probably need to add \r in line 209 as well.

Would you like to contribute this, since you can directly test this on your machine?

@ppfeiler
Copy link
Contributor

@kiview I tried to fix it. My tests are now working.

@rnorth rnorth added this to the next milestone May 20, 2019
@rnorth
Copy link
Member

rnorth commented May 21, 2019

Fix released in 1.11.3.

@rnorth rnorth closed this as completed May 21, 2019
@rnorth rnorth modified the milestones: next, 1.11.3 May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants