Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -2472,10 +2472,12 @@ (define db:test-record-fields '("id" "run_id" "testname" "state" "status" "event_time" "host" "cpuload" "diskfree" "uname" "rundir" "item_path" "run_duration" "final_logf" "comment" "shortdir" "attemptnum" "archived")) +(define db:test-record-fields-symbols (map string->symbol db:test-record-fields)) + ;; fields *must* be a non-empty list ;; (define (db:field->number fieldname fields) (if (null? fields) #f @@ -2582,11 +2584,11 @@ ;; (lambda (id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run_duration final-logf-id comment short-dir-id attemptnum archived) ;; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ;; (set! res (vector id run-id testname state status event-time host cpuload diskfree uname rundir-id item-path run_duration final-logf-id comment short-dir-id attemptnum archived))) (lambda (a . b) - (set! res (alist->db:test (map cons db:test-record-fields (cons a b))))) + (set! res (alist->db:test (map cons db:test-record-fields-symbols (cons a b))))) db (conc "SELECT " db:test-record-qry-selector " FROM tests WHERE id=?;") test-id) res)))) @@ -2601,11 +2603,11 @@ (lambda (db) (let ((res '())) (sqlite3:for-each-row (lambda (a . b) ;; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 - (set! res (cons (alist->db:test (map cons db:test-record-fields (cons a b))) res ))) + (set! res (cons (alist->db:test (map cons db:test-record-fields-symbols (cons a b))) res ))) ;;BB: replaced vec with defstruct above -- (set! res (cons (apply vector a b) res))) db (conc "SELECT " db:test-record-qry-selector " FROM tests WHERE id in (" (string-intersperse (map conc test-ids) ",") ");")) res)))) @@ -2617,11 +2619,11 @@ #f (lambda (db) (let ((res #f)) (sqlite3:for-each-row (lambda (a . b) - (set! res (alist->db:test (map cons db:test-record-fields (cons a b))))) + (set! res (alist->db:test (map cons db:test-record-fields-symbols (cons a b))))) ;; BB: replaced following vec construction with db:test defstruct ;;(set! res (apply vector a b))) db (conc "SELECT " db:test-record-qry-selector " FROM tests WHERE testname=? AND item_path=?;") test-name item-path)