The latest dev-db/freetds-0.91 suffers from the bug described in the url. Basically when using freetds with your freetds.conf file using "tds version = 7.2" causes aliased fields in your SQL string to be returned with their orignal names. There's a workaround to change to "tds version = 4.2" to fix it, but then that one does not return varchar data larger than 255 characters, so that is not an option for most users. Reproducible: Always Steps to Reproduce: user$ php -a Interactive shell php > $conn = odbc_connect('MYDSN', 'MYUSER', 'MYPASS'); php > $res = odbc_exec($conn, 'SELECT TABLE_NAME AS my_table FROM Information_Schema.Tables'); php > $row = odbc_fetch_array($res); php > print_r($row); php > odbc_free_result($res); php > odbc_close($conn); php > quit Actual Results: Array ( [TABLE_NAME] => FirstTableInListing ) Expected Results: Array ( [my_table] => FirstTableInListing )
Created attachment 368020 [details, diff] Source patch for freetds-0.91 Altered form of the original patch updated for freetds-0.91
Created attachment 368022 [details, diff] Patch for freetds-0.91.ebuild Changes to apply the patch durring emerge.
Comment on attachment 368022 [details, diff] Patch for freetds-0.91.ebuild Since EAPI=2 we apply patches in src_prepare() not src_unpack().
This was fixed for the 0.91 versions a while ago (the patch was applied). The patch no longer works for newer versions of freetds, though -- can you please check to see if the 1.00.x versions have the same problem?
...I forgot that I have a MSSQL server to play with. I just ran your example with freetds-1.00.13 and my TDS version set to 7.2. It worked correctly, so I think this was fixed upstream around v1.00. Please let me know if this is not the case.