New ecgp code problem.

From: Keith Parks <emkxp01(at)mtcc(dot)demon(dot)co(dot)uk>
To: hackers(at)postgresql(dot)org
Cc: meskes(at)topsystem(dot)de
Subject: New ecgp code problem.
Date: 1998-02-17 22:08:28
Message-ID: 199802172208.WAA06148@mtcc.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi All,

I'm getting a SEGV error when testing ecpg using the perftest,or
any other, example program.

I have tracked this down to a call to PQfinish() in ECPGfinish()
that occurs before any connection is established.

bool
ECPGfinish()
{
if (simple_connection != NULL)
{
ECPGlog("ECPGfinish: finishing.\n");
PQfinish(simple_connection);
}
else
ECPGlog("ECPGfinish: called an extra time.\n");
return true;
}

A test is made here for simple_connection != NULL.

If I apply the following patch all is OK.

Keith.

*** src/interfaces/ecpg/lib/ecpglib.c.orig Tue Feb 17 22:01:00 1998
--- src/interfaces/ecpg/lib/ecpglib.c Tue Feb 17 22:01:30 1998
***************
*** 24,30 ****
#include <libpq-fe.h>
#include <libpq/pqcomm.h>

! static PGconn *simple_connection;
static int simple_debug = 0;
static FILE *debugstream = NULL;
static int committed = true;
--- 24,30 ----
#include <libpq-fe.h>
#include <libpq/pqcomm.h>

! static PGconn *simple_connection = NULL;
static int simple_debug = 0;
static FILE *debugstream = NULL;
static int committed = true;

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gerhard Reithofer 1998-02-17 23:31:31 Crash and troubles with acl's
Previous Message Oliver Elphick 1998-02-17 22:05:38 Snapshot downloaded 17Feb does not compile