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

ISQL input command (or -i option) reads large (> 64K) lines incorrectly [CORE4882] #5176

Closed
firebird-issue-importer opened this issue Jul 22, 2015 · 10 comments

Comments

@firebird-issue-importer

Submitted by: @asfernandes

Attachments:
comment-100mb.sql.zip
sql-command-with-huge-comment-about-compiler-implementation-limit.zip

ISQL breaks large lines (possibly inside a string) in multiple lines.

Commits: 442388d FirebirdSQL/fbt-repository@660dd72

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 22, 2015

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 27, 2015

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 RC 1 [ 10584 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 30, 2015

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 30, 2015

Modified by: @pavel-zotov

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

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 25, 2015

Commented by: @pavel-zotov

I've found that following sample still can`t be compiled:

set term ^;
create or alter procedure sp_test1 as
begin
exit;
end -- blah-blah-blah-1
^

create or alter procedure sp_test2 as
begin
exit;
end /*/* blah-blah-blah-2 *//*/* blah-blah-blah-2 */ ......... repeating these dummy comment all in single line, up-to... 100 Megabyte :-)
^

Both on 32 and 64 bit (build #⁠ 3.0.0.32008) following error is produced:

Expected end of statement, encountered EOF

Packed script please see in attach.

PS. Is this somehow relate to this ticket or to recently fixed CORE4890 ? or this completely new bug ?

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 25, 2015

Modified by: @pavel-zotov

Attachment: comment-100mb.sql.zip [ 12799 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 25, 2015

Commented by: @pavel-zotov

It seems that maximal size of single SQL statement that can be successfully compiled is 10 590 614 bytes.
After that value, when size is 10 590 615 or 10 590 616 bytes, compiler raises "Single isql command exceeded maximum buffer size".
And when size is 10 590 617 bytes and more it produces "Expected end of statement, encountered EOF".

AFAIR, hard-coded limit is 10 Mb, i.e. 10 485 760. How this limit can be exeeded (see attahed "sql-command-with-huge-comment-about-compiler-implementation-limit.zip", file huge-comment-max-can-be-compiled-ok.sql with size 10590614) ?
And why different messages appear when sql statement exceeded upper bound ?

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 25, 2015

Modified by: @pavel-zotov

Attachment: sql-command-with-huge-comment-about-compiler-implementation-limit.zip [ 12800 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 25, 2015

Commented by: @dyemanov

The 10MB limit does not raise any error, it just truncates the SQL string. So the error message could really be different, depending on what grammar rule is incomplete. If you don't like that, we may raise "implementation limit exceeded" instead.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 26, 2015

Commented by: @pavel-zotov

IMHO compiler should produce only one message ("implementation limit exceeded") in any case, regardless of input string length.

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