Discussion:
[freetds] Prompts While Installing freebsd package
Evan Panagiotopoulos
2012-10-09 17:33:02 UTC
Permalink
During the installation of the package I receive the prompt:

[ ] OPENSSL Use openssl
[ ] GNUTLS Use GNUTLS
[ ] IODBC Use iodbc (Mutually Exclusive)
[ ] UNIXODBC Use unixodbc (Mutually Exclusive)
[ ] MSDBLIB MS SQL Server support (breaks databases/sybtcl)

Since I am trying to connect to a MS SQL database I should select the last
option, MSDBLIB MS SQL Server support. Is this assumption correct? Should
I select any additional options?
--
Evan Panagiotopoulos
Frediano Ziglio
2012-10-09 17:47:10 UTC
Permalink
Post by Evan Panagiotopoulos
[ ] OPENSSL Use openssl
[ ] GNUTLS Use GNUTLS
[ ] IODBC Use iodbc (Mutually Exclusive)
[ ] UNIXODBC Use unixodbc (Mutually Exclusive)
[ ] MSDBLIB MS SQL Server support (breaks databases/sybtcl)
Since I am trying to connect to a MS SQL database I should select the last
option, MSDBLIB MS SQL Server support. Is this assumption correct? Should
I select any additional options?
--
Evan Panagiotopoulos
If you use a recent version defining this at compile time is useless
and just break stuff, better to define MSDBLIB in your code or project
files (and only apply if you use dblib).

Personally I use gnutls and unixodbc but this is up to you. I think
you are using Gentoo, isn't it?

Frediano
Evan Panagiotopoulos
2012-10-09 17:50:42 UTC
Permalink
I use freebsd and I am trying to connect to a remote MS SQL server using
php.
Post by Evan Panagiotopoulos
Post by Evan Panagiotopoulos
[ ] OPENSSL Use openssl
[ ] GNUTLS Use GNUTLS
[ ] IODBC Use iodbc (Mutually Exclusive)
[ ] UNIXODBC Use unixodbc (Mutually Exclusive)
[ ] MSDBLIB MS SQL Server support (breaks databases/sybtcl)
Since I am trying to connect to a MS SQL database I should select the
last
Post by Evan Panagiotopoulos
option, MSDBLIB MS SQL Server support. Is this assumption correct?
Should
Post by Evan Panagiotopoulos
I select any additional options?
--
Evan Panagiotopoulos
If you use a recent version defining this at compile time is useless
and just break stuff, better to define MSDBLIB in your code or project
files (and only apply if you use dblib).
Personally I use gnutls and unixodbc but this is up to you. I think
you are using Gentoo, isn't it?
Frediano
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
--
Evan Panagiotopoulos
James K. Lowden
2012-10-11 03:41:50 UTC
Permalink
On Tue, 9 Oct 2012 13:33:02 -0400
...
Post by Evan Panagiotopoulos
[ ] MSDBLIB MS SQL Server support (breaks databases/sybtcl)
Since I am trying to connect to a MS SQL database I should select the
last option, MSDBLIB MS SQL Server support. Is this assumption
correct?
Not only is it incorrect, it is groundless. You should file a bug
report with the packager.

The --enable-msdblib configuration option causes a lot of confusion.
The confusion, however, is not caused by anything difficult or
complicated about the option. Rather, it seems to stem from a lack of
knowledge that makes plain language meaningless!

Many people seem to assume that if their server is made by Microsoft,
then perhaps they need this "MS" option.

Why *assume*? Why not just read?

$ ~/freetds/configure --help | grep msdb
--enable-msdblib for MS style dblib

No mention of SQL Server.

http://www.freetds.org/userguide/config.htm

"--enable-msdblib
Enable Microsoft behavior in the DB-Library API where it
diverges from Sybase's. Use this option if you are replacing
Microsoft's libraries with FreeTDS"

No mention of SQL Server.

OK, so it's not about the server. What *is* it about?

A C program may use the db-lib library, That library was
implemented by Sybase and Microsoft, who defined the names of the
functions and what they do. While the implementations are largely
compatible, there are some small differences.

For example, dbdatecrack() converts a SQL DATETIME into a DBDATEREC
structure. The vendors each define that structure in their own way.
For example, Sybase defines a "year" member, but Microsoft defines
"dateyear". Most important, they both define "month", but Sybase says
month is 0-11, and Microsoft says it's 1-12.

Now, be a C program for a minute.

dbsqlexec(dbproc, "SELECT db_date()");
DBDATETIME *datetime = dbdata(dbproc);
DBDATEREC daterec;
dbdatecrack(dbproc, &daterec, datetime);

In daterec.month, you find the value 9. Does that mean
September or October? That depends on whose definition of
dbdatecrack() was used.

FreeTDS is an ecumenical libary. If you define MSDBLIB either at
configuration time or at compilation time, 9 means September. If you
don't, it means October. (There is a runtime aspect, too, that I'm
ignoring for simplicity.)

What does that mean to the PHP programmer? PHP is a C program. You
must know how it will interpret the value or, if it won't interpret the
value, how *you* will.

If you you have no existing code affected by divergent db-lib
semantics, you can freely ignore --enable-msdblib. If you do have such
code, you need to enable it or not, as compatibility dictates, else
your date arithmetic could be a month off.

HTH.

--jkl
Igor Korot
2012-10-11 03:53:28 UTC
Permalink
James,
Post by James K. Lowden
On Tue, 9 Oct 2012 13:33:02 -0400
...
Post by Evan Panagiotopoulos
[ ] MSDBLIB MS SQL Server support (breaks databases/sybtcl)
Since I am trying to connect to a MS SQL database I should select the
last option, MSDBLIB MS SQL Server support. Is this assumption
correct?
Not only is it incorrect, it is groundless. You should file a bug
report with the packager.
The --enable-msdblib configuration option causes a lot of confusion.
The confusion, however, is not caused by anything difficult or
complicated about the option. Rather, it seems to stem from a lack of
knowledge that makes plain language meaningless!
Many people seem to assume that if their server is made by Microsoft,
then perhaps they need this "MS" option.
Why *assume*? Why not just read?
$ ~/freetds/configure --help | grep msdb
--enable-msdblib for MS style dblib
No mention of SQL Server.
http://www.freetds.org/userguide/config.htm
"--enable-msdblib
Enable Microsoft behavior in the DB-Library API where it
diverges from Sybase's. Use this option if you are replacing
Microsoft's libraries with FreeTDS"
No mention of SQL Server.
OK, so it's not about the server. What *is* it about?
A C program may use the db-lib library, That library was
implemented by Sybase and Microsoft, who defined the names of the
functions and what they do. While the implementations are largely
compatible, there are some small differences.
For example, dbdatecrack() converts a SQL DATETIME into a DBDATEREC
structure. The vendors each define that structure in their own way.
For example, Sybase defines a "year" member, but Microsoft defines
"dateyear". Most important, they both define "month", but Sybase says
month is 0-11, and Microsoft says it's 1-12.
Now, be a C program for a minute.
dbsqlexec(dbproc, "SELECT db_date()");
DBDATETIME *datetime = dbdata(dbproc);
DBDATEREC daterec;
dbdatecrack(dbproc, &daterec, datetime);
In daterec.month, you find the value 9. Does that mean
September or October? That depends on whose definition of
dbdatecrack() was used.
FreeTDS is an ecumenical libary. If you define MSDBLIB either at
configuration time or at compilation time, 9 means September. If you
don't, it means October. (There is a runtime aspect, too, that I'm
ignoring for simplicity.)
What does that mean to the PHP programmer? PHP is a C program. You
must know how it will interpret the value or, if it won't interpret the
value, how *you* will.
If you you have no existing code affected by divergent db-lib
semantics, you can freely ignore --enable-msdblib. If you do have such
code, you need to enable it or not, as compatibility dictates, else
your date arithmetic could be a month off.
As you said yourself, there are differences between Sybase and
Microsoft in their
implementation. You just described one of them.

Is there a list of such differences available and where it is located?
If not, maybe it is
worth making it and refer to it in the UG?

Thank you.
Post by James K. Lowden
HTH.
--jkl
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
Loading...