Changeset 15520 in project


Ignore:
Timestamp:
08/19/09 21:40:48 (10 years ago)
Author:
sjamaan
Message:

Add additional test for error cases

File:
1 edited

Legend:

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

    r15517 r15520  
    428428    (query conn "TRUNCATE foo")
    429429
     430    ;; Test that errors do not kill the transaction.  Apparently
     431    ;; aborting transactions on errors is a psql(1) "feature", not a
     432    ;; libpq one.
     433    (test "Unsuccessful subtransaction with bad query"
     434          '(1 2)
     435          (and
     436           (with-transaction
     437            conn (lambda ()
     438                   (query conn "INSERT INTO foo (bar) VALUES (1)")
     439                   (handle-exceptions exn
     440                     #t
     441                     (with-transaction
     442                      conn (lambda ()
     443                             (query conn "INVALID QUERY"))))
     444                   (query conn "INSERT INTO foo (bar) VALUES (2)")))
     445           (column-values (query conn "SELECT * FROM foo"))))
     446
     447    (query conn "TRUNCATE foo")
     448
    430449    (test "Multiple subtransactions"
    431450          '(1 3)
Note: See TracChangeset for help on using the changeset viewer.