Issue Details (XML | Word | Printable)

Key: CORE-5862
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Mark Rotteveel
Votes: 0
Watchers: 2
Operations

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

Varchar computed column without explicit type does not populate RDB$CHARACTER_LENGTH

Created: 27/Jun/18 03:52 PM   Updated: 20/Jan/20 02:05 AM
Component/s: Engine
Affects Version/s: 4.0 Alpha 1, 2.5.8, 3.0.3
Fix Version/s: 4.0 Beta 1, 3.0.6

Environment: Firebird-4.0.0.1040-0_x64 Windows
Issue Links:
Duplicate
 

QA Status: Done successfully


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

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 27/Jun/18 04:02 PM
Duplicates CORE-2228, but it might be better to close that one in favor of this one given the explicit reproduction.