DbUp / dbup-oracle

Oracle provider for DbUp
MIT License
2 stars 5 forks source link

[DbUp.Oracle] Script fail when comment at end #3

Open Orkad opened 4 years ago

Orkad commented 4 years ago

Don't know if its only oracle related but in fact, if you try to run the following scripts : create table FOO (myid INT NOT NULL); -- this comment will fail the script create table FOO (myid INT NOT NULL); /* this comment will fail the script too */

the scripts will fail according to the oracle exception ORA-00900 invalid SQL statement.

DbUp consider the comment as SQL instruction in each cases.

sungam3r commented 4 years ago

What version do you use?

Orkad commented 4 years ago

4.3.0 (current latest)

Orkad commented 4 years ago

image

Actualy this simple test fail. Do you want a PR of that ?

sungam3r commented 4 years ago

Interesting. Perhaps this is due to \r\n absence at the end of script? It looks like a bug.

Orkad commented 4 years ago

Same problem with Environnement.NewLine at the end of script. I think the sql parser just split our script relative to the dialect delimiters. It will be interresting to remove comment from script before execution, or maybe detect if parsed text is a command.