Changeset 14762 in project


Ignore:
Timestamp:
05/24/09 15:10:01 (10 years ago)
Author:
sjamaan
Message:

Fix off-by-one error in result-row-alist

Location:
release/4/postgresql/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/postgresql/trunk/postgresql.scm

    r14761 r14762  
    498498    (if (= column 0)
    499499        alist
    500         (loop (cons (cons (PQfname (pg-result-ptr result) column)
     500        (loop (cons (cons (string->symbol
     501                           (PQfname (pg-result-ptr result) (sub1 column)))
    501502                          (result-value* result row (sub1 column))) alist)
    502503              (sub1 column)))))
  • release/4/postgresql/trunk/tests/run.scm

    r14760 r14762  
    114114        (result-row
    115115         (exec-query conn "SELECT 'one', 'two' UNION SELECT 'three', 'four'") 0))
     116  (test "Result row alist"
     117        '((a . "one") (b . "two"))
     118        (result-row-alist
     119         (exec-query conn "SELECT 'one' AS a, 'two' AS b UNION SELECT 'three', 'four'") 0))
    116120  (test "Result column values"
    117121        '("one" "three")
Note: See TracChangeset for help on using the changeset viewer.