From: <no...@so...> - 2001-03-30 09:12:16
|
Bugs item #412417, was updated on 2001-03-30 01:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109028&aid=412417&group_id=9028 Category: Data Types/On-Disk Struc(ODS) Group: None Status: Open Priority: 5 Submitted By: Dmitri Kouzmenko (kdv) Assigned to: Nobody/Anonymous (nobody) Summary: altering from CHAR to VARCHAR Initial Comment: Altering CHAR to VARCHAR column adds 2 bytes to field length. How to reproduce: CREATE TABLE TEST( N CHAR(40)); then ALTER TABLE TEST ALTER N TYPE VARCHAR(40); after that RDB$FIELD_LENGTH will be 42, not 40 as it should be. RDB$CHARACTER_LENGTH is Ok, i.e. it stays 40 after ALTER. The '40' is not a magic number - same addition of 2 bytes will be for any altering from char to varchar. For example, altering char(40) to varchar(50) will give the resulting varchar field 52 characters length. Tested with FireBird 0.9.4 for Windows (NT 4.0 SP6a workstation). Dialect 3 database. p.s. real varchar storage size is 2 bytes greater than char. But, column length definition (RDB$FIELD_LENGTH) does not store physical field lenght - it stores column length. So, altering char to varchar must keep the same column size. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109028&aid=412417&group_id=9028 |