ecpg 2.8.0: at problem - Mailing list pgsql-bugs

From Win Bausch
Subject ecpg 2.8.0: at problem
Date
Msg-id 3B6FB93A.45CF99BB@inf.ethz.ch
Whole thread Raw
List pgsql-bugs
Dear Sirs,

ecpg 2.8.0   seems to wrongly translate the "at <connection name>"
clause.

System: SUN sparc  ultra 5
SELECT version() says:
PostgreSQL 7.1.2 on sparc-sun-solaris2.6, compiled by GCC 2.95.2

The following statement works fine with ecpg version 2.7.1 (using
postgresql v7.1.2 libecpg , libpq libraries and  v7.1.2  backend). When
using version 2.8.0 the error message produced at runtime at the server
is "COMMIT: no transaction in progress". As far as i can see, no queries
are issued to the backend. I noticed a small difference in the C code
both versions of ecpg generate (psConnectName appears tiwce in the code
generated by ecpg 2.8.0)

exec sql at :psConnectName declare fwdDep_c cursor for SELECT
templateId, depTemplateId FROM is_dependencies WHERE serverId =
:iServerId AND parentId = :iParentId AND instanceId = :iInstanceId AND
(depType = :iTypeIsCF OR depType = :iTypeIsCF_AND_DF) ORDER BY
depTemplateId ASC;

Here's the output produced by ecpg 2.7.1 for the example query :

ECPGdo(__LINE__, psConnectName, "declare fwdDep_c  cursor for select
templateId  , depTemplateId   from is_dependencies  where serverId  = ?
and parentId  = ? and instanceId  = ? and ( depType  = ? or depType  = ?
)   order by depTemplateId  asc  ",
 ECPGt_int,&(iServerId),1L,1L,sizeof(int),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
 ECPGt_int,&(iParentId),1L,1L,sizeof(int),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
 ECPGt_int,&(iInstanceId),1L,1L,sizeof(int),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
 ECPGt_int,&(iTypeIsCF),1L,1L,sizeof(int),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
 ECPGt_int,&(iTypeIsCF_AND_DF),1L,1L,sizeof(int),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}

Here's the one from ecpg 2.8.0:

 { ECPGdo(__LINE__, psConnectName, "declare fwdDep_c  cursor for select
templateId  , depTemplateId   from is_dependencies where serverId  = ?
and parentId  = ? and instanceId  = ? and ( depType  = ? or depType  = ?
)   order by depTemplateId  asc  ",
 ECPGt_char,&(psConnectName),0L,1L,1*sizeof(char),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
 ECPGt_int,&(iServerId),1L,1L,sizeof(int),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
 ECPGt_int,&(iParentId),1L,1L,sizeof(int),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
 ECPGt_int,&(iInstanceId),1L,1L,sizeof(int),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
 ECPGt_int,&(iTypeIsCF),1L,1L,sizeof(int),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
 ECPGt_int,&(iTypeIsCF_AND_DF),1L,1L,sizeof(int),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
 ECPGt_char,&(psConnectName),0L,1L,1*sizeof(char),
 ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}


Regards,

    Win Bausch

--
Win Bausch
Insitut fuer Informationssysteme
ETH Zentrum (CLU)
CH-8092 Zurich
Switzerland

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: ecpg: unstable INSERT operation
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: reserved words on table