<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.db.tds.freetds">
    <title>gmane.comp.db.tds.freetds</title>
    <link>http://blog.gmane.org/gmane.comp.db.tds.freetds</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14524"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14519"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14515"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14514"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14507"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14504"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14502"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14500"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14497"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14496"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14488"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14487"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14486"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14480"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14479"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14475"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14468"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14465"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14461"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.db.tds.freetds/14460"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14524">
    <title>AIX 6.1 make failure</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14524</link>
    <description>&lt;pre&gt;I have downloaded and freetds-0.91 and when I run ./configure I get no errors.  However when I try to make I get the following:
 
Making all in include
        make  all-am
        echo '#define FREETDS_SYSCONFDIR "/usr/local/etc"' &amp;gt;freetds_sysconfdir.h
Target "all-am" is up to date.
Making all in src
Making all in replacements
        source='iconv.c' object='iconv.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o iconv.lo iconv.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M iconv.c  -DPIC -o .libs/iconv.o
"iconv.c", line 484.7: 1506-356 (W) Compilation unit is empty.
        source='gettimeofday.c' object='gettimeofday.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o gettimeofday.lo gettimeofday.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M gettimeofday.c  -DPIC -o .libs/gettimeofday.o
"gettimeofday.c", line 73.7: 1506-356 (W) Compilation unit is empty.
        source='fakepoll.c' object='fakepoll.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o fakepoll.lo fakepoll.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M fakepoll.c  -DPIC -o .libs/fakepoll.o
"fakepoll.c", line 198.23: 1506-356 (W) Compilation unit is empty.
        source='asprintf.c' object='asprintf.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o asprintf.lo asprintf.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M asprintf.c  -DPIC -o .libs/asprintf.o
        source='vasprintf.c' object='vasprintf.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o vasprintf.lo vasprintf.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M vasprintf.c  -DPIC -o .libs/vasprintf.o
        source='readpassphrase.c' object='readpassphrase.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o readpassphrase.lo readpassphrase.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M readpassphrase.c  -DPIC -o .libs/readpassphrase.o
        source='strlcpy.c' object='strlcpy.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o strlcpy.lo strlcpy.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M strlcpy.c  -DPIC -o .libs/strlcpy.o
        source='strlcat.c' object='strlcat.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o strlcat.lo strlcat.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -I../../src/replacements -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M strlcat.c  -DPIC -o .libs/strlcat.o
        /bin/sh ../../libtool --tag=CC    --mode=link cc -qlanglvl=extc89 -D_THREAD_SAFE  -g    -o libreplacements.la  iconv.lo gettimeofday.lo fakepoll.lo asprintf.lo vasprintf.lo readpassphrase.lo strlcpy.lo strlcat.lo -lpthreads
libtool: link: rm -fr  .libs/libreplacements.a .libs/libreplacements.la
libtool: link: ar cru .libs/libreplacements.a .libs/iconv.o .libs/gettimeofday.o .libs/fakepoll.o .libs/asprintf.o .libs/vasprintf.o .libs/readpassphrase.o .libs/strlcpy.o .libs/strlcat.o
libtool: link: ranlib .libs/libreplacements.a
libtool: link: ( cd ".libs" &amp;amp;&amp;amp; rm -f "libreplacements.la" &amp;amp;&amp;amp; ln -s "../libreplacements.la" "libreplacements.la" )
Target "all" is up to date.
Making all in tds
        make  all-recursive
Making all in unittests
Target "all" is up to date.
        source='mem.c' object='mem.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o mem.lo mem.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M mem.c  -DPIC -o .libs/mem.o
        source='token.c' object='token.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o token.lo token.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M token.c  -DPIC -o .libs/token.o
        source='util.c' object='util.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o util.lo util.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M util.c  -DPIC -o .libs/util.o
        source='login.c' object='login.lo' libtool=yes  DEPDIR=.deps depmode=aix /bin/sh ../../depcomp  /bin/sh ../../libtool --tag=CC    --mode=compile cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include   -I../../include -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE  -g -c -o login.lo login.c
libtool: compile:  cc -qlanglvl=extc89 -DHAVE_CONFIG_H -I. -I../../include -I../../include -D_FREETDS_LIBRARY_SOURCE -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -D_THREAD_SAFE -g -c -M login.c  -DPIC -o .libs/login.o
"login.c", line 724.9: 1506-046 (S) Syntax error.
"login.c", line 724.19: 1506-045 (S) Undeclared identifier These.
"login.c", line 766.20: 1506-045 (S) Undeclared identifier user_name_len.
make: The error code from the last command is 1.
 

Stop.
make: The error code from the last command is 1.
 

Stop.
make: The error code from the last command is 2.
 

Stop.
make: The error code from the last command is 1.
 

Stop.
make: The error code from the last command is 1.
 

Stop.
 
Any ideas on what I can do?
 
Thanks

The foregoing message, together with any attachments, is confidential and intended for the addressee only. If you received this message in error, please delete all copies of this message and promptly notify us of our error. Thank you.
_______________________________________________
FreeTDS mailing list
FreeTDS&amp;lt; at &amp;gt;lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
&lt;/pre&gt;</description>
    <dc:creator>Kevin Coyle</dc:creator>
    <dc:date>2012-05-25T18:01:49</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14519">
    <title>Using dbwritetext against Ms-Sql</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14519</link>
    <description>&lt;pre&gt;Hi

We are doing a test using FreeTDS  on Solaris moving a Fortran/C application from Sybase to MS-Sql server.
Recently we ran into a problem I'm hoping to get a hint on how to solve.

Simplified we are doing:

-          Update IMAGECOLTAB set IMAGECOL=NULL

-          Select IMAGECOL from IMAGECOLTAB

-          Get Pointer to IMAGECOL from dbtextptr

-          Get TimeStamp from dbtexttimestamp

-          Do dbwritetext with length of image to be written and NULL in last parameter

-          Loop text and do dbmoretext
The problem is that we are getting
tds_put_string: "writetext bulk IMAGECOLTAB.IMAGECOL 0x00000000000000000000000000000000 timestamp = 0x0000000000000000 with log"
Invalid text, ntext, or image pointer value 0x00000000000000000000000000000000.

Any idea on what we are doing wrong? I have checked code that we have in another program where we used dblib against Ms-Sqlserver, and I see more or less the same code.

Below is a simplified C code for my function, and the resulting tds log file.

Our function:
    DBBINARY       *txtptr;
    unsigned char   buff[WIDEBUFSIZE];
    unsigned char   tabCol[100];
    QueryTable *pqq, *pqu;             /* Pointer to current table */
    DBBINARY   tsStamp[DBTXTSLEN];
    DBBINARY   txtPointer[DBTXPLEN];

/* Set the widecolumn to NULL to simplify the storage process */
    //Execute "update IMAGECOLTAB set IMAGECOL=NULL where ID=1"

                /* Select the record to obtain the text's timestamp */
    //Execute "select IMAGECOL from IMAGECOLTAB where ID=1"
                //pqq is query pointer

    sprintf((char *)tabCol, "IMAGECOLTAB.IMAGECOL");

                /* We must have a valid textpointer */
    if ((txtptr = dbtxptr(pqq-&amp;gt;DbProc, 1)) == NULL) {
        return;
    }
                memcpy(txtPointer, txtptr, DBTXPLEN);
                memcpy(tsStamp, dbtxtimestamp(pqq-&amp;gt;DbProc, 1), DBTXTSLEN);

    if ((dbwritetext(pqu-&amp;gt;DbProc, tabCol, txtPointer, DBTXPLEN, tsStamp, TRUE, (DBINT) NoBytes, NULL))!= SUCCEED)
                               return;
    if ((dbsqlok(pqu-&amp;gt;DbProc)) != SUCCEED)
                               return;
    if ((dbresults(pqu-&amp;gt;DbProc)) != SUCCEED)
                               return;

    /* Now, read all data from file and store into database */
    SomeStored = 0;
    while ((BytesRead = read(filePointer, buff, WIDEBUFSIZE)) &amp;gt; 0) {
                               if ((dbmoretext(pqu-&amp;gt;DbProc, (DBINT) BytesRead, (LPCBYTE)buff)) != SUCCEED)
                                               return;
                               if (!SomeStored)
                                               SomeStored = 1;
    }

    if (SomeStored) {
                               if ((dbsqlok(pqu-&amp;gt;DbProc)) != SUCCEED)
                                               return;
                               if ((dbresults(pqu-&amp;gt;DbProc)) != SUCCEED)
                                               return;
    }

The TDS log file  (IMAGECOLTAB=PLOTHEAD, IMANGECOL=CONTENTS):
10:38:18.662559 5857 (dblib.c:1312):dbcmd(a74160, update PLOTHEAD set CONTENTS=NULL where MODULE='MAP' and PLOTNAME='ON-TEST-15MAI2012')
Snip
10:38:18.671062 5857 (dblib.c:1312):dbcmd(a74160, select CONTENTS from PLOTHEAD where MODULE='MAP' and PLOTNAME='ON-TEST-15MAI2012')
10:38:18.671068 5857 (dblib.c:1319):dbcmd() bufsz = 103
10:38:18.671074 5857 (dblib.c:5882):dbfreebuf(a74160)
10:38:18.671080 5857 (dblib.c:1369):dbsqlexec(a74160)
10:38:18.671086 5857 (dblib.c:6862):dbsqlsend(a74160)
10:38:18.671092 5857 (mem.c:615):tds_free_all_results()
10:38:18.671098 5857 (util.c:156):Changed query state from IDLE to QUERYING
10:38:18.671104 5857 (write.c:140):tds_put_string converting 98 bytes of "select CONTENTS from PLOTHEAD where MODULE='MAP' and INITIAL='ON' and PLOTNAME='ON-TEST-15MAI2012'"
Snip
10:38:18.671220 5857 (token.c:540):tds_process_tokens(a72e18, ffbdeb1c, ffbdeb18, 0x6914)
10:38:18.671227 5857 (util.c:156):Changed query state from PENDING to READING
10:38:18.671719 5857 (net.c:555):Received header
0000 04 01 00 42 00 bc 01 00-                        |...B....|
10:38:18.671733 5857 (net.c:609):Received packet
0000 04 01 00 42 00 bc 01 00-81 01 00 00 00 09 00 22 |...B.... ......."|
0010 00 10 00 00 08 00 50 00-4c 00 4f 00 54 00 48 00 |......P. L.O.T.H.|
0020 45 00 41 00 44 00 08 43-00 4f 00 4e 00 54 00 45 |E.A.D..C .O.N.T.E|
0030 00 4e 00 54 00 53 00 d1-00 fd 10 00 c1 00 01 00 |.N.T.S.. ........|
0040 00 00                  -                        |..|

10:38:18.671760 5857 (token.c:555):processing result tokens.  marker is  81(TDS7_RESULT)
10:38:18.671766 5857 (token.c:1515):processing TDS7 result metadata.
10:38:18.671773 5857 (mem.c:615):tds_free_all_results()
10:38:18.671780 5857 (token.c:1540):set current_results (1 column) to tds-&amp;gt;res_info
10:38:18.671786 5857 (token.c:1547):setting up 1 columns
10:38:18.671796 5857 (token.c:1486):tds7_get_data_info:
                colname = CONTENTS (8 bytes)
                type = 34 (image)
                server's type = 34 (image)
                column_varint_size = 4
                column_size = 4096 (4096 on server)
10:38:18.671804 5857 (token.c:1556): name                 size/wsize      type/wtype      utype
10:38:18.671811 5857 (token.c:1557): -------------------- --------------- --------------- -------
10:38:18.671817 5857 (token.c:1567): CONTENTS                4096/4096         34/34            0
10:38:18.671824 5857 (util.c:156):Changed query state from READING to PENDING
10:38:18.671831 5857 (dblib.c:4700):dbsqlok() found result token
10:38:18.671837 5857 (dblib.c:1668):dbresults(a74160)
10:38:18.671842 5857 (dblib.c:1674):dbresults: dbresults_state is 1 (_DB_RES_RESULTSET_EMPTY)
10:38:18.671849 5857 (token.c:540):tds_process_tokens(a72e18, ffbdeb8c, ffbdeb88, 0x6914)
10:38:18.671855 5857 (util.c:156):Changed query state from PENDING to READING
10:38:18.671861 5857 (token.c:555):processing result tokens.  marker is  d1(ROW)
10:38:18.671867 5857 (token.c:666):tds_process_tokens::SET_RETURN stopping on current token
10:38:18.671892 5857 (util.c:156):Changed query state from READING to PENDING
10:38:18.671899 5857 (dblib.c:1695):dbresults() tds_process_tokens returned 1 (TDS_SUCCEED),
                                               result_type TDS_ROW_RESULT
10:38:18.671906 5857 (dblib.c:1657):dbresults returning 1 (SUCCEED)
10:38:18.671912 5857 (dblib.c:4063):dbcmdrow(a74160)
10:38:18.671918 5857 (dblib.c:3842):dbrows(a74160)
10:38:18.671925 5857 (dblib.c:2575):dbbind(a74160, 1, 1, 0, ffbdecf6)
10:38:18.671932 5857 (dblib.c:2812):dbwillconvert(SYBIMAGE, SYBCHAR)
10:38:18.671939 5857 (convert.c:2788):tds_willconvert(34, 47)
10:38:18.671947 5857 (convert.c:2792):tds_willconvert(34, 47) returns yes
10:38:18.671954 5857 (dblib.c:2018):dbnextrow(a74160)
10:38:18.671960 5857 (dblib.c:2031):dbnextrow() dbresults_state = 2 (_DB_RES_RESULTSET_ROWS)
10:38:18.671967 5857 (token.c:540):tds_process_tokens(a72e18, ffbdeb9c, 0, 0x1508)
10:38:18.671973 5857 (util.c:156):Changed query state from PENDING to READING
10:38:18.671979 5857 (token.c:555):processing result tokens.  marker is  d1(ROW)
10:38:18.671985 5857 (token.c:2304):tds_process_row(): reading column 0
10:38:18.671992 5857 (token.c:2049):tds_get_data: type 34, varint size 4
10:38:18.671999 5857 (token.c:2110):tds_get_data(): wire column size is -1
10:38:18.672005 5857 (util.c:156):Changed query state from READING to PENDING
10:38:18.672012 5857 (buffering.h:306):buffer_transfer_bound_data(a74168 4040 -1 a74160 0)
10:38:18.672019 5857 (dblib.c:548):dbgetnull(a74160, 1, -1, ffbdecf6)
10:38:18.672026 5857 (dblib.c:2100):leaving dbnextrow() returning REG_ROW/MORE_ROWS
10:38:18.672038 5857 (dblib.c:6374):dbtxptr(a74160, 1)
10:38:18.672050 5857 (dblib.c:6347):dbtxtimestamp(a74160, 1)
10:38:18.672060 5857 (dblib.c:6410):dbwritetext(a627c8, PLOTHEAD.CONTENTS, 9d14cc, 16, 9d14dc, 1)
10:38:18.672068 5857 (dblib.c:2217):dbconvert(a627c8, SYBBINARY, 9d14cc, 16, SYBCHAR, ffbdebe0, -1)
10:38:18.672075 5857 (dblib.c:2349):dbconvert() calling tds_convert
10:38:18.672083 5857 (dblib.c:2352):dbconvert() called tds_convert returned 32
10:38:18.672089 5857 (dblib.c:2455):dbconvert() outputting 32 bytes character data destlen = -1
10:38:18.672096 5857 (dblib.c:2217):dbconvert(a627c8, SYBBINARY, 9d14dc, 8, SYBCHAR, ffbdebc8, -1)
10:38:18.672102 5857 (dblib.c:2349):dbconvert() calling tds_convert
10:38:18.672109 5857 (dblib.c:2352):dbconvert() called tds_convert returned 16
10:38:18.672115 5857 (dblib.c:2455):dbconvert() outputting 16 bytes character data destlen = -1
10:38:18.672153 5857 (mem.c:615):tds_free_all_results()
10:38:18.672161 5857 (util.c:156):Changed query state from IDLE to QUERYING
10:38:18.672167 5857 (write.c:140):tds_put_string converting 107 bytes of "writetext bulk PLOTHEAD.CONTENTS 0x00000000000000000000000000000000 timestamp = 0x0000000000000000 with log"
10:38:18.672176 5857 (write.c:168):tds_put_string wrote 214 bytes
10:38:18.672182 5857 (util.c:156):Changed query state from QUERYING to PENDING
10:38:18.672189 5857 (net.c:741):Sending packet
0000 01 01 00 de 00 00 01 00-77 00 72 00 69 00 74 00 |........ w.r.i.t.|
0010 65 00 74 00 65 00 78 00-74 00 20 00 62 00 75 00 |e.t.e.x. t. .b.u.|
0020 6c 00 6b 00 20 00 50 00-4c 00 4f 00 54 00 48 00 |l.k. .P. L.O.T.H.|
0030 45 00 41 00 44 00 2e 00-43 00 4f 00 4e 00 54 00 |E.A.D... C.O.N.T.|
0040 45 00 4e 00 54 00 53 00-20 00 30 00 78 00 30 00 |E.N.T.S.  .0.x.0.|
0050 30 00 30 00 30 00 30 00-30 00 30 00 30 00 30 00 |0.0.0.0. 0.0.0.0.|
0060 30 00 30 00 30 00 30 00-30 00 30 00 30 00 30 00 |0.0.0.0. 0.0.0.0.|
0070 30 00 30 00 30 00 30 00-30 00 30 00 30 00 30 00 |0.0.0.0. 0.0.0.0.|
0080 30 00 30 00 30 00 30 00-30 00 30 00 30 00 20 00 |0.0.0.0. 0.0.0. .|
0090 74 00 69 00 6d 00 65 00-73 00 74 00 61 00 6d 00 |t.i.m.e. s.t.a.m.|
00a0 70 00 20 00 3d 00 20 00-30 00 78 00 30 00 30 00 |p. .=. . 0.x.0.0.|
00b0 30 00 30 00 30 00 30 00-30 00 30 00 30 00 30 00 |0.0.0.0. 0.0.0.0.|
00c0 30 00 30 00 30 00 30 00-30 00 30 00 20 00 77 00 |0.0.0.0. 0.0. .w.|
00d0 69 00 74 00 68 00 20 00-6c 00 6f 00 67 00       |i.t.h. . l.o.g.|

10:38:18.672283 5857 (token.c:540):tds_process_tokens(a631d8, ffbdeacc, ffbdeac8, 0x100)
10:38:18.672292 5857 (util.c:156):Changed query state from PENDING to READING
10:38:18.673186 5857 (net.c:555):Received header
0000 04 01 01 31 00 7a 01 00-                        |...1.z..|

10:38:18.673202 5857 (net.c:609):Received packet
0000 04 01 01 31 00 7a 01 00-aa ba 00 d3 1b 00 00 01 |...1.z.. ........|
0010 10 4f 00 49 00 6e 00 76-00 61 00 6c 00 69 00 64 |.O.I.n.v .a.l.i.d|
0020 00 20 00 74 00 65 00 78-00 74 00 2c 00 20 00 6e |. .t.e.x .t.,. .n|
0030 00 74 00 65 00 78 00 74-00 2c 00 20 00 6f 00 72 |.t.e.x.t .,. .o.r|
0040 00 20 00 69 00 6d 00 61-00 67 00 65 00 20 00 70 |. .i.m.a .g.e. .p|
0050 00 6f 00 69 00 6e 00 74-00 65 00 72 00 20 00 76 |.o.i.n.t .e.r. .v|
0060 00 61 00 6c 00 75 00 65-00 20 00 30 00 78 00 30 |.a.l.u.e . .0.x.0|
0070 00 30 00 30 00 30 00 30-00 30 00 30 00 30 00 30 |.0.0.0.0 .0.0.0.0|
0080 00 30 00 30 00 30 00 30-00 30 00 30 00 30 00 30 |.0.0.0.0 .0.0.0.0|
0090 00 30 00 30 00 30 00 30-00 30 00 30 00 30 00 30 |.0.0.0.0 .0.0.0.0|
00a0 00 30 00 30 00 30 00 30-00 30 00 30 00 30 00 2e |.0.0.0.0 .0.0.0..|
00b0 00 08 44 00 42 00 53 00-51 00 4c 00 54 00 30 00 |..D.B.S. Q.L.T.0.|
00c0 34 00 00 01 00 ab 60 00-25 0e 00 00 00 00 22 00 |4.....`. %.....".|
00d0 54 00 68 00 65 00 20 00-73 00 74 00 61 00 74 00 |T.h.e. . s.t.a.t.|
00e0 65 00 6d 00 65 00 6e 00-74 00 20 00 68 00 61 00 |e.m.e.n. t. .h.a.|
00f0 73 00 20 00 62 00 65 00-65 00 6e 00 20 00 74 00 |s. .b.e. e.n. .t.|
0100 65 00 72 00 6d 00 69 00-6e 00 61 00 74 00 65 00 |e.r.m.i. n.a.t.e.|
0110 64 00 2e 00 08 44 00 42-00 53 00 51 00 4c 00 54 |d....D.B .S.Q.L.T|
0120 00 30 00 34 00 00 01 00-fd 02 00 fd 00 00 00 00 |.0.4.... ........|
0130 00                     -                        |.|

10:38:18.673299 5857 (token.c:555):processing result tokens.  marker is  aa(ERROR)
10:38:18.673305 5857 (token.c:122):tds_process_default_tokens() marker is aa(ERROR)
10:38:18.673311 5857 (token.c:2588):tds_process_msg() reading message 7123 from server
10:38:18.673322 5857 (token.c:2661):tds_process_msg() calling client msg handler
10:38:18.673328 5857 (dbutil.c:85):_dblib_handle_info_message(a37b60, a631d8, ffbde8f8)
10:38:18.673334 5857 (dbutil.c:86):msgno 7123: "Invalid text, ntext, or image pointer value 0x00000000000000000000000000000000."


Regards
Trygve Liland
&lt;/pre&gt;</description>
    <dc:creator>Trygve Liland</dc:creator>
    <dc:date>2012-05-25T12:15:33</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14515">
    <title>Handling TDS errors from PHP</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14515</link>
    <description>&lt;pre&gt;Hello.

Is there any way to handle TDS errors from PHP code?

Here's what I'm trying to do: I'm working on user authorization using 
MsSql database login and password. The same login that is used to 
connect to MsSql database. Currently I'm just connecting to database and 
checking if the connection worked. If credentials are correct, 
everything works fine. But, if either login of password is wrong, my PDO 
connection just dies with this error:
FreeTDS: db-lib: exiting because client error handler returned INT_EXIT 
for msgno 20002
And that also crashes my php session.

Is there any way I can implement that client error handler on my PHP 
side, or it should had already been dealt by PDO_DBLIB?
&lt;/pre&gt;</description>
    <dc:creator>Николай Кудрявцев</dc:creator>
    <dc:date>2012-05-24T10:32:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14514">
    <title>Question on TDS and compatibility on SQL 2012</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14514</link>
    <description>&lt;pre&gt;Hello,

I am new to FREETDS.  I'm working on as DBA Admin and owner of database on SQL 2000 sp3
We are currently using PHP version is 5.2.6  running on OSX Server  using FreeTDS&amp;lt;http://www.freetds.org/&amp;gt; (ver 0.82) to communicate with MS SQL Server 2000.


Can someone confirm my understanding of TDSfree?  It's an API that works with SQL Server... Underneath the hood -  it uses TDS specification to access the SQL Server database.   (Therefore it does not need to have SQL Server Native Client drives, etc installed on machine housing webserver/php )

Separately:
I wanted to ask the group if anyone has setup TDSfree with SQL 2012?

Thank you for any help and info




This message is the property of Kamehameha Schools and any attachments are confidential to the intended recipient at the e-mail address to which it has been addressed. If you are not the intended recipient, you may not copy, forward, disclose or use any part of this message or its attachments. If you received this transmission in error please notify the sender immediately by e-mail or contact Kamehameha Schools at 808 523 6200 and then delete this message from your system.
&lt;/pre&gt;</description>
    <dc:creator>Norman Chan</dc:creator>
    <dc:date>2012-05-24T00:15:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14507">
    <title>New freetds repo... MARS are coming!</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14507</link>
    <description>&lt;pre&gt;Hi,
   I created a new freetds repo at
https://gitorious.org/~freddy77/freetds/mars-freetds.

No, I'm not mad and it's not a fork. However I don't like to have my
personal branches on the official repo.

One of the main reason is to share mars branch (actually the only
additional branch).

Currently all tests passes even with mars code !!! But not all
enabling mars... and upper layers do not currently support it and
there are no specific tests! So... quite useless branch :)

Apart from odbc support (the only library which support it) blob1 test
fails with mars enabled due to the fact that if client does not limit
packets sending speed server drop connection. I think this is another
point to add to the James page on why do not use mars !! The other
test that fails is cursor4 due to different protocol for transaction
if mars is enabled (perhaps another small point to add to above page).

Currently another problem is error reporting. If server drop
connection all sessions should receive a network error.

Frediano
&lt;/pre&gt;</description>
    <dc:creator>Frediano Ziglio</dc:creator>
    <dc:date>2012-05-19T16:53:55</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14504">
    <title>git push #1</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14504</link>
    <description>&lt;pre&gt;For anyone interested in the git repository, I just pushed my first
commit with

git push ssh://git&amp;lt; at &amp;gt;gitorious.org/freetds/freetds.git

It seemed work.  I'm still getting the hang of git.  

There are two changes:

1.  fix code that induces warnings in clang.  All innocuous.  
2.  remove txt2man.

All man pages are now in -mdoc format.  It was a few hours' work.  The
man pages now look a little better and we lose one dependency.  With a
little cleverness, we could have them in PDF format, too.  

The warnings were mostly about using // as a comment, something I'm
guilty of.  These became either /**/ or #if 0.  

The most significant changes are to md4.c and md5.c.  Each had a line 

memset(ctx, 0, sizeof(ctx));
now
memset(ctx, 0, sizeof(*ctx));

The line intends to clear memory before returning to prevent sensitive
data from remaining in memory.  It was clearing sizeof(void*) instead of
the whole structure.  

--jkl
&lt;/pre&gt;</description>
    <dc:creator>James K. Lowden</dc:creator>
    <dc:date>2012-05-18T21:50:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14502">
    <title>FreeTDS SYBUNIQUE Bug / Patch</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14502</link>
    <description>&lt;pre&gt;Hi!


I think there is a bug in FreeTDS regarding SYBUNIQUE column type...

I'm accessing a MS SQLServer 2008 using freetds-0.91/ctlib. The server
table has "uniqueidentifier" columns (which correspond to SYBUNIQUE /
CS_UNIQUE_TYPE).

With "ct_bind" i set the datatype to CS_UNIQUE_TYPE. However,
"ct_fetch" doesnt return any data (copied=0) :-(

Using "tdsdump", i see the following lines in the tracefile:

  01:19:57.072719 7027 (ct.c:1736):_ct_bind_data(): column 25 is type 36 and has length 16
  01:19:57.072725 7027 (ct.c:1907):_ct_get_client_type(type 36, user 0, size 16)
  01:19:57.072730 7027 (cs.c:523):cs_convert(0x8d8d2e0, 0xbfc76fcc, 0xb74a1bc4, 0xbfc76f20, 0x8e85438, 0x8e85450)
  01:19:57.072735 7027 (ct.c:2018):_ct_get_server_type(40)
  01:19:57.072740 7027 (ct.c:2018):_ct_get_server_type(40)
  01:19:57.072745 7027 (cs.c:569):converting type 36 (16 bytes) to type = 36 (16 bytes)
  01:19:57.072750 7027 (cs.c:583):cs_convert() srctype == desttype
  01:19:57.072755 7027 (cs.c:697):error: unrecognized type
                                  ^^^^^^^^^^^^^^^^^^^^^^^^
  01:19:57.072760 7027 (cs.c:66):cs_prretcode(0)
  01:19:57.072764 7027 (cs.c:702):cs_convert() returning  CS_FAIL
  01:19:57.072769 7027 (ct.c:1779):cs_convert-result = 1
  01:19:57.072774 7027 (ct.c:1781):error: converted only 0 bytes for type 40 


Where:
  client type 40: CS_UNIQUE_TYPE
  server type 36: SYBUNIQUE

Ie, while trying to "cs_convert(SYBUNIQUE -&amp;gt; SYBUNIQUE)" we come to:

freetds-0.91/src/ctlib/cs.c
...
convert()
{
  ...
  /* many times we are asked to convert a data type to itself */
  if (src_type == desttype) {
    tdsdump_log(TDS_DBG_FUNC, "cs_convert() srctype == desttype\n");
    switch (desttype) {
      case SYBLONGBINARY:
      case SYBBINARY:
      ...
      default:
      ^^^^^^^^
        tdsdump_log(TDS_DBG_FUNC, "error: unrecognized type\n");
        ret = CS_FAIL;
        break;
    }


So it seems, that the SYBUNIQUE case is missing...

Anyway, here is my patch:

--- freetds-0.91/src/ctlib/cs.c.ori   2010-10-05 10:36:36.000000000 +0200
+++ freetds-0.91/src/ctlib/cs.c         2012-05-16 02:09:42.000000000 +0200
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -682,6 +682,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
       case SYBDECIMAL:
           src_len = tds_numeric_bytes_per_prec[
             ((TDS_NUMERIC *) srcdata)-&amp;gt;precision] + 2;
       case SYBBITN:
+      case SYBUNIQUE:
            memcpy(dest, srcdata, minlen);
           *resultlen = minlen;

At least, that seems to solve my problem ;-)


\wlang{}

&lt;/pre&gt;</description>
    <dc:creator>Willi Langenberger</dc:creator>
    <dc:date>2012-05-16T10:52:57</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14500">
    <title>Buffer overflow in FreeTDS code</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14500</link>
    <description>&lt;pre&gt;Hi,
  some days ago I discovered (and fixed) a small buffer overflow in
both 0.91 and development code.

Change at https://gitorious.org/freetds/freetds/commit/e5fe918627ab00e99faadd2c2ee0022f0be7dc98.

It's a small read overflow (probably leading only to a crash) but
still a buffer overflow.

Frediano
&lt;/pre&gt;</description>
    <dc:creator>Frediano Ziglio</dc:creator>
    <dc:date>2012-05-15T17:14:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14497">
    <title>MSSQL Server 2005 - select [field] AS [name] does notwork?</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14497</link>
    <description>&lt;pre&gt;Hi guys,

I have a unix server which has PHP 5.2.13 installed, and it has access to two SQL servers (one is running MSSQL SERVER 2000 and the other MSSQL 2005).

It uses FreeTDS - details:
*         Version: freetds v0.91
*         freetds.conf directory: /usr/local/etc
*         MS db-lib source compatibility: no
*         Sybase binary compatibility: no
*         Thread safety: yes
*         iconv library: yes
*         TDS version: 7.1
*         iODBC: no
*         unixodbc: yes
*         SSPI "trusted" logins: no
*         Kerberos: no

And I'm using unixODBC-2.3.1

The MSSQL 2000 server is fine, I can run all SQL statements and use mssql_num_rows and mssql_fetch_assoc much as you would with MySQL.

However, the MSSQL 2005 server won't work with mssql_num_rows or mssql_fetch_assoc - you have to use odbc_fetch_row.

That's not really an issue, I assume it's just due to the different server versions.

However, I have a huge issue with the MSSQL 2005 server connection: I cannot select a field AS another name!

For example:

SELECT


   [EnquiryID] AS "The_Key"


   FROM [db].[dbo].[table]


Which works fine in my admin application (ie: NOT PHP), but if I run the same in my PHP environment, I get:

stdClass Object


(


    [PK_EnquiryID] =&amp;gt; 1


)




You can see it should be [The_Key] =&amp;gt; 1

It's reproducible - and I have access to two servers (one with FreeTDS 0.82, the other with 0.91) - both exhibit this behaviour.

Before I rewrite all my queries to separate ones, has anyone any idea how I can get round this, please? I'm tearing my hair out!

Cheers

Neil
---
www.hencam.co.uk&amp;lt;http://www.hencam.co.uk&amp;gt; - for when you really want to watch hens on the Internet...

If you are not the intended recipient, please notify the sender immediately by replying to the e-mail, and then delete it without making copies or using it in any way. Although any attachments to the message will have been checked for viruses before transmission, you are urged to carry out your own virus check before opening attachments, since Acorn Stairlifts accepts no responsibility for loss or damage caused by software viruses.
&lt;/pre&gt;</description>
    <dc:creator>Neil Whitaker</dc:creator>
    <dc:date>2012-05-15T10:56:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14496">
    <title>MSSQL Server 2005 - select [field] AS [name] does notwork?</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14496</link>
    <description>&lt;pre&gt;I have a unix server which has PHP 5.2.13 installed, and it has access to
two SQL servers (one is running MSSQL SERVER 2000 and the other MSSQL 2005).

It uses FreeTDS - details:

   - Version: freetds v0.91
   - freetds.conf directory: /usr/local/etc
   - MS db-lib source compatibility: no
   - Sybase binary compatibility: no
   - Thread safety: yes
   - iconv library: yes
   - TDS version: 7.1
   - iODBC: no
   - unixodbc: yes
   -
   - SSPI "trusted" logins: no
   - Kerberos: no

And I'm using unixODBC-2.3.1

The MSSQL 2000 server is fine, I can run all SQL statements and use
mssql_num_rows and mssql_fetch_assoc much as you would with MySQL.

However, the MSSQL 2005 server won't work with mssql_num_rows or
mssql_fetch_assoc - you have to use odbc_fetch_row.

That's not really an issue, I assume it's just due to the different server
installs.

However, I have a huge issue with the MSSQL 2005 server connection: I
cannot select a field AS another name!

For example:

SELECT
   [EnquiryID] AS "The_Key"
   FROM [db].[dbo].[table]

Works fine in my admin application (ie: NOT PHP), but if I run the same in
my PHP environment, I get:

stdClass Object
(
    [PK_EnquiryID] =&amp;gt; 1
)

You can see it should be [The_Key] =&amp;gt; 1

Has anyone any idea how we can get round this, please? I'm tearing my hair
out!

Cheers

Neil
---
www.hencam.co.uk - for when you really want to watch hens on the Internet...
&lt;/pre&gt;</description>
    <dc:creator>neil&lt; at &gt;hencam.co.uk</dc:creator>
    <dc:date>2012-05-15T10:50:16</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14488">
    <title>Misinterpereting instance as part of server</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14488</link>
    <description>&lt;pre&gt;I have a FreeTDS/odbc source that appears to be trying to resolve the server and instance of "servername.domain\db1" as a server instead of a server called "servername.domain"
and an instance "db1"



I know this should work because I have two linux servers using the same exact odbc source.
Server A works.
Server B doesn't.

SERVER A:
-------------------------------------------------------
A Redhat server.
Using a data source in odbc.ini, I can connect to a particular MS SQL server and instance with the following server name in the source definition:

Server = Servername.domain\db1

Some info from that server:

$ tsql -C
Compile-time settings (established with the "configure" script):
                           Version: freetds v0.64
    MS db-lib source compatibility: yes
       Sybase binary compatibility: unknown
                     Thread safety: yes
                     iconv library: yes
                       TDS version: 4.2
                             iODBC: no
                          unixodbc: yes

$ odbcinst --version
unixODBC 2.2.11


SERVER B:
-------------------------------------------------------
Debian Etch (old) server:
FreeTDS and odbcinst work perfectly Server B when accessing any of several MS SQL servers.
I am able to connect to several MS SQL servers from this machine, but only if they don't require an instance.

Using the exact same data source definition as Server A, I am unable to connect to the same MS SQL server of "servername.domain\db1"

The error message is:
failed: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source (SQL-08001)(DBD: db_login/SQLConnect err=-1)

Also, tcpdump shows that the command never leaves server B. It appears that it is trying to resolve the server "servername.domain\db1" instead of "servername.domain"

When I remove the instance from the server, I get a "connection refused" error - which means I am at least reaching the MS SQL box but it doesn't do me any good because I need the instance to connect.

It appears that the server instance (\db1) is getting interpereted as part of the server name.

Some info from server B.

# tsql -C
Compile-time settings (established with the "configure" script)
                            Version: freetds v0.83.dev.20090814
             freetds.conf directory: /usr/local/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 5.0
                              iODBC: no
                           unixodbc: no


# odbcinst --version
unixODBC 2.2.11
&lt;/pre&gt;</description>
    <dc:creator>Dave Schultz</dc:creator>
    <dc:date>2012-05-08T18:43:29</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14487">
    <title>tsql -S works but tsql -H times out</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14487</link>
    <description>&lt;pre&gt;Have freetds 0.91 compiled on a CentOS box
and trying to connect to SQL Server 2008 
in freetds.conf have
[shortname]
  host=123.123.123.123
  instance = tester
  tds version = 8.0

tsql -S shortname -U user   will connect right away
however

tsql -H 123.123.123.123 -U user
just ticks away until I get a timeout error

Is it because I'm not passing the instance when I use -H? --is there a way to do that? 

What I really want to do is talk to the DB server using an ant build script, but it was breaking. 

Any help appreciated,
&lt;/pre&gt;</description>
    <dc:creator>Morizono, Hiroki</dc:creator>
    <dc:date>2012-05-08T13:58:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14486">
    <title>Nested Select Statements</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14486</link>
    <description>&lt;pre&gt;Hello,

I am connecting to a Microsoft SQL Server 2008 database using unixODBC and
FreeTDS on PHP. Everything was going well until the ORM library that I'm
using (Doctrine) attempted to perform a select statement while cycling
through the result set of another query. I received the error:
"SQLSTATE[24000]: Invalid cursor state: 0 [FreeTDS][SQL Server]Invalid
cursor state (SQLExecute[0] at ../pdo_odbc/odbc_stmt.c:254)"

After doing some research, it appears that this behavior is by-design in
FreeTDS (http://www.freetds.org/faq.html#pending). Is this error that I'm
getting because of this implementation detail? If so, are there any plans
to change this behavior? If not, does anyone have any recommendations for a
driver I could use with PHP that would allow this behavior?

Under normal circumstances, I would simply adjust the code myself. However,
since I'm using someone else's library, I don't exactly have this luxury.

Any suggestions are appreciated.
Thank you!
&lt;/pre&gt;</description>
    <dc:creator>Jeremy Livingston</dc:creator>
    <dc:date>2012-05-08T03:18:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14480">
    <title>headers for odbc functions</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14480</link>
    <description>&lt;pre&gt;
I'm having some trouble figuring out how to use ODBC functions like SQLConnect() with freetds.  
I've looked through the FAQ, and searched the web for examples, and even grep'd through the freetds tarball I downloaded (freetds-stable.tgz) for a header with the SQLConnect function prototype, but I can't find anything.
I feel I'm missing something obvious, but I can't quite figure out what.  
Can someone point me in the right direction here?

Thanks,
eric
&lt;/pre&gt;</description>
    <dc:creator>Haszlakiewicz, Eric</dc:creator>
    <dc:date>2012-05-07T17:20:32</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14479">
    <title>SQL_NO_TOTAL error on text larger than 4096 bytes</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14479</link>
    <description>&lt;pre&gt;I am using haskell bindings to unixodbc and freetds.
They work fine with freetds 0.82 and unixodbc 2.3.0

But upgrade to freetds 0.91 and unixodbc 2.3.1 breakes it. Now it gives me a 
SQL_NO_TOTAL error on text larger than 4096 bytes.
I submitted bug to hdbc-odbc lib here: https://github.com/hdbc/hdbc-
odbc/issues/4

I looked through the code of haskell bindings and it does not handle 
SQL_NO_TOTAL. Just returns an error.

Can anyone tellme what changed either in freetds or in unixodbc to cause it to 
return SQL_NO_TOTAL instead of just the length of the field ?

Can we bring the old functionality back ? Or if not, how to correctly respond 
to SQL_NO_TOTAL ?

Regards,
Vagif Verdi
&lt;/pre&gt;</description>
    <dc:creator>Vagif Verdi</dc:creator>
    <dc:date>2012-05-07T04:42:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14475">
    <title>clang static analysis</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14475</link>
    <description>&lt;pre&gt;http://www.freetds.org/scan-build/

The above analysis was produced by the Clang "static-build" tool based
on a recent version of the development branch.  A spot-check shows
several false positives but some bona fide errors e.g.

http://www.freetds.org/scan-build/report-06549p.html#EndPath

There are 206 potential errors indicated.  If you would like to
contribute to the project, it would be very helpful simply to sort
those 206 into two kinds:

1.  errors
2.  non-errors

If several people do this, we will have good feedback for both the
FreeTDS and Clang projects.  In the case of Clang, perhaps we can
classify the non-errors.  For instance, I noticed that variables
initialized as a function output parameter isn't recognized as
initialization, and a pointer is detected as NULL after being tested
with assert(3) (although arguably the assert is insufficient).  

Patches are also welcome, of course.  :-)

FreeTDS is an interesting test case for the Clang static analyzer
by virtue of its portability.  Recent AIX issues notwithstanding,
FreeTDS is highly portable and conscientious about standards.  The
project has tens of thousands of users, and has held stable at ~100,000
lines of code for several years.  Yet static analysis continues to turn
up potential errors.  

--jkl
&lt;/pre&gt;</description>
    <dc:creator>James K. Lowden</dc:creator>
    <dc:date>2012-05-03T22:36:34</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14468">
    <title>OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY =(78) NUMBER = (35)</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14468</link>
    <description>&lt;pre&gt;Hi,

I am new to freetds and have some questions about intermittent error
below that we get from our monitoring system that uses freetds for
SQLServer connect check:

ALERT                  : Unable to connect to instance
ERROR TEXT             : OpenClient message: LAYER = (0) ORIGIN = (0)
SEVERITY = (78) NUMBER = (35)
Server &amp;lt;server_name_here&amp;gt;, database Message String: SQL Server
connection timed out.

Every time when I get above alert
- I can successfully connect to SQLServer
- do not see any errors around that time in SQLServer log
- moreover even SQLServer default trace file does not show any
activity happening around that time for some affected servers
- issue affects different servers at different times (I do not see any pattern)
- other databases on the affected instance that are checked also by
monitoring system do not have same connection issue
- it is always one-off and intermittent issue (next run of monitoring
check scheduled every 15 mins does not have this connection issue)

Question are
1) What does "LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (35)"
error mean and what can be the cause of this error?
2) I am not sure if it is genuine connect issues (some intermittent
network problems) or freetds bug/wrong configuration/high load (we
check hundreds of databases each run)

Please advise.

&lt;/pre&gt;</description>
    <dc:creator>box.eugene</dc:creator>
    <dc:date>2012-05-01T01:33:34</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14465">
    <title>Support for AIX 7.1</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14465</link>
    <description>&lt;pre&gt;Hi all,

Sorry if this question was asked before in this mailing list, but
we need to install FreeTDS on an AIX 7.1.

So far we could only compile on AIX 6.1, configure does not seem
to be prepared for AIX 7.1 ...

What is the status about AIX 7.1 support?

Is it legal to compile on AIX 6.1 and copy the binaries on 7.1?

Is there any guide to build FreeTDS on AIX 6.1?

Thanks!
Seb
&lt;/pre&gt;</description>
    <dc:creator>Sebastien FLAESCH</dc:creator>
    <dc:date>2012-04-27T14:41:55</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14461">
    <title>FreeTDS and out of Memor Error when trying to readdiacritics</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14461</link>
    <description>&lt;pre&gt;Hello,

 

    I was wondering if someone might be able to help me.  We are using
SUSE 11 SP1 64 bit, SQL Server 2008 R2, unixODBC 2.2.12 driver and
FreeTDS 0.91 and PHP 5.3.8.  When retrieving a row with diacritics we
get a php out of memory error where it is trying to read all of the
memory in the system.  Looking at the logs for FreeTDS we are getting
the following error:

 

util.c:104:logic error: cannot change query state from IDLE to PENDING

 

If we skip reading any fields with diacritics the data is read without
any issue. I've searched around and could not find any information about
this.  We do have the text size set in the config file but this does not
seem to resolve the issue.

 

Any help would be greatly appreciated.

 

Thanks,

-Nate

 

Nathan Sarr

Senior Software Engineer

River Campus Libraries

University of Rochester

Rochester, NY  14627

(585) 275-0692

nsarr&amp;lt; at &amp;gt;library.rochester.edu &amp;lt;mailto:nsarr&amp;lt; at &amp;gt;library.rochester.edu&amp;gt; 
&lt;/pre&gt;</description>
    <dc:creator>Sarr, Nathan</dc:creator>
    <dc:date>2012-04-26T14:14:56</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14460">
    <title>fisql segmentation fault with AIX 6.1 Freetds 0.91</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14460</link>
    <description>&lt;pre&gt;Hello –

We have compiled 0.91 Free TDS on AIX 6.1.

Freebcp is working, but fisql and tsql are both coring with a segmentation fault.

Here are the steps we did:

◄

cd /datatransfer/ftp/freetds_0.91/freetds-0.91









◄

./configure CC=xlc_r --prefix=/rating/freetds --disable-debug --disable-shared



◄

rm -rf /rating/freetds



◄

make &amp;amp;&amp;amp; make install




There are some linker warnings occurring with the compile:

(ld): resolve
ld: 0711-224 WARNING: Duplicate symbol: .bcopy
ld: 0711-228 WARNING: Duplicate symbols were found while resolving symbols.
The following duplicates were found:
Symbol Source-File(Object) OR Import-File{Shared-object}
------------------------- -------------------------------------------------
.bcopy {/usr/lib/libreadline.a[libreadline.so.6]}
** Duplicate ** moveeq.s(/usr/lib/libc.a[moveeq.o])

...

ld: 0711-768 WARNING: Object fisql.o, section 1, function .strcat:
The branch at address 0x78c is not followed by a recognized no-op
or TOC-reload instruction. The unrecognized instruction is 0x806100A8.


Any help or input would be much appreciated…

Thanks. Lisa McCabe


_______________________________________________
FreeTDS mailing list
FreeTDS&amp;lt; at &amp;gt;lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
&lt;/pre&gt;</description>
    <dc:creator>Mccabe, Lisa L</dc:creator>
    <dc:date>2012-04-25T15:00:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.db.tds.freetds/14453">
    <title>Trouble connection to TDS connection Pooling</title>
    <link>http://comments.gmane.org/gmane.comp.db.tds.freetds/14453</link>
    <description>&lt;pre&gt;

Hello !
I am trying to use Freetds Connection Pool but something is wrong and I 
can not get any result
back from the pool. I have the following configurations:

$cat /usr/local/etc/pool.conf
[global]
         min pool conn = 5
         max pool conn = 10
         max member age = 120

[mypool4]
         user = myuser
         password = myuser
         database = MyDatabase
         server = 1XX.1XX.X.XXX
         port = 6668
         TDS_Version = 4.2

$cat /usr/local/etc/freetds.conf


[hype]
         host            = 127.0.0.1
         port            = 6668
         tds version     =  4.2
And start the Pool server:

$tdspool mypool4 &amp;amp;

And seting up an entry in my .odbc:


[pool2]
Driver          = /usr/local/lib/libtdsodbc.so
Description     = Sybase JDBC Server
Trace           = Yes
ServerName      = hype
Port            = 6668
TDS_Version     = 4.2

When I run the following command:
$¨ isql -v pool2 myuser myuser

I never get a response from the Pooling server. I can see that the Pool 
server received the connection:
accepting connection
block size 512
host MyMachin
user myuser
pass myuser
app
srvr hype
vers 4.2
lib
lang us_english
char iso_1
bsiz 512

And the Pooling server established connections with the MS SQL server.
Something is wrong, but I do not know what.
Here is DUMP:

         on 2012-04-24 15:18:34 with debug flags 0xffff.
15:18:34.935340 10213 (iconv.c:197):names for ISO-8859-1: ISO-8859-1
15:18:34.935410 10213 (iconv.c:197):names for UTF-8: UTF-8
15:18:34.935476 10213 (iconv.c:197):names for UCS-2LE: UCS-2LE
15:18:34.935541 10213 (iconv.c:197):names for UCS-2BE: UCS-2BE
15:18:34.935607 10213 (iconv.c:363):iconv to convert client-side data 
to the "ISO-8859-1" character set
15:18:34.935722 10213 (iconv.c:516):tds_iconv_info_init: converting 
"ISO-8859-1"-&amp;gt;"UCS-2LE"
15:18:34.935870 10213 (net.c:210):Connecting to 127.0.0.1 port 6668 
(TDS version 4.2)
15:18:34.936441 10213 (net.c:262):connection established
15:18:34.936541 10213 (net.c:303):tds_open_socket() succeeded
15:18:34.936622 10213 (util.c:162):Changed query state from DEAD to 
IDLE
15:18:34.936708 10213 (net.c:779):Sending packet
0000 02 00 02 00 00 00 00 00-53 37 37 30 30 30 34 36 |........ 
SXXXXXXX|
0010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0020 00 00 00 00 00 00 08 61-6d 73 75 73 65 72 00 00 |.......m 
yusere..|
0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0040 00 00 00 00 00 07 61 6d-73 75 73 65 72 00 00 00 |.......m 
myuse...|
0050 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0060 00 00 00 00 07 33 37 38-37 36 00 00 00 00 00 00 |.....378 
76......|
0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0080 00 00 00 05 02 00 06 04-08 01 00 00 00 00 00 02 |........ 
........|
0090 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
00a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
00b0 00 00 00 68 79 70 65 00-00 00 00 00 00 00 00 00 |...hype. 
........|
00c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
00d0 00 04 61 6d 73 75 73 65-72 00 00 00 00 00 00 00 |..myuser 
........|
00e0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
00f0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0100 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0110 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0120 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0130 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0140 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0150 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0160 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0170 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0180 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
0190 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
01a0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
01b0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
01c0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
01d0 00 07 04 02 00 00 00 00-00 00 00 00 00 00 00 00 |........ 
........|
01e0 00 00 00 00 00 00 0c 10-75 73 5f 65 6e 67 6c 69 |........ 
us_engli|
01f0 73 68 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |sh...... 
........|

15:18:34.937754 10213 (net.c:779):Sending packet
0000 02 01 00 4c 00 00 00 00-00 00 00 00 00 00 0a 00 |...L.... 
........|
0010 00 00 00 00 00 00 00 00-00 00 00 00 00 69 73 6f |........ 
.....iso|
0020 5f 31 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |_1...... 
........|
0030 00 00 00 00 00 00 00 00-00 00 00 05 01 35 31 32 |........ 
.....512|
0040 00 00 00 03 00 00 00 00-00 00 00 00             |........ ....|

15:18:34.937980 10213 (token.c:312):tds_process_login_tokens()
15:18:34.940017 10213 (net.c:592):Received header
0000 04 01 00 d5 00 00 00 00-                        |...Õ....|

15:18:34.940129 10213 (net.c:671):Received packet
0000 e3 11 00 01 08 50 44 42-5f 41 46 49 33 06 6d 61 |ã....XXX 
_XXXX.ma|
0010 73 74 65 72 ab 3b 00 45-16 00 00 02 0a 27 00 43 |ster«;.E 
.....'.C|
0020 68 61 6e 67 65 64 20 64-61 74 61 62 61 73 65 20 |hanged d atabase 
|
0030 63 6f 6e 74 65 78 74 20-74 6f 20 27 50 44 42 5f |context  to 
'XXX_|
0040 41 46 49 33 27 2e 04 4a-44 42 43 05 5a 5a 5a 5a |XXXX'..J 
DBC.ZZZZ|
0050 5a 01 00 e3 0d 00 02 0a-75 73 5f 65 6e 67 6c 69 |Z..ã.... 
us_engli|
0060 73 68 00 ab 3d 00 47 16-00 00 01 0a 29 00 43 68 |sh.«=.G. 
....).Ch|
0070 61 6e 67 65 64 20 6c 61-6e 67 75 61 67 65 20 73 |anged la nguage 
s|
0080 65 74 74 69 6e 67 20 74-6f 20 27 75 73 5f 65 6e |etting t o 
'us_en|
0090 67 6c 69 73 68 27 2e 04-4a 44 42 43 05 5a 5a 5a |glish'.. 
JDBC.ZZZ|
00a0 5a 5a 01 00 e3 06 00 04-03 35 31 32 00 ad 14 00 |ZZ..ã... 
.512....|
00b0 01 00 00 00 00 0a 73 71-6c 20 73 65 72 76 65 72 |......sq l 
server|
00c0 01 00 00 01 fd 00 00 02-00 01 00 00 00          |....ý... .....|

15:18:34.940504 10213 (token.c:316):looking for login token, got  
e3(ENVCHANGE)
15:18:34.940572 10213 (token.c:108):tds_process_default_tokens() marker 
is e3(ENVCHANGE)
15:18:34.940662 10213 (token.c:316):looking for login token, got  
ab(INFO)
15:18:34.940727 10213 (token.c:108):tds_process_default_tokens() marker 
is ab(INFO)
15:18:34.940796 10213 (token.c:2451):tds_process_msg() reading message 
from server


Any help for debugging or troubleshooting would be appreciated. I am 
using Perl to try to connect to the pool
so if there is some better solution in Perl for pooling solution please 
let me know.

/Ed



_______________________________________________
FreeTDS mailing list
FreeTDS&amp;lt; at &amp;gt;lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
&lt;/pre&gt;</description>
    <dc:creator>freetds&lt; at &gt;mittran.com</dc:creator>
    <dc:date>2012-04-24T13:27:27</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.db.tds.freetds">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.db.tds.freetds</link>
  </textinput>
</rdf:RDF>

