Discussion:
[freetds] SQL_DESC_UNSIGNED column attribute returns the wrong value for tinyint SQL Server columns
Sergio delaCruz
2013-04-01 22:03:22 UTC
Permalink
Hi:

I'm a developer for MySQL Workbench. We support FreeTDS to communicate
with MS SQL Server and Sybase ASE in our Migration Wizard.

When dealing with a bug in our codebase
(http://bugs.mysql.com/bug.php?id=68084) we realized that the return
value that we get when requesting the SQL_DESC_UNSIGNED attribute via
the SQLColAttribute function for a SQL Server TINYINT column differs
from what one would expect (SQL_TRUE). Microsoft's drivers return the
correct value (TINYINT is by definition unsigned in T-SQL).

Is this a bug in FreeTDS? Can you comment on this?

Regards,
--
Sergio A. de la Cruz Rodriguez
Software Developer, MySQL Developer Tools
Oracle Corp.
Sergio delaCruz
2013-04-01 21:59:13 UTC
Permalink
Hi:

I'm a developer for MySQL Workbench. We support FreeTDS to communicate
with MS SQL Server and Sybase ASE in our Migration Wizard.

When dealing with a bug in our codebase
(http://bugs.mysql.com/bug.php?id=68084) we realized that the return
value that we get when requesting the SQL_DESC_UNSIGNED attribute via
the SQLColAttribute function for a SQL Server TINYINT column differs
from what one would expect (SQL_TRUE). Microsoft's drivers return the
correct value (TINYINT is by definition unsigned in T-SQL).

Is this a bug in FreeTDS? Can you comment on this?

Regards,
--
Sergio A. de la Cruz Rodriguez
Software Developer, MySQL Developer Tools
Oracle Corp.
James K. Lowden
2013-04-02 15:07:37 UTC
Permalink
On Mon, 01 Apr 2013 16:03:22 -0600
Post by Sergio delaCruz
When dealing with a bug in our codebase
(http://bugs.mysql.com/bug.php?id=68084) we realized that the return
value that we get when requesting the SQL_DESC_UNSIGNED attribute via
the SQLColAttribute function for a SQL Server TINYINT column differs
from what one would expect (SQL_TRUE). Microsoft's drivers return the
correct value (TINYINT is by definition unsigned in T-SQL).
Is this a bug in FreeTDS? Can you comment on this?
Thanks for the problem report.

src/odbc/odbc.c:3160:

/* TODO perhaps TINYINY and BIT.. */
drec->sql_desc_unsigned = SQL_FALSE;

appears to be the source of your bug.
Post by Sergio delaCruz
From many TODO comments in the function odbc_populate_ird, it would
appear you will find other discrepancies. We would be glad to apply
any patches that bring the ird into closer conformance with Microsoft's
driver.

HTH.

--jkl
Frediano Ziglio
2013-04-08 20:44:26 UTC
Permalink
It would be very helpful. Also I think is broken for Sybase unsigned types
then. I think in this case describecol test should be expanded and fixed.

Frediano


2013/4/2 James K. Lowden <jklowden at freetds.org>
Post by James K. Lowden
On Mon, 01 Apr 2013 16:03:22 -0600
Post by Sergio delaCruz
When dealing with a bug in our codebase
(http://bugs.mysql.com/bug.php?id=68084) we realized that the return
value that we get when requesting the SQL_DESC_UNSIGNED attribute via
the SQLColAttribute function for a SQL Server TINYINT column differs
from what one would expect (SQL_TRUE). Microsoft's drivers return the
correct value (TINYINT is by definition unsigned in T-SQL).
Is this a bug in FreeTDS? Can you comment on this?
Thanks for the problem report.
/* TODO perhaps TINYINY and BIT.. */
drec->sql_desc_unsigned = SQL_FALSE;
appears to be the source of your bug.
Post by Sergio delaCruz
From many TODO comments in the function odbc_populate_ird, it would
appear you will find other discrepancies. We would be glad to apply
any patches that bring the ird into closer conformance with Microsoft's
driver.
HTH.
--jkl
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Frediano Ziglio
2013-04-12 21:22:43 UTC
Permalink
WAS a bug. Fixed in 0.91 branch and master (test only on master)

Frediano


2013/4/1 Sergio delaCruz <sergio.delacruz at oracle.com>
Post by Sergio delaCruz
I'm a developer for MySQL Workbench. We support FreeTDS to communicate
with MS SQL Server and Sybase ASE in our Migration Wizard.
When dealing with a bug in our codebase
(http://bugs.mysql.com/bug.php?id=68084) we realized that the return
value that we get when requesting the SQL_DESC_UNSIGNED attribute via
the SQLColAttribute function for a SQL Server TINYINT column differs
from what one would expect (SQL_TRUE). Microsoft's drivers return the
correct value (TINYINT is by definition unsigned in T-SQL).
Is this a bug in FreeTDS? Can you comment on this?
Regards,
--
Sergio A. de la Cruz Rodriguez
Software Developer, MySQL Developer Tools
Oracle Corp.
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Loading...