Обсуждение: Bug #505: egpg crashes when using indicator array variables

Поиск
Список
Период
Сортировка

Bug #505: egpg crashes when using indicator array variables

От
pgsql-bugs@postgresql.org
Дата:
Tony Griffiths (griffitt@cs.man.ac.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
sectionwith 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