Bug #34272 SQLColumns from ODBCTE32 returns wrong value for database and several other flds
Submitted: 4 Feb 2008 13:04
Reporter: Tonci Grgin
Status: Verified
Category:Connector/ODBC Severity:S3 (Non-critical)
Version: OS:Microsoft Windows
Assigned to: Lawrin Novitsky Target Version:
Triage: D3 (Medium)

[4 Feb 2008 13:04] Tonci Grgin
Description:
Using table from Bug#28841 I issued Catalog / SQLColumns in OTBCTE32 getting result
similar to this:
Get Data All:
"TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME",
"COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE",
"REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH",
"ORDINAL_POSITION", "IS_NULLABLE"
"testÿÿÿÿÿÿÿÿH", <Null>, "bug28841", "Id", 4, TRUNC: "integer unsi", 10, 4, 0,
10, 1, "", <Null>, 4, <Null>, <Null>, 1, TRUNC: "YE"
"testÿÿÿÿÿÿÿÿH", <Null>, "bug28841", "VBFld1", -3, "varbinary", 50, 50, <Null>,
<Null>, 1, "", <Null>, -3, <Null>, 50, 2, TRUNC: "YE"
"testÿÿÿÿÿÿÿÿH", <Null>, "bug28841", "VBFld2", -2, "binary", 50, 50, <Null>,
<Null>, 1, "", <Null>, -2, <Null>, 50, 3, TRUNC: "YE"
3 rows fetched from 18 columns.

Obviously, TRUNC: "YE" should be just "YES" and "testÿÿÿÿÿÿÿÿH" should be "test".
I have attached DM trace where "test" is retrieved as "testr".

At the same time, 5.1.3 shows no problems:
Get Data All:
"TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME",
"COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE",
"REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH",
"ORDINAL_POSITION", "IS_NULLABLE"
"test", <Null>, "bug28841", "Id", 4, "integer unsigned", 10, 4, 0, 10, 1, "", <Null>, 4,
<Null>, <Null>, 1, "YES"
"test", <Null>, "bug28841", "VBFld1", -3, "varbinary", 50, 50, <Null>, <Null>, 1, "",
<Null>, -3, <Null>, 50, 2, "YES"
"test", <Null>, "bug28841", "VBFld2", -2, "binary", 50, 0, <Null>, <Null>, 1, "", <Null>,
-2, <Null>, 0, 3, "YES"
3 rows fetched from 18 columns.

How to repeat:
See above.

Suggested fix:
-
[4 Feb 2008 13:04] Tonci Grgin
DM trace

Attachment: DMtrace.zip (application/x-zip-compressed, text), 3.42 KiB.