Menu

#97 Column sizes are wrong if their collation is different from the connection's charset

7.2.0-alfa
closed
None
2014-09-25
2014-08-29
Joe @ Whale
No

I think the problem lies in the TZInterbase6XSQLDAResultSet.Open; method. The ColumnDisplaySize calculation does not take column's collation into account. Instead it takes charsize from the connection's charset.
For example, this SQL gets wrong column sizes for Unicode Delphi and UTF-16 connection:
SELECT C.RDB$CONSTRAINT_NAME, R.RDB$CONST_NAME_UQ, R.RDB$UPDATE_RULE, R.RDB$DELETE_RULE, I1.RDB$RELATION_NAME AS TABLE1, I2.RDB$RELATION_NAME AS TABLE2
FROM RDB$RELATION_CONSTRAINTS AS C
INNER JOIN RDB$REF_CONSTRAINTS AS R ON R.RDB$CONSTRAINT_NAME=C.RDB$CONSTRAINT_NAME AND C.RDB$CONSTRAINT_TYPE='FOREIGN KEY'
LEFT OUTER JOIN RDB$INDICES AS I1 ON I1.RDB$INDEX_NAME=C.RDB$CONSTRAINT_NAME
LEFT OUTER JOIN RDB$INDICES AS I2 ON I2.RDB$INDEX_NAME=R.RDB$CONST_NAME_UQ

Discussion

  • EgonHugeist

    EgonHugeist - 2014-09-09

    Hi which characterset are you using for your database?

     
  • Joe @ Whale

    Joe @ Whale - 2014-09-10

    Hi, the default database characterset is UTF8 and all text domains have UTF8 as a charset. The problem is highly visible with Firebird's system tables (Firebird 2.5 is used), which has NONE as column's charset.

     
  • EgonHugeist

    EgonHugeist - 2014-09-21

    FYI: of course you are right!

     
  • EgonHugeist

    EgonHugeist - 2014-09-21
    • status: open --> accepted
    • assigned_to: EgonHugeist
     
  • EgonHugeist

    EgonHugeist - 2014-09-25

    did commit a fix: R3332 \testing-7.2 (SVN)
    an my side it works nice now.

    Please test and feel free to close your ticket, Joe.

    Cheers, Michael

     
  • Joe @ Whale

    Joe @ Whale - 2014-09-25
    • status: accepted --> closed
     
  • Joe @ Whale

    Joe @ Whale - 2014-09-25

    I have tested your fix and it works correctly. Thank you.

     

Log in to post a comment.

MongoDB Logo MongoDB