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::Translator::Parser::Oracle fails to parse DROP statement #89

Open
jgrg opened this issue Apr 28, 2017 · 1 comment
Open

SQL::Translator::Parser::Oracle fails to parse DROP statement #89

jgrg opened this issue Apr 28, 2017 · 1 comment

Comments

@jgrg
Copy link

jgrg commented Apr 28, 2017

On line 137 of SQL::Translator::Parser::Oracle, the grammar rule:

drop : /drop/i WORD(s) NAME WORD(s?) ';'

fails to match if table names aren't surrounded with quotes because WORD(s) matches to the end and NAME has nothing left to match.

@trentfisher
Copy link

I just happened upon this problem. I boiled it down to this reproduction:

$  echo "drop table foo;" |sqlt -f Oracle -t SQLite
       ERROR (line 1): Invalid statement: Was expecting remark, or run, or
                       prompt, or create, or table comment, or comment on
                       table, or comment on column, or alter, or drop
Error: translate: Error with parser 'SQL::Translator::Parser::Oracle': Parse failed.

Replace "Oracle" with "SQLite" and it works.

Changing WORD(s) to WORD in the line noted previously made it work, though I'm not sure that's the correct solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants