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
CHAR(32767) present in XSQLVAR with length 32765 [CORE3569] #3923
Comments
Commented by: @ibprovider Additional information: use connection charset ASCII |
Modified by: @ibproviderVersion: 2.5.1 [ 10333 ] |
Commented by: @dyemanov A bit simpler test case demonstrating the same issue: select 'aaa....a' /* 32766 or 32767 single-byte chars */ from rdb$database |
Modified by: @dyemanovassignee: Dmitry Yemanov [ dimitr ] |
Modified by: @dyemanovstatus: Open [ 1 ] => In Progress [ 3 ] |
Modified by: @dyemanovstatus: In Progress [ 3 ] => Open [ 1 ] |
Modified by: @dyemanovstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.1.5 [ 10420 ] Fix Version: 2.5.2 [ 10450 ] Fix Version: 3.0 Alpha 1 [ 10331 ] |
Commented by: @pavel-zotov Regression has occured somewhere after 3.0 Beta1. Ticket should be reopened. Consider following script (its text and logs for 2.5 and 3.0 Alpha1, Alpha2 & Beta1 - see in attach): show version; -- Following literal has length = 32766 bytes -- Following literal has length = 32767 bytes Results are fine on: WI-V2.5.5.26909, WI-T3.0.0.30566 (alpha-1), WI-T3.0.0.30809 (alpha-2) and WI-T3.0.0.31374 (beta-1). -SQL error code = -104 |
Modified by: @pavel-zotovAttachment: core_3569-script-and-logs.zip [ 12778 ] |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: Done with caveats Test Details: Test has been added despite on regression in current FB-3 version. When it will be fixed test should work w/o errors. |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] Test Details: Test has been added despite on regression in current FB-3 version. When it will be fixed test should work w/o errors. => Test has been added (13-JUL-2015) despite on regression in current FB-3 version. When it will be fixed test should work w/o errors. |
Commented by: @asfernandes What's the problem? That part of the output you had does not match your input? |
Commented by: @dyemanov Adriano, the problem is that Parser.cpp rejects strings longer than 32565 bytes but a string literal is CHAR and hence should be limited by 32767 bytes instead. One needs to replace MAX_COLUMN_SIZE - sizeof(USHORT) with MAX_COLUMN_SIZE. |
Commented by: @pavel-zotov One more issue, now about multi-byte lines with octet-length near limit 32768 bytes. Correct me, please, if following should be moved to separate ticket. set names utf8; set list on; select s_nocset, octet_length(s_nocset) nocs_octets, char_length(s_nocset) nocs_chars select s_utf8, octet_length(s_utf8) utf8_octets, char_length(s_utf8) utf8_chars When number of octets in text literals is >= 32765 one may see that: 2) 3.0 Beta1 reports: 3) 3.0 RC1 (WI-V3.0.0.31929) fails when octet_length >= 32766 but for 32765 it reports also sqllen = 62684 - as 3.0 Beta1. See attached file ( long-literals-sqlda.zip ) for script and results. |
Modified by: @pavel-zotovAttachment: long-literals-sqlda.zip [ 12779 ] |
Commented by: @asfernandes Max valid length was incresed from 32765 to 32767 bytes (see CORE4781). Problem related in last comment about UTF-8: I do not see an alternative other than limit its max character length to 8191 like it's checked for columns. What do you think? |
Commented by: @pavel-zotov Adriano, am I correct that issue about wrong values in SQLDA for multi-byte literals is still unresolved ? Because this: select s_utf8, octet_length(s_utf8) utf8_octets, char_length(s_utf8) utf8_chars -- still produces (when set sqlda_display on): 01: sqltype: 452 TEXT scale: 0 subtype: 0 len: 62684 charset: 4 UTF8 -- when characters: 15671; octets: 32765 or 32766 (as of "characters: 15672; octets: 32768" - exception, i.e. now result is expected). I see that 62684 is result of 15671 * 4 and 62688 = 15672 * 4, but why this formula is applied ? Even if I enclose text inside TRIM(), this multiplying on 4 still continuing: select trim(s_utf8) s_utf8, octet_length(trim(s_utf8)) utf8_octets, char_length(trim(s_utf8)) utf8_chars INPUT message field count: 0 OUTPUT message field count: 3 S_UTF8 ÃÂÁÀÄÅÇØßÐÑÞÆŠŒŽÑØßŁ€∑à|
Commented by: @asfernandes "* 4" is the same value you get if you select a CHAR(N) column. It should not matter if the text is a literal or a column, sqllen should have the max. length in bytes for the given N-character-length. |
Commented by: @pavel-zotov One more question. Script-1 (name=`c3569.ch_none.sql`):-- NO clause `set names utf8` here! select s_utf8, octet_length(s_utf8) utf8_octets, char_length(s_utf8) utf8_chars select s_utf8, octet_length(s_utf8) utf8_octets, char_length(s_utf8) utf8_chars
|
Modified by: @pavel-zotovAttachment: c3569-results-for-long-literals-when-connection-charset-is-none-vs-utf8.zip [ 12780 ] |
Submitted by: @ibprovider
Is related to QA470
Attachments:
core_3569-script-and-logs.zip
long-literals-sqlda.zip
c3569-results-for-long-literals-when-connection-charset-is-none-vs-utf8.zip
Hi
CREATE TABLE TBL_LARGE2_CH_32767 (
LARGE_TEXT CHAR(32767) CHARACTER SET WIN1251
);
IBExpert:
"select * from TBL_LARGE2_CH_32767"
Size of LARGE_TEXT is 32765
Commits: 7c14588 54747cb 5c72175
====== Test Details ======
Test has been added (13-JUL-2015) despite on regression in current FB-3 version. When it will be fixed test should work w/o errors.
The text was updated successfully, but these errors were encountered: