Re: Prompts While Installing freebsd package
"James K. Lowden" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 9 Oct 2012 13:33:02 -0400 Evan Panagiotopoulos <[email protected]> wrote: > During the installation of the package I receive the prompt: > ... > [ ] 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