FreeTDS / freetds

Official FreeTDS repository
http://www.freetds.org/
GNU General Public License v2.0
455 stars 154 forks source link

tds version ignored #521

Open leonardorame opened 6 months ago

leonardorame commented 6 months ago

Hi, I'm using FreeTDS 1.4.2 on FreeBSD 13.2

My /usr/local/etc/freetds/freetds.conf file is this:

[global]
        # TDS protocol version
        tds version = 7.0
        port = 1433
        client charset = UTF-8
        dump file = /tmp/freetds.log

[testdb]
host = 192.168.0.12
port = 1433
tds version = 7.0

When I use tsql it connects to testdb without issues. Now, if I try to connect using my own program (written in FreePascal), the log file /tmp/freetds.log reports that it is Connecting with protocol version 7.3, ignoring the tds version config.

If I set TDSVER=7.0 environment variable before running my program it connects ok.

The question is, why the config param tds version is ignored?, host and port are read perfectly.

leonardorame commented 6 months ago

Fixed by building with GnuTLS instead of OpenSSL.

freddy77 commented 6 months ago

That's pretty weird... it should take the version configured. Did you try to use TDSDUMPCONFIG option (https://www.freetds.org/userguide/logging.html) ? Just to confirm that the right file was used.