New ecgp code problem. - Mailing list pgsql-hackers

From Keith Parks
Subject New ecgp code problem.
Date
Msg-id 199802172208.WAA06148@mtcc.demon.co.uk
Whole thread Raw
Responses Re: New ecgp code problem.  (Michael Meskes <meskes@topsystem.de>)
List 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;




pgsql-hackers by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Snapshot downloaded 17Feb does not compile
Next
From: Gerhard Reithofer
Date:
Subject: Crash and troubles with acl's