@@ -352,20 +352,20 @@ (define-inline (db:test-set-testname! vec val)(vector-set! vec 2 val)) (define-inline (db:test-set-state! vec val)(vector-set! vec 3 val)) (define-inline (db:test-set-status! vec val)(vector-set! vec 4 val)) -(define (db-get-tests-for-run db run-id . params) - (let ((res '()) - (testpatt (if (or (null? params)(not (car params))) "%" (car params))) - (itempatt (if (> (length params) 1)(cadr params) "%"))) +(define (db-get-tests-for-run db run-id testpatt itempatt) + (let ((res '())) (sqlite3:for-each-row (lambda (id run-id testname state status event-time host cpuload diskfree uname rundir item-path run-duration final-logf comment first-err first-warn) (set! res (cons (vector id run-id testname state status event-time host cpuload diskfree uname rundir item-path run-duration final-logf comment first-err first-warn) res))) db "SELECT id,run_id,testname,state,status,event_time,host,cpuload,diskfree,uname,rundir,item_path,run_duration,final_logf,comment,first_err,first_warn FROM tests WHERE run_id=? AND testname like ? AND item_path LIKE ? ORDER BY id DESC;" - run-id testpatt (if itempatt itempatt "%")) + run-id + (if testpatt testpatt "%") + (if itempatt itempatt "%")) res)) ;; this one is a bit broken BUG FIXME (define (db:delete-test-step-records db run-id test-name itemdat) (sqlite3:execute db "DELETE FROM test_steps WHERE test_id in (SELECT id FROM tests WHERE run_id=? AND testname=? AND item_path=?);" @@ -726,11 +726,11 @@ ;; Tests (and all items) in waiton list must be "COMPLETED" and "PASS" (define (db-get-prereqs-not-met db run-id waiton) (if (null? waiton) '() (let* ((unmet-pre-reqs '()) - (tests (db-get-tests-for-run db run-id)) + (tests (db-get-tests-for-run db run-id #f #f)) (result '())) (for-each (lambda (waitontest-name) (let ((ever-seen #f)) (for-each (lambda (test) (if (equal? waitontest-name (db:test-get-testname test))