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 error message (column number) if the empty SQL string is prepared [CORE1620] #2041

Closed
firebird-automations opened this issue Nov 26, 2007 · 13 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Kuznetsov Eugene (eugene)

Is related to QA538

Next script

set term ^ ;
create procedure test_es1 as begin execute statement ''; end^
set term ; ^
commit;
execute procedure test_es1;

returns (example for 2.1.0.17176)

Statement failed, SQLCODE = -104
Dynamic SQL Error
-SQL error code = -104
-Unexpected end of command - line 1, column 6795595
-At procedure 'TEST_ES1' line: 1, col: 36

where column value is invalid

Best regards, Eugene

Commits: b6e3e10

@firebird-automations
Copy link
Collaborator Author

Commented by: Claudio Valderrama C. (robocop)

Disconnecting and reconnecting many times to do
execute procedure test_es1;
on each attachment shows that the column number changes randomly, hence it seems uninitialized var.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 13513 ] => Firebird [ 14090 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

I'm wondering what is more correct for this case: "line 0, column 0" or "line 1, column 1".

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Kuznetsov Eugene (eugene)

To Dmitry Yemanov
The same as for empty DSQL query, of course.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

This *is* an empty DSQL query :-) Perhaps more logical would be to throw some special error, e.g. "cannot prepare empty statement".

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

It seems I have already found the answer. We have now:

if \(\!string\)
\{
	ERRD\_post\(Arg::Gds\(isc\_sqlerr\) << Arg::Num\(\-104\) <<
			  // Unexpected end of command
			  // CVC: Nothing will be line 1, column 1 for the user\.
			  Arg::Gds\(isc\_command\_end\_err2\) << Arg::Num\(1\) << Arg::Num\(1\)\);
\}

i.e. "line 1, column 1" is reported when the user passes the NULL pointer. I believe it should be extended to handle the valid pointer but zero string length, so that the issue would be resolved automagically.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Version: 2.5.0 [ 10221 ]

Version: 2.0.6 [ 10303 ]

Version: 3.0 Initial [ 10301 ]

Version: 2.1.3 [ 10302 ]

Version: 2.1.2 [ 10270 ]

Version: 2.0.5 [ 10222 ]

Version: 2.1.1 [ 10223 ]

Version: 2.0.4 [ 10211 ]

Version: 2.1.0 [ 10041 ]

summary: Incorrect error message if ES contains empty string => Incorrect error message (column number) if the empty SQL string is prepared

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA538 [ QA538 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

Test created.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment