Issue Details (XML | Word | Printable)

Key: CORE-6246
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Kovalenko Dmitry
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

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

Created: 14/Feb/20 11:33 AM   Updated: 01/Apr/20 07:12 AM
Component/s: API / Client Library
Affects Version/s: 3.0.5
Fix Version/s: 3.0.6

File Attachments: 1. File core-6246-test--queries-with-field-count-near-32k.7z (14 kB)

Issue Links:
Relate
 

QA Status: Done with caveats
Test Details: Currently implemented only for FB 3.0.x. Waiting for fix CORE-6216.


 Description  « Hide
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.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 14/Feb/20 02:47 PM
What is /*100500 raz*/ .... ?

Dmitry Yemanov added a comment - 14/Feb/20 04:36 PM
Many many times ;-) I suspect more than 32K/64K is required, maybe the SQLDA index wraps around...

Pavel Zotov added a comment - 14/Feb/20 06:05 PM
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


Pavel Zotov added a comment - 14/Feb/20 06:07 PM
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


Adriano dos Santos Fernandes added a comment - 22/Mar/20 01:40 AM
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 CORE-6216.

Kovalenko Dmitry added a comment - 31/Mar/20 05:35 AM
Tested. Now is ok.

Firebird Client Version: 3.0.6.33276.

Dmitry Yemanov added a comment - 01/Apr/20 07:12 AM
"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).