
If you were logged in you would be able to see more operations.
|
|
|
Environment:
|
Firebird-4.0.0.1040-0_x64 Windows
|
Issue Links:
|
Duplicate
|
This issue duplicates:
|
|
CORE-2228
rdb$fiels.rdb$character_length is 0 for varchar computed fields
|
|
|
|
|
|
|
|
QA Status: |
Done successfully
|
When defining a computed column with an explicit type, the RDB$FIELDS.RDB$CHARACTER_LENGTH is populated. Doing the same without an explicit length leaves this column NULL.
Reproduction (using default character set UTF8):
CREATE TABLE TEST_COLUMN_METADATA (
col_varchar_default_user VARCHAR(100) DEFAULT USER,
col_varchar_default_literal VARCHAR(100) DEFAULT 'literal',
col_varchar_generated_explicit VARCHAR(201) COMPUTED BY (col_varchar_default_user || ' ' || col_varchar_default_literal),
col_varchar_generated_implicit COMPUTED BY (col_varchar_default_user || ' ' || col_varchar_default_literal)
)
col_varchar_generated_explicit will have
RDB$FIELDS.RDB$FIELD_LENGTH = 804
RDB$FIELDS.RDB$FIELD_TYPE = 37
RDB$CHARACTER_LENGTH = 201
RDB$CHARACTER_SET_ID = 4
col_varchar_generated_implicit however has:
RDB$FIELDS.RDB$FIELD_LENGTH = 804
RDB$FIELDS.RDB$FIELD_TYPE = 37
RDB$CHARACTER_LENGTH = NULL (0 in 2.5.8)
RDB$CHARACTER_SET_ID = 4
Based on the information available, Firebird should be able to populate RDB$CHARACTER_LENGTH with 201 for the implicit type as well.
|
Description
|
When defining a computed column with an explicit type, the RDB$FIELDS.RDB$CHARACTER_LENGTH is populated. Doing the same without an explicit length leaves this column NULL.
Reproduction (using default character set UTF8):
CREATE TABLE TEST_COLUMN_METADATA (
col_varchar_default_user VARCHAR(100) DEFAULT USER,
col_varchar_default_literal VARCHAR(100) DEFAULT 'literal',
col_varchar_generated_explicit VARCHAR(201) COMPUTED BY (col_varchar_default_user || ' ' || col_varchar_default_literal),
col_varchar_generated_implicit COMPUTED BY (col_varchar_default_user || ' ' || col_varchar_default_literal)
)
col_varchar_generated_explicit will have
RDB$FIELDS.RDB$FIELD_LENGTH = 804
RDB$FIELDS.RDB$FIELD_TYPE = 37
RDB$CHARACTER_LENGTH = 201
RDB$CHARACTER_SET_ID = 4
col_varchar_generated_implicit however has:
RDB$FIELDS.RDB$FIELD_LENGTH = 804
RDB$FIELDS.RDB$FIELD_TYPE = 37
RDB$CHARACTER_LENGTH = NULL (0 in 2.5.8)
RDB$CHARACTER_SET_ID = 4
Based on the information available, Firebird should be able to populate RDB$CHARACTER_LENGTH with 201 for the implicit type as well. |
Show » |
|
CORE-2228, but it might be better to close that one in favor of this one given the explicit reproduction.