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

Incorrect column in error message for "Unexpected end of command" [CORE4816] #5114

Open
firebird-automations opened this issue May 29, 2015 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Maxim Kuzmin (cybermax)

Query:
------------------------------------------
SELECT
T.*
FROM
(SELECT
'1'
FROM
RDB$DATABASE

-- Comment
-- Comment
-- Comment
-- Comment
------------------------------------------

Prepare failed with message:
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Unexpected end of command - line 12, column 9.

Column 9 is wrong, since it is in the middle of a comment.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

What a useful bug report!!!!

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Sean, what details do you need?

-- Comme<column-9-is-here>nt

Unexpected end of command is expected to be detected at the end-of-line, i.e. column 11. This means the error message is misleading.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

priority: Minor [ 4 ] => Trivial [ 5 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

I didn't count the columns, and 11 is wrong as well, so my observation.

We can't report something is lacking on this line after the comment, so it should be in the next (non-existent) line, or before all the comments.

* A simple solution may be append a \n before parse.

So, it's a bug, yes, but this tracker is currently very noise. We have so many artificial bugs, comming from users and internally as well.

* More funny results happens:

SQL> SELECT
CON> T.*
CON> FROM
CON> (SELECT
CON> '1'
CON> FROM
CON> RDB$DATABASE
CON>
CON> -- Comment
CON> -- Comment
CON> -- Comment
CON> -- Comment
CON>
CON>
CON>
CON> ;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Unexpected end of command - line 15, column 9
-syntax error

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

1 participant