Skip to content

Look Into Using dbsetversion() For Sybase Or Best Practice? #62

Closed
@metaskills

Description

@metaskills

Currently, we only use dbsetlversion() for the login structure like so in our client.c file.

if (!NIL_P(version))
  dbsetlversion(cwrap->login, NUM2INT(version));

Then I saw this thread http://lists.ibiblio.org/pipermail/freetds/2011q4/027476.html come across the FreeTDS mailing list. Which has this patch to dblib.c so they can have version 100 set in the login structure.

--- dblib.c.ori Thu Aug 18 02:54:40 2011
+++ dblib.c Thu Nov 10 13:45:56 2011
@@ -936,6 +936,9 @@ dbsetlversion (LOGINREC * login, BYTE ve
    case DBVER60:
        login->tds_login->tds_version = 0x700;
        return SUCCEED;
+   case DBVERSION_100:
+       tds_set_version(login->tds_login, 5, 0);
+       return SUCCEED;
    case DBVERSION_71:
        tds_set_version(login->tds_login, 7, 1);
        return SUCCEED;

Below is the documentation for DB-Library. Maybe we should also try to use dbsetversion too? Maybe this would help if FreeTDS was compiled with a lower default --with-tdsver config? If so, it would benefit both us and Sybase.


Function dbsetversion()
Specify a DB-Library version level.

Syntax:

  RETCODE dbsetversion(version)
  DBINT   version;

Parameters:

version – The version of DB-Library behavior that the application expects. 
  The following table lists the symbolic values that are legal for version:

Returns:

  SUCCEED or FAIL.

Comments:

  * dbversion sets the version of DB-Library behavior that an application 
    expects. DB-Library will provide the behavior requested, regardless 
    of the actual version of DB-Library in use.
  * An application is not required to call dbsetversion. However, if 
    dbsetversion is not called, DB-Library provides release 4.6-level 
    behavior.
  * If an application calls dbsetversion, it must do so before calling any 
    other DB-Library routine, with the exception of dbinit.
  * It is an error to call dbsetversion more than once.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions