Commit 847da1a1 authored by Tom Lane's avatar Tom Lane

Remove Perl module's unnecessary dependence on libpq-int.h.

parent 34ecb9d8
/*------------------------------------------------------- /*-------------------------------------------------------
* *
* $Id: Pg.xs,v 1.10 1998/12/13 02:50:20 momjian Exp $ * $Id: Pg.xs,v 1.11 1999/02/11 23:25:16 tgl Exp $
* *
* Copyright (c) 1997, 1998 Edmund Mergl * Copyright (c) 1997, 1998 Edmund Mergl
* *
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <fcntl.h> #include <fcntl.h>
#include "libpq-fe.h" #include "libpq-fe.h"
#include "libpq-int.h" /* need this for sizeof(PGresult) */
typedef struct pg_conn *PG_conn; typedef struct pg_conn *PG_conn;
typedef struct pg_result *PG_result; typedef struct pg_result *PG_result;
...@@ -352,7 +351,7 @@ PQexec(conn, query) ...@@ -352,7 +351,7 @@ PQexec(conn, query)
CODE: CODE:
RETVAL = PQexec(conn, query); RETVAL = PQexec(conn, query);
if (! RETVAL) { if (! RETVAL) {
RETVAL = (PGresult *)calloc(1, sizeof(PGresult)); RETVAL = PQmakeEmptyPGresult(conn, PGRES_FATAL_ERROR);
} }
OUTPUT: OUTPUT:
RETVAL RETVAL
...@@ -384,7 +383,7 @@ PQgetResult(conn) ...@@ -384,7 +383,7 @@ PQgetResult(conn)
CODE: CODE:
RETVAL = PQgetResult(conn); RETVAL = PQgetResult(conn);
if (! RETVAL) { if (! RETVAL) {
RETVAL = (PGresult *)calloc(1, sizeof(PGresult)); RETVAL = PQmakeEmptyPGresult(conn, PGRES_FATAL_ERROR);
} }
OUTPUT: OUTPUT:
RETVAL RETVAL
...@@ -893,7 +892,7 @@ PQexec(conn, query) ...@@ -893,7 +892,7 @@ PQexec(conn, query)
if (RETVAL) { if (RETVAL) {
RETVAL->result = PQexec((PGconn *)conn, query); RETVAL->result = PQexec((PGconn *)conn, query);
if (!RETVAL->result) { if (!RETVAL->result) {
RETVAL->result = (PG_result)calloc(1, sizeof(PGresult)); RETVAL->result = PQmakeEmptyPGresult((PGconn *)conn, PGRES_FATAL_ERROR);
} }
} }
OUTPUT: OUTPUT:
...@@ -928,7 +927,7 @@ PQgetResult(conn) ...@@ -928,7 +927,7 @@ PQgetResult(conn)
if (RETVAL) { if (RETVAL) {
RETVAL->result = PQgetResult((PGconn *)conn); RETVAL->result = PQgetResult((PGconn *)conn);
if (!RETVAL->result) { if (!RETVAL->result) {
RETVAL->result = (PG_result)calloc(1, sizeof(PGresult)); RETVAL->result = PQmakeEmptyPGresult((PGconn *)conn, PGRES_FATAL_ERROR);
} }
} }
OUTPUT: OUTPUT:
...@@ -994,9 +993,6 @@ PQmakeEmptyPGresult(conn, status) ...@@ -994,9 +993,6 @@ PQmakeEmptyPGresult(conn, status)
RETVAL = (PG_results)calloc(1, sizeof(PGresults)); RETVAL = (PG_results)calloc(1, sizeof(PGresults));
if (RETVAL) { if (RETVAL) {
RETVAL->result = PQmakeEmptyPGresult((PGconn *)conn, status); RETVAL->result = PQmakeEmptyPGresult((PGconn *)conn, status);
if (!RETVAL->result) {
RETVAL->result = (PG_result)calloc(1, sizeof(PGresult));
}
} }
OUTPUT: OUTPUT:
RETVAL RETVAL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment