hi,

> "YAMAMOTO Takashi" <y...@mwd.biglobe.ne.jp> writes:
>> i got the following with my application, which uses
>> PQsendPrepare+PQsendQueryPrepared for nearly everything
>> including ROLLBACK.
> 
> Can't do anything about that without a test case.
> 
>                       regards, tom lane

here's a small test case.

YAMAMOTO Takashi


#include <stdlib.h>

#include <libpq-fe.h>

int
main()
{
        PGconn *conn;
        PGresult *res;

        conn = PQconnectdb("");
        if (PQstatus(conn) != CONNECTION_OK) {
                exit(1);
        }
        res = PQprepare(conn, "r", "ROLLBACK", 0, NULL);
        if (PQresultStatus(res) != PGRES_COMMAND_OK) {
                exit(1);
        }
        PQclear(res);
        res = PQexec(conn, "BEGIN");
        if (PQresultStatus(res) != PGRES_COMMAND_OK) {
                exit(1);
        }
        PQclear(res);
        res = PQexec(conn, "hoge");
        /* a syntax error made the transaction aborted */
        PQclear(res);
        res = PQexecPrepared(conn, "r", 0, NULL, NULL, NULL, 0);
        if (PQresultStatus(res) != PGRES_COMMAND_OK) {
                exit(1);
        }
        PQclear(res);
        exit(0);
}

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to