[plt-scheme] a bug of mysql.plt

From: Changying Li (lchangying at gmail.com)
Date: Fri Jul 10 05:06:26 EDT 2009

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 & Regards

Changying Li



Posted on the users mailing list.