[unixODBC-support] SQLDescibeCol returns uninitialized values

Sprenker Ludger ludger.sprenker at d-velop.de
Thu Dec 17 08:30:57 GMT 2009


I'm using unixODBC with Informix odbc client and have a problem with SQLDescribeCol when there are columns with no name (like the result of "SELECT UPPER(column) ..." or "SELECT COUNT(*) ..").
Neither unixODBC nor the Informix odbc client are writing to the output parameters ColumnName and NameLengthPtr in this case. So the value of *NameLengthPtr is undefined which caused sometimes stupid or invalid calls of malloc() in our application.
MSDN says that ColumnName is a null terminated empty string if the value can not be determined or the column has no name. So I think unixODBC should init this fields before calling the odbc client driver:
   ColumnName[0] = '\0';
   *NameLengthPtr = 0;


My system:
  Kubuntu 9.10 (x86)
  unixODBC 2.2.14
  Informix 11.50

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20091217/8b131733/attachment.html>

More information about the unixODBC-support mailing list