Bug #11276 | ODBC Connector returns VarChar as LongVarChar type | ||
---|---|---|---|
Submitted: | 13 Jun 2005 4:24 | Modified: | 13 Jun 2005 6:18 |
Reporter: | Edrick Duero | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | Connector / ODBC | Severity: | S1 (Critical) |
Version: | 3.51.11-2 | OS: | Windows (Windows XP-SP2) |
Assigned to: | CPU Architecture: | Any |
[13 Jun 2005 4:24]
Edrick Duero
[13 Jun 2005 6:18]
Vasily Kishkin
Sorry, I was not able to reproduce this bug. I attached screen copy where field "c" (varchar) is showed as TStringField. The definition of table is follow: mysql> describe t3; +-------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+-------+ | c | varchar(20) | YES | | NULL | | +-------+-------------+------+-----+---------+-------+ 1 row in set (0.00 sec)
[13 Jun 2005 6:19]
Vasily Kishkin
screen copy
Attachment: screen.gif (image/gif, text), 20.35 KiB.
[14 Jun 2005 5:56]
Edrick Duero
Vasily, I tried to find the cause and I found out that this problem occures in null columns. Here is my test script: --------------------------------------------- mysql> create table t1( -> c1 varchar(50), -> c2 varchar(50) -> ) type=innodb; Query OK, 0 rows affected, 1 warning (0.03 sec) mysql> insert into t1(c1) values('test'); Query OK, 1 row affected (0.00 sec) mysql> ------------------------------------------------ The 'c1' column return data type 200 (adVarChar) coz it has a value but the 'c2' column return 201 (adLongVarChar) and not 200 (adVarChar) this makes delphi to declare this a TMemoField instead of TStringField. I also test this in VB (Recordset.Fields[Index].Type) and still returns the same data type value Thanks...
[15 Jul 2005 15:25]
Edrick Duero
Just an update for this report. It occurs only when you set the connection option = 0. But when you set the option = 3 (don't optimize columns width) it works fine. sample connection string: 'Provider=MSDASQL.1;User Name=root;Password=password;Extended Properties="driver={MySQL ODBC 3.51};DATABASE=test;OPTION=0;PORT=0;SERVER=localhost"'