Bug #505: egpg crashes when using indicator array variables

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #505: egpg crashes when using indicator array variables
Date: 2001-10-30 20:00:21
Message-ID: 200110302000.f9UK0L927050@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tony Griffiths (griffitt(at)cs(dot)man(dot)ac(dot)uk) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
egpg crashes when using indicator array variables

Long Description
I'm using postgreSQL version 7.1.3 built from source using gcc3.0. When I try to create a structure in the sql declare section with an associated indicator array ecpg crashes at the point where a cursor fetch into the struct and indicator occurs - the sql is embedded in c++.

Sample Code
void d_Module::load() {

exec sql type class_struct is struct
{
char objectIdentifier[17];
char owningObject[17];
bool isowned;
bool ispersisted;
bool persistence_capable;
bool has_extent;
char extent_name[33];
char name[33];
char comment[257];
char defined_in[17];
};

exec sql type struct_struct is struct
{
char objectIdentifier[17];
char owningObject[17];
bool isowned;
bool ispersisted;
char name[33];
char comment[257];
char defined_in[17];
};

typedef struct {
char objectIdentifier[17];
char owningObject[17];
bool isowned;
bool ispersisted;
bool persistence_capable;
bool has_extent;
char extent_name[33];
char name[33];
char comment[257];
char defined_in[17];
} class_struct;

typedef struct {
char objectIdentifier[17];
char owningObject[17];
bool isowned;
bool ispersisted;
char name[33];
char comment[257];
char defined_in[17];
} struct_struct;

EXEC SQL BEGIN DECLARE SECTION;

class_struct a_class_struct;
short a_class_struct_ind[10];

struct_struct a_struct_struct;
short a_struct_struct_ind[7];
EXEC SQL END DECLARE SECTION;

// .....

EXEC SQL DECLARE class_curs CURSOR FOR SELECT objectIdentifier, owningObject, isowned, ispersisted, persistence_capable, has_extent, extent_name, name, comment, defined_in FROM d_Class WHERE defined_in = :my_defined_in;
EXEC SQL OPEN class_curs;
for(;;) {
EXEC SQL FETCH class_curs into :a_class_struct :a_class_struct_ind;

if(sqlca.sqlcode == ECPG_NOT_FOUND) {
cerr << sqlca.sqlcode << ": " << sqlca.sqlerrm.sqlerrmc << endl;
EXEC SQL CLOSE class_curs;
break;
}
// process information
}

}

No file was uploaded with this report

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2001-10-30 20:14:44 Re: Bug #503: case and LIMIT not working together
Previous Message pgsql-bugs 2001-10-30 19:53:21 Bug #504: multiple cursors cause transaction problems