Assertin failed: unknown bindtype with unknown varlen

LacaK <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Hi,
I get this error "unknown bindtype with unknown varlen" when calling 
dbconvert() in dblib.
This is my situation:
I have table with VARBINARY column with value which is empty not null 
(dbdatlen() = 0)
Then I call dbconvert with srctype=SQLBINARY, srclen=0, 
desttype=SQLBINARY, destlen > 0 and I get above mentioned assertion.

Looking into dbconvert there is in the begining (note condition: srclen==0):

     if (src == NULL || srclen == 0) {
         int bind = dbbindtype(desttype);
         int size = tds_get_size_by_type(desttype);

         if (SYBCHAR == desttype) {
             if (destlen > 0) {
                 size = destlen;
                 bind = CHARBIND;
             } else {
                 size = 1;
                 bind = NTBSTRINGBIND;
             }
         }

         dbgetnull(dbproc, bind, size, dest);   // <--- HERE OCCURS 
ASSERTION
         return size;
     }

Next look into dbgetnull():

     /*
      * For variable-length types, nonpositive varlen indicates
      * buffer is "big enough" but also not to pad.
      * Apply terminator (if applicable) and go home.
      */
     if (varlen <= 0) {
         switch (bindtype) {
         case STRINGBIND:
         case NTBSTRINGBIND:
             varaddr[pnullrep->len] = '\0';
             /* fall thru */
         case CHARBIND:
         case VARYCHARBIND:
+      case BINARYBIND:       // <--- MISSING HERE ?
+      case VARYBINBIND:     // <--- MISSING HERE ?
             break;

As BINARYBIND is not handled ATM default is executed:
         default:
             assert(!"unknown bindtype with unknown varlen");

Can you please fix it ?
Thanks
-Laco.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.