Topic: FreeTDS compiled with enable-msdblib ?

Problem: After upgrade date strings are now returned incorrectly from php-mssql / freetds driver

Is the REMI release of FreeTDS compiled with enable-msdblib option?

Environment
-----------
CentOS release 5.5 (Final)  ( 2.6.18-194.32.1.el5.centos.plus )
PHP 5.3.10 (cli) (built: Feb  4 2012 07:16:03)
5.5.20 MySQL Community Server (GPL) by Remi
freetds 0.82 using 8.0 in the driver


Example
-------
Date should be:     2012-02-19 05:58:00

After php upgrade:  2012-19-50 00:00:13

If in php.ini I set mmsql.datetimeconvert = On, date is correct, just wrong format.
Feb 19 2012 05:58:00:000PM 

This looked to be a driver issue in freetds interpreting the default MS SQL date string.


ATTEMPT
-------
I've tried workarounds such as http://www.propelorm.org/cookbook/using … erver.html
/etc/locales.conf
date format = %b %e %Y %I:%M:%S:%z%p

ATTEMPT
-------
Force on every connection string the date format.  Only works on input dates, not output.


ATTEMPT:  Build from REMI Repository
------------------------------------
We read that freetds should be compiled with

--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. This option specifies default behavior. Programs can change the default at compile time by defining MSDBLIB or SYBDBLIB (for Microsoft or Sybase behavior, respectively).

Problem: 
I could not download the source to freeTDS 0.82 from rpms.famillecollet.com/SRPMS/ as it is only 0.64.

What is the configuration line used when you build freetds?  Does it enable-msdblib?

Re: FreeTDS compiled with enable-msdblib ?

php-mssql in remi repository is build against freetds 0.91 from EPEL repository which is build with --enable-msdblib option (among others).

I can't help a lot, as I don't have any MS server to test.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: FreeTDS compiled with enable-msdblib ?

In any event, thank you.  Is there a pointer to freetds build instructions/configuration if I wanted to duplicate the genius that is Remi ?

Re: FreeTDS compiled with enable-msdblib ?

You mentioned freetds 0.91, but my system has freetds.i386  0.82-6.el5.remi.  Should I be using a different repository to get 0.91?  That might make a huge difference.  yum claims I'm up to date when run against the product stable repository.

Re: FreeTDS compiled with enable-msdblib ?

Freetds 0.91 is available in EPEL.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: FreeTDS compiled with enable-msdblib ?

0.91 from epel fixes the date returned by php-mssql and pdo-mssql.  Thank you for all your efforts.  For the curious:


> tsql -Cv
Compile-time settings (established with the "configure" script)
                            Version: freetds v0.91
             freetds.conf directory: /etc
     MS db-lib source compatibility: yes
        Sybase binary compatibility: yes
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 4.2
                              iODBC: no
                           unixodbc: yes
              SSPI "trusted" logins: no
                           Kerberos: no