Changeset 15135 in project for release/3


Ignore:
Timestamp:
07/02/09 14:28:10 (10 years ago)
Author:
daishi
Message:

fixing two bugs in mysql.scm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/mysql/trunk/mysql.scm

    r15015 r15135  
    11521152
    11531153(define (binary-char-pointer->string chrptr size)
    1154         (let ([blob (make-blob size)])
    1155                 (move-memory! chrptr blob size)
    1156                 (blob->string blob) ) )
     1154  (if (zero? size)
     1155      ""
     1156      (let ([blob (make-blob size)])
     1157        (move-memory! chrptr blob size)
     1158        (blob->string blob) ) ) )
    11571159
    11581160;; Returns index for field identifier
     
    15681570;; Returns #f when no result set.
    15691571
    1570 (define (mysql-fetch-lengths resptr cnt)
     1572(define (mysql-fetch-lengths-internal resptr cnt)
    15711573        (and-let* ([ulptr (foreign-mysql-fetch-lengths resptr)])
    15721574                (unsigned-long-array->u32vector ulptr cnt) ) )
     
    15771579(define (mysql-fetch-lengths conn)
    15781580        (and-let* ([resptr (mysql-connection-result conn)])
    1579                 (mysql-fetch-lengths resptr (foreign-mysql-num-fields resptr)) ) )
     1581                (mysql-fetch-lengths-internal resptr (foreign-mysql-num-fields resptr)) ) )
    15801582
    15811583;; After a mysql-query that has results, use mysql-fetch-row to retrieve
     
    15991601                                                                (or fldlens
    16001602                                                                                (begin
    1601                                                                                         (set! fldlens (mysql-fetch-lengths resptr fldcnt))
     1603                                                                                        (set! fldlens (mysql-fetch-lengths-internal resptr fldcnt))
    16021604                                                                                        fldlens ) )
    16031605                                                                fldidx))
Note: See TracChangeset for help on using the changeset viewer.