Description:
When calling SQLTables with the ODBC driver on Windows I notice that there is a truncation on the first two columns of the result set. This seems to be due to the fact that the driver incorrectly describes the column (SQLDescribeCol) length as 0.
How to repeat:
Using Microsoft's ODBC Test tool (odbcte32.exe). use the 2.0 menu options.
1. full connect with Microsoft's ODBC Test tool (odbcte32.exe)
2. Go to Catalog menu option
3. Choose SQLTables and then OK. This should return SQL Success
4. Go to Results and choose. Get Data All.
You'll see results similar to this:
TRUNC: "", "", "trans_date_lw_ly", "TABLE", "MySQL table"
TRUNC: "", "", "trans_date_mtd", "TABLE", "MySQL table"
TRUNC: "", "", "trans_month_ly", "TABLE", "MySQL table"
TRUNC: "", "", "trans_quarter_ly", "TABLE", "MySQL table"
Notice there is truncation taking place. This is happening due to a bug with the driver.
5. Back to ODBC Test tool
6. Run the SQLTables call again.
7. Go to Results and choose SQLDescribeCol and column number 1. Click OK.
8. You'll see from the results that the SQLDescribeCOL for column 1 (TABLE_CAT) shows a size of 0 which is not correct. This also happens for column 2 (TABLE_SCHEM) and leads to the truncation we see in step 4. If you try this with other ODBC drivers (like the MSFT SQL Server driver), you'll not see the truncation on the SQLTAbles call and you'll not see a reported length of 0 for the two columns.
Suggested fix:
To work around this I enabled the NO Catalog option for Flag 3. This will not show truncation since the driver does not try to return catalog information.