[freetds] Need help understanding an error

Bruce Seely bseely at stsci.edu
Thu Jul 2 08:51:46 EDT 2020


We are using freeTDS with the ODBC package that is provided by our Lisp vendor.
Beginning with freeTDS version 1.1.1, we started seeing an error for queries that worked in earlier releases:

Error: While getting numeric column info, Allegro ODBC detected an error: error code returned


The ODBC code has a function SQLCOLATTRIBUTES that calls freeTDS code.
The same call that worked in pre 1.1.1 releases, fails now.
Also, when the freeTDS call fails, no reason is provided.

Below are traces of the test run in versions 1.00.99 and 1.1.1.

We are complaining to the Lisp folks, and they don’t know what to do, since there is no explanation for the error.
What changed in version 1.1 that would cause this?

Thank you very much for your help.

Bruce Seely
Space Telescope Science Institute



;;;;;;; This is what is being done by the test function  ;;;;;;;;;;;;;;;;

  (setq db (connect :data-source-name "R2D2" :user "bseely" :password “..." ))
  (sql "use pps_lrp_alpha" :db db)
  (sql "select * from ppsdb_version" :db db))

;;;;;;; run in version 1.00.99  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

CL-USER(2): (test "ppsdb_version")
>>doing (DBI::WITH-NATIVE-STRING-ODBC (DBI::SQL-STATEMENT
                                       DBI::SQL-STATEMENT
                                       DBI::DB)
          (DBI::SQLEXECDIRECT DBI::HSTMT DBI::SQL-STATEMENT
                              DBI::SQL_NTS))%<< and it returns 1
; Autoloading for FOREIGN-FUNCTIONS:CHAR*-TO-STRING:
; Fast loading from bundle code/ffcompat.fasl.
>>doing (DBI::SQLNUMRESULTCOLS DBI::HSTMT DBI::COUNT-VAR)%<< and it returns 0
>>doing (DBI::SQLMORERESULTS DBI::HSTMT)%<< and it returns 100
>>doing (DBI::WITH-NATIVE-STRING-ODBC (DBI::SQL-STATEMENT
                                       DBI::SQL-STATEMENT
                                       DBI::DB)
          (DBI::SQLEXECDIRECT DBI::HSTMT DBI::SQL-STATEMENT
                              DBI::SQL_NTS))%<< and it returns 0
>>doing (DBI::SQLNUMRESULTCOLS DBI::HSTMT DBI::COUNT-VAR)%<< and it returns 0
>>doing (IF* (EQL DBI::*ODBC-VERSION* 2)
           THEN (DBI::SQLCOLATTRIBUTES DBI::HSTMT DBI::COLUMN
                                       (IF*
                                        (EQL
                                         DBI::ATTRIBUTE
                                         DBI::SQL_DESC_NAME)
                                        THEN DBI::SQL_COLUMN_NAME
                                        ELSE DBI::ATTRIBUTE)
                                       DBI::RETVAL 256 DBI::CHAR-CNT 0)
           ELSE (DBI::SQLCOLATTRIBUTE DBI::HSTMT DBI::COLUMN
                                      DBI::ATTRIBUTE DBI::RETVAL 256
                                      DBI::CHAR-CNT 0))%
 0[2]: (DBI::SQLCOLATTRIBUTE #<DBI::ODBC-HSTMT
                               DBI::ODBC-HSTMT #x7fd4d5d1ec00 @
                               #x10011ae882>
                             1 1011
                             #<foreign object of class #:|anon-type-5|>
                             256
                             #<foreign object of class DBI::ODBC-SHORT-BOX>
                             0)
 0[2]: returned 0
<< and it returns 0
>>doing (IF* (EQL DBI::*ODBC-VERSION* 2)
           THEN (DBI::SQLCOLATTRIBUTES DBI::HSTMT DBI::COLUMN
                                       (IF*
                                        (EQL
                                         DBI::ATTRIBUTE
                                         DBI::SQL_DESC_NAME)
                                        THEN DBI::SQL_COLUMN_NAME
                                        ELSE DBI::ATTRIBUTE)
                                       DBI::RETVAL 256 DBI::CHAR-CNT 0)
           ELSE (DBI::SQLCOLATTRIBUTE DBI::HSTMT DBI::COLUMN
                                      DBI::ATTRIBUTE DBI::RETVAL 256
                                      DBI::CHAR-CNT 0))%
 0[2]: (DBI::SQLCOLATTRIBUTE #<DBI::ODBC-HSTMT
                               DBI::ODBC-HSTMT #x7fd4d5d1ec00 @
                               #x10011ae882>
                             2 1011
                             #<foreign object of class #:|anon-type-5|>
                             256
                             #<foreign object of class DBI::ODBC-SHORT-BOX>
                             0)
 0[2]: returned 0
<< and it returns 0
>>doing (IF* (EQL DBI::*ODBC-VERSION* 2)
           THEN (DBI::SQLCOLATTRIBUTES DBI::HSTMT DBI::COLUMN
                                       (IF*
                                        (EQL
                                         DBI::ATTRIBUTE
                                         DBI::SQL_DESC_NAME)
                                        THEN DBI::SQL_COLUMN_NAME
                                        ELSE DBI::ATTRIBUTE)
                                       DBI::RETVAL 256 DBI::CHAR-CNT 0)
           ELSE (DBI::SQLCOLATTRIBUTE DBI::HSTMT DBI::COLUMN
                                      DBI::ATTRIBUTE DBI::RETVAL 256
                                      DBI::CHAR-CNT 0))%
 0[2]: (DBI::SQLCOLATTRIBUTE #<DBI::ODBC-HSTMT
                               DBI::ODBC-HSTMT #x7fd4d5d1ec00 @
                               #x10011ae882>
                             3 1011
                             #<foreign object of class #:|anon-type-5|>
                             256
                             #<foreign object of class DBI::ODBC-SHORT-BOX>
                             0)
 0[2]: returned 0
<< and it returns 0
>>doing (IF* (EQL DBI::*ODBC-VERSION* 2)
           THEN (DBI::SQLCOLATTRIBUTES DBI::HSTMT DBI::COLUMN
                                       (IF*
                                        (EQL
                                         DBI::ATTRIBUTE
                                         DBI::SQL_DESC_NAME)
                                        THEN DBI::SQL_COLUMN_NAME
                                        ELSE DBI::ATTRIBUTE)
                                       DBI::RETVAL 256 DBI::CHAR-CNT 0)
           ELSE (DBI::SQLCOLATTRIBUTE DBI::HSTMT DBI::COLUMN
                                      DBI::ATTRIBUTE DBI::RETVAL 256
                                      DBI::CHAR-CNT 0))%
 0[2]: (DBI::SQLCOLATTRIBUTE #<DBI::ODBC-HSTMT
                               DBI::ODBC-HSTMT #x7fd4d5d1ec00 @
                               #x10011ae882>
                             4 1011
                             #<foreign object of class #:|anon-type-5|>
                             256
                             #<foreign object of class DBI::ODBC-SHORT-BOX>
                             0)
 0[2]: returned 0
<< and it returns 0
>>doing (DBI::BLOCK-CHECK #:G1415 (DBI::SQLFETCH #:G1412))%<< and it returns 0
>>doing (DBI::BLOCK-CHECK DBI::DB
                          (DBI::SQLGETDATA DBI::HSTMT DBI::INDEX
                                           DBI::TYPECODE DBI::RES
                                           DBI::WIDTH DBI::LENRES))%<< and it returns 0
>>doing (DBI::BLOCK-CHECK DBI::DB
                          (DBI::SQLGETDATA DBI::HSTMT DBI::INDEX
                                           DBI::TYPECODE DBI::RES
                                           DBI::WIDTH DBI::LENRES))%<< and it returns 0
>>doing (DBI::BLOCK-CHECK DBI::DB
                          (DBI::SQLGETDATA DBI::HSTMT DBI::INDEX
                                           DBI::TYPECODE DBI::RES
                                           DBI::WIDTH DBI::LENRES))%<< and it returns 0
>>doing (DBI::BLOCK-CHECK DBI::DB
                          (DBI::SQLGETDATA DBI::HSTMT DBI::INDEX
                                           DBI::TYPECODE DBI::RES
                                           DBI::WIDTH DBI::LENRES))%<< and it returns 0
>>doing (DBI::BLOCK-CHECK #:G1415 (DBI::SQLFETCH #:G1412))%<< and it returns 100
>>doing (DBI::WITH-NATIVE-STRING-ODBC (DBI::SQL-STATEMENT
                                       DBI::SQL-STATEMENT
                                       DBI::DB)
          (DBI::SQLEXECDIRECT DBI::HSTMT DBI::SQL-STATEMENT
                              DBI::SQL_NTS))%<< and it returns 0
>>doing (DBI::SQLNUMRESULTCOLS DBI::HSTMT DBI::COUNT-VAR)%<< and it returns 0
>>doing (IF* (EQL DBI::*ODBC-VERSION* 2)
           THEN (DBI::SQLCOLATTRIBUTES DBI::HSTMT DBI::COLUMN
                                       (IF*
                                        (EQL
                                         DBI::ATTRIBUTE
                                         DBI::SQL_DESC_NAME)
                                        THEN DBI::SQL_COLUMN_NAME
                                        ELSE DBI::ATTRIBUTE)
                                       DBI::RETVAL 256 DBI::CHAR-CNT 0)
           ELSE (DBI::SQLCOLATTRIBUTE DBI::HSTMT DBI::COLUMN
                                      DBI::ATTRIBUTE DBI::RETVAL 256
                                      DBI::CHAR-CNT 0))%
 0[2]: (DBI::SQLCOLATTRIBUTE #<DBI::ODBC-HSTMT
                               DBI::ODBC-HSTMT #x7fd4d5d1ec00 @
                               #x10011ae882>
                             1 1011
                             #<foreign object of class #:|anon-type-5|>
                             256
                             #<foreign object of class DBI::ODBC-SHORT-BOX>
                             0)
 0[2]: returned 0
<< and it returns 0
>>doing (IF* (EQL DBI::*ODBC-VERSION* 2)
           THEN (DBI::SQLCOLATTRIBUTES DBI::HSTMT DBI::COLUMN
                                       (IF*
                                        (EQL
                                         DBI::ATTRIBUTE
                                         DBI::SQL_DESC_NAME)
                                        THEN DBI::SQL_COLUMN_NAME
                                        ELSE DBI::ATTRIBUTE)
                                       DBI::RETVAL 256 DBI::CHAR-CNT 0)
           ELSE (DBI::SQLCOLATTRIBUTE DBI::HSTMT DBI::COLUMN
                                      DBI::ATTRIBUTE DBI::RETVAL 256
                                      DBI::CHAR-CNT 0))%
 0[2]: (DBI::SQLCOLATTRIBUTE #<DBI::ODBC-HSTMT
                               DBI::ODBC-HSTMT #x7fd4d5d1ec00 @
                               #x10011ae882>
                             2 1011
                             #<foreign object of class #:|anon-type-5|>
                             256
                             #<foreign object of class DBI::ODBC-SHORT-BOX>
                             0)
 0[2]: returned 0
<< and it returns 0
>>doing (IF* (EQL DBI::*ODBC-VERSION* 2)
           THEN (DBI::SQLCOLATTRIBUTES DBI::HSTMT DBI::COLUMN
                                       (IF*
                                        (EQL
                                         DBI::ATTRIBUTE
                                         DBI::SQL_DESC_NAME)
                                        THEN DBI::SQL_COLUMN_NAME
                                        ELSE DBI::ATTRIBUTE)
                                       DBI::RETVAL 256 DBI::CHAR-CNT 0)
           ELSE (DBI::SQLCOLATTRIBUTE DBI::HSTMT DBI::COLUMN
                                      DBI::ATTRIBUTE DBI::RETVAL 256
                                      DBI::CHAR-CNT 0))%
 0[2]: (DBI::SQLCOLATTRIBUTE #<DBI::ODBC-HSTMT
                               DBI::ODBC-HSTMT #x7fd4d5d1ec00 @
                               #x10011ae882>
                             3 1011
                             #<foreign object of class #:|anon-type-5|>
                             256
                             #<foreign object of class DBI::ODBC-SHORT-BOX>
                             0)
 0[2]: returned 0
<< and it returns 0
>>doing (IF* (EQL DBI::*ODBC-VERSION* 2)
           THEN (DBI::SQLCOLATTRIBUTES DBI::HSTMT DBI::COLUMN
                                       (IF*
                                        (EQL
                                         DBI::ATTRIBUTE
                                         DBI::SQL_DESC_NAME)
                                        THEN DBI::SQL_COLUMN_NAME
                                        ELSE DBI::ATTRIBUTE)
                                       DBI::RETVAL 256 DBI::CHAR-CNT 0)
           ELSE (DBI::SQLCOLATTRIBUTE DBI::HSTMT DBI::COLUMN
                                      DBI::ATTRIBUTE DBI::RETVAL 256
                                      DBI::CHAR-CNT 0))%
 0[2]: (DBI::SQLCOLATTRIBUTE #<DBI::ODBC-HSTMT
                               DBI::ODBC-HSTMT #x7fd4d5d1ec00 @
                               #x10011ae882>
                             4 1011
                             #<foreign object of class #:|anon-type-5|>
                             256
                             #<foreign object of class DBI::ODBC-SHORT-BOX>
                             0)
 0[2]: returned 0
<< and it returns 0
>>doing (DBI::BLOCK-CHECK #:G1415 (DBI::SQLFETCH #:G1412))%<< and it returns 0
>>doing (DBI::BLOCK-CHECK DBI::DB
                          (DBI::SQLGETDATA DBI::HSTMT DBI::INDEX
                                           DBI::TYPECODE DBI::RES
                                           DBI::WIDTH DBI::LENRES))%<< and it returns 0
>>doing (DBI::BLOCK-CHECK DBI::DB
                          (DBI::SQLGETDATA DBI::HSTMT DBI::INDEX
                                           DBI::TYPECODE DBI::RES
                                           DBI::WIDTH DBI::LENRES))%<< and it returns 0
>>doing (DBI::BLOCK-CHECK DBI::DB
                          (DBI::SQLGETDATA DBI::HSTMT DBI::INDEX
                                           DBI::TYPECODE DBI::RES
                                           DBI::WIDTH DBI::LENRES))%<< and it returns 0
>>doing (DBI::BLOCK-CHECK DBI::DB
                          (DBI::SQLGETDATA DBI::HSTMT DBI::INDEX
                                           DBI::TYPECODE DBI::RES
                                           DBI::WIDTH DBI::LENRES))%<< and it returns 0
>>doing (DBI::BLOCK-CHECK #:G1415 (DBI::SQLFETCH #:G1412))%<< and it returns 100
(("1" "PPSDB86" "2020-02-11 18:26:38 -05:00" ""))
("id" "ppsdb_version" "build_time" "comment")
CL-USER(3):




;;;;;;; run in version 1.1.1  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

CL-USER(2): (test "ppsdb_version")
>>doing (DBI::WITH-NATIVE-STRING-ODBC (DBI::SQL-STATEMENT
                                       DBI::SQL-STATEMENT
                                       DBI::DB)
          (DBI::SQLEXECDIRECT DBI::HSTMT DBI::SQL-STATEMENT
                              DBI::SQL_NTS))%<< and it returns 1
; Autoloading for FOREIGN-FUNCTIONS:CHAR*-TO-STRING:
; Fast loading from bundle code/ffcompat.fasl.
>>doing (DBI::SQLNUMRESULTCOLS DBI::HSTMT DBI::COUNT-VAR)%<< and it returns 0
>>doing (DBI::SQLMORERESULTS DBI::HSTMT)%<< and it returns 100
>>doing (DBI::WITH-NATIVE-STRING-ODBC (DBI::SQL-STATEMENT
                                       DBI::SQL-STATEMENT
                                       DBI::DB)
          (DBI::SQLEXECDIRECT DBI::HSTMT DBI::SQL-STATEMENT
                              DBI::SQL_NTS))%<< and it returns 0
>>doing (DBI::SQLNUMRESULTCOLS DBI::HSTMT DBI::COUNT-VAR)%<< and it returns 0
>>doing (IF* (EQL DBI::*ODBC-VERSION* 2)
           THEN (DBI::SQLCOLATTRIBUTES DBI::HSTMT DBI::COLUMN
                                       (IF*
                                        (EQL
                                         DBI::ATTRIBUTE
                                         DBI::SQL_DESC_NAME)
                                        THEN DBI::SQL_COLUMN_NAME
                                        ELSE DBI::ATTRIBUTE)
                                       DBI::RETVAL 256 DBI::CHAR-CNT 0)
           ELSE (DBI::SQLCOLATTRIBUTE DBI::HSTMT DBI::COLUMN
                                      DBI::ATTRIBUTE DBI::RETVAL 256
                                      DBI::CHAR-CNT 0))%
 0[2]: (DBI::SQLCOLATTRIBUTE #<DBI::ODBC-HSTMT
                               DBI::ODBC-HSTMT #x7ff01d600570 @
                               #x10011ae882>
                             1 1011
                             #<foreign object of class #:|anon-type-5|>
                             256
                             #<foreign object of class DBI::ODBC-SHORT-BOX>
                             0)
 0[2]: returned -1
<< and it returns -1
Error: While getting numeric column info, Allegro ODBC detected an
       error: error code returned
  [condition type: ODBC-ERROR]

Restart actions (select using :continue):
 0: Return to Top Level (an "abort" restart).
 1: Abort entirely from this (lisp) process.
[1] CL-USER(3):




More information about the FreeTDS mailing list