[plt-scheme] a bug of mysql.plt

From: Jon Zeppieri (zeppieri at gmail.com)
Date: Fri Jul 10 10:13:53 EDT 2009

On Fri, Jul 10, 2009 at 5:06 AM, Changying Li <lchangying at gmail.com> wrote:

> I'm a newbie of plt scheme. If I report a non-exist bug, please forgive
> me.
>
> plt scheme version:
> [chylli at arch scmtipcode] mzscheme -v
> Welcome to MzScheme v4.2 [3m], Copyright (c) 2004-2009 PLT Scheme Inc.
>
> mysql.plt version:
>  mysql.plt      (1 2)   0.5a    jaz
>
>
> example code:
>
> #lang scheme
> (current-print void)
> (require (planet jaz/mysql:1))
>
> (connect "localhost" 3306 "chylli" "3843054" #:schema "test" #:set-current?
> #t)
> (define rs (query "select * from user_stat"))
> (printf "~a\n" (result-set-field-names rs ))
> (close-connection! (current-connection))
>
>
> expect:
> [chylli at arch /tmp] mzscheme test.ss
> #(stat_id user_id column_name column_value time)
>
> bad result:
>
> (file
> "/home/chylli/.plt-scheme/planet/300/4.2/cache/jaz/mysql.plt/1/2/private/structs.ss")
> broke the contract
>  (->r ((f ...) (vec1 ...)) vec ... ...)
>  on vector-map; expected <...43/vector-lib.ss:275:13>, given:
> #<procedure:field-name>
>
>  === context ===
> /usr/lib/plt/collects/scheme/private/contract-guts.ss:220:0:
> raise-contract-error
> /usr/lib/plt/collects/srfi/43/vector-lib.ss:275:4:
> ...rfi/43/vector-lib.ss:275:4
>
>
>
> advice:
> 74th line of structs.ss should be:
>  (vector-map (lambda (i f) (field-name f)) (result-set-fields rs)))
>


Thanks for the bug report.  I fixed this issue and uploaded version 1.3 to
planet:
http://planet.plt-scheme.org/display.ss?package=mysql.plt&owner=jaz

-Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090710/7e2caa1b/attachment.html>

Posted on the users mailing list.