Repository navigation
Fix #9222: Use oldFormat text type for ttype_dynamic text items in DsqlDmlRequest::metadataToFormat - #9223
Fix #9222: Use oldFormat text type for ttype_dynamic text items in DsqlDmlRequest::metadataToFormat#9223mariuz wants to merge 3 commits into
Conversation
…uest::metadataToFormat Restore the ttype_dynamic -> ttype_none reset for text items in DSQL message metadata (originally in DsqlRequest::parseMetadata before FirebirdSQL#8145) so clients that encode SQL_TEXT/SQL_VARYING with plain blr_text/blr_varying do not fail with string right truncation or malformed string on NONE/OCTETS columns over multi-byte connection charsets.
|
I would move this code a couple lines up in order not to call |
|
I wonder if my suggestion did break the case when non-text field is requested as text. May be it worth check that old format is also text and otherwise fallback to |
When a non-text item (such as BLOB SUB_TYPE TEXT) is requested or bound as plain blr_text/blr_varying (ttype_dynamic), GEN_port has not scaled sqllen by the connection charset's bytes-per-char. Check oldDesc.isText() and fall back to ttype_none when oldDesc is not text.
|
@aafemt Good catch! While Updated in c19ad55 to check |
Fixes #9222
Summary
In Firebird 2.5 through 5.0,
DsqlRequest::parseMetadataresetttype_dynamic(CS_dynamic) tottype_none(CS_NONE) for text items in DSQL message metadata so that clients encodingSQL_TEXT/SQL_VARYINGusing plainblr_text/blr_varying(whichMetadataFromBlrmaps toCS_dynamic) would not fail with string truncation or validation errors onNONE/OCTETScolumns over multi-byte connection charsets.When
parseMetadataandmapInOutwere replaced byDsqlDmlRequest::metadataToFormatin #8145 (11d5d59), that reset was dropped, causing wire-protocol clients that send plainblr_text/blr_varyingto fail on Firebird 6.0 with:string right truncation (expected length N/4, actual M)when fetchingCHARACTER SET NONE/OCTETS/ASCIIcolumns (including system columns likeRDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_TYPE) overUTF8.Malformed stringwhen fetching or bindingOCTETSor non-UTF8NONEdata overUTF8.This PR restores the
ttype_dynamic→ttype_nonereset inDsqlDmlRequest::metadataToFormat.