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

[fbclient] Problem with too many number of columns in resultset. [CORE6246] #6490

Closed
firebird-automations opened this issue Feb 14, 2020 · 13 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @ibprovider

Relate to CORE6216

Attachments:
core-6246-test--queries-with-field-count-near-32k.7z

First query:
select x1.RDB$FIELD_NAME from RDB$FIELDS as x1

fbclient.dll returns subtype=3 for first column

Second query:
select x1.RDB$FIELD_NAME, x1.RDB$FIELD_NAME, /*100500 raz*/ ....,x1.RDB$FIELD_NAME from RDB$FIELDS as x1

fbclient.dll (isc_dsql_describe) returns subtype=0 for first column.

Commits: 3ee737c 7d2dca2

====== Test Details ======

Currently implemented only for FB 3.0.x. Waiting for fix CORE6216.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

What is /*100500 raz*/ .... ?

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Many many times ;-) I suspect more than 32K/64K is required, maybe the SQLDA index wraps around...

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: core-6246-test--queries-with-field-count-near-32k.7z [ 13424 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Consider three .sql scripts from attached file ("core-6246-test--queries-with-field-count-near-32k.7z").
There is a problem (may be related to thic ticket) in FB 3.0.6.33246, not only in 3.0.5:

1) for c6246-fields-count-32768.sql we get:

Statement failed, SQLSTATE = HY000
invalid request BLR at offset 9
-BLR syntax error: expected record selection expression clause at offset 10, encountered 38
After line 5 in file c6246-32k-fields-count-32768.sql

2) for c6246-fields-count-32767.sql its log will contain DIFFERENT charsets: zero for the first ~33109 fields, but then it will be 3:

32107: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 93 charset: 0 NONE
: name: RDB$FIELD_NAME alias: RDB$FIELD_NAME
: table: RDB$FIELDS owner: SYSDBA
32108: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 93 charset: 0 NONE
: name: RDB$FIELD_NAME alias: RDB$FIELD_NAME
: table: RDB$FIELDS owner: SYSDBA
32109: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 93 charset: 3 UNICODE_FSS
: name: RDB$FIELD_NAME alias: RDB$FIELD_NAME
: table: RDB$FIELDS owner: SYSDBA
32110: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 93 charset: 3 UNICODE_FSS
: name: RDB$FIELD_NAME alias: RDB$FIELD_NAME
: table: RDB$FIELDS owner: SYSDBA

3) for c6246-fields-count-32109.sql number of first lines with charset = 0 will be REDUCED for some reason to 31410, but then charset will be again 3:

31409: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 93 charset: 0 NONE
: name: RDB$FIELD_NAME alias: RDB$FIELD_NAME
: table: RDB$FIELDS owner: SYSDBA
31410: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 93 charset: 0 NONE
: name: RDB$FIELD_NAME alias: RDB$FIELD_NAME
: table: RDB$FIELDS owner: SYSDBA
31411: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 93 charset: 3 UNICODE_FSS
: name: RDB$FIELD_NAME alias: RDB$FIELD_NAME
: table: RDB$FIELDS owner: SYSDBA
31412: sqltype: 452 TEXT Nullable scale: 0 subtype: 0 len: 93 charset: 3 UNICODE_FSS
: name: RDB$FIELD_NAME alias: RDB$FIELD_NAME
: table: RDB$FIELDS owner: SYSDBA

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

PS.
On 4.0.0.1763 smallest script ("c6246-fields-count-32109.sql") can not be completed:

C:\FB\40SS\isql -q -i c6246-fields-count-32109.sql 1>c6246_4_0_0_1763-fields-count-32109.log
Statement failed, SQLSTATE = HY000
request size limit exceeded
After line 5 in file c6246-fields-count-32109.sql

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

I'm commiting the same fix in master but it does not fix the "request size limit exceeded" error. This error seems another type of error more related to CORE6216.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0.6 [ 10889 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Deferred

Test Details: Queries from attached .7z still have problems (both on 3.0.6 and 4.0.0).
Sent letter to Adriano (22.03.2020 13:40), waiting for reply.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue relate to CORE6216 [ CORE6216 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Deferred => Done with caveats

Test Details: Queries from attached .7z still have problems (both on 3.0.6 and 4.0.0).
Sent letter to Adriano (22.03.2020 13:40), waiting for reply.

=>

Currently implemented only for FB 3.0.x. Waiting for fix CORE6216.

@firebird-automations
Copy link
Collaborator Author

Commented by: @ibprovider

Tested. Now is ok.

Firebird Client Version: 3.0.6.33276.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

"request size limit exceeded" is not a bug here. In FB4, RDB$FIELD_NAME is wider than in FB3 (252 vs 31 bytes). Thus the whole query allocates ~10MB for output parameters and we have a hardcoded limit = 10MB for the statement size, hence the error.

We may either leave everything "as is"or raise the request size limit (to 100MB, for example).

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