Varchar computed column length stores incorrect and invalid values for field
----------------------------------------------------------------------------
Key: CORE-5857
URL: http://tracker.firebirdsql.org/browse/CORE-5857
Project: Firebird Core
Issue Type: Bug
Affects Versions: 4.0 Alpha 1
Environment: Firebird-4.0.0.1028-0_x64 windows
Reporter: Mark Rotteveel
When creating a computed column, the wrong values are stored in RDB$FIELDS for
RDB$FIELD_LENGTH, RDB$CHARACTER_SET_ID (and possibly RDB$COLLATION_ID). This
produces an invalid length, and applies the wrong character set.
Reproduction (in a database with UTF8 as default characte set):
CREATE TABLE TEST_COLUMN_METADATA (
col_varchar_default_user VARCHAR(100) DEFAULT USER,
col_varchar_default_literal VARCHAR(100) DEFAULT 'literal',
col_varchar_generated VARCHAR(200) COMPUTED BY (col_varchar_default_user ||
' ' || col_varchar_default_literal)
)
RDB$FIELDS for these columns have
RDB$FIELD_LENGTH = 400 and RDB$CHARACTER_SET_ID = 4 for
col_varchar_default_user and col_varchar_default_literal
For col_varchar_generated, RDB$FIELD_LENGTH = -2 which will likely break any
tools that uses the length, and RDB$CHARACTER_SET_ID = 0 (NONE) instead of the
expected values of 400 (length) and 4 (character set).
In Firebird 3.0.3, this works as expected.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel