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

FBScript thinks that a comment at the end of a script file is a valid command [DNET688] #640

Closed
firebird-automations opened this issue Jul 7, 2016 · 5 comments

Comments

@firebird-automations
Copy link

Submitted by: Ralf Jansen (ralf jansen)

Example Script:

/* Pre comment */
UPDATE TABLE SET Field= 'HelloWorld' WHERE Id = 1;
/*Post comment */

In this case FbScript.Parse() will try to parse the post comment as command and throws a ""The type of the SQL statement could not be determined..." ArgumentException.

Workaround : Don't have a comment at the end of a script.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Author

Commented by: @cincuranet

Yes. The problem is what to do with trailing comment with no command... It might be some custom hint to be handled i.e. in UnknownStatement event.

And also. You can set the UnknownStatementArgs.Ignore and it's solved.

@firebird-automations
Copy link
Author

Commented by: Ralf Jansen (ralf jansen)

Yep. That helps also. Thanks.

Workaround:

FbScript fbscript = new FbScript(upgradeScript);
fbscript.UnknownStatement += (sender, args) => { args.Ignore = true; };
fbscript.Parse();

@firebird-automations
Copy link
Author

Commented by: @cincuranet

OK. I have also added notice about the event to the exception message.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: In Progress [ 3 ] => Closed [ 6 ]

resolution: Won't Fix [ 2 ]

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

2 participants