DECLARE doesn't set/reset sqlca after DECLARE cursor

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Michael Meskes <michael(at)fam-meskes(dot)de>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>, Hans-Juergen Schoenig <hs(at)cybertec(dot)at>
Subject: DECLARE doesn't set/reset sqlca after DECLARE cursor
Date: 2009-08-12 17:13:44
Message-ID: 4A82F848.3010901@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

a customer of us complained a behavioural difference
between ESQL/C and ECPG. They check sqlca.sqlcode
almost everywhere in their application currently under
porting to PostgreSQL. Somewhere in their code
however there was a place where a statement error
was ignored and the error was reported when the code
reached the next DECLARE statement.

It seems that this pseudo-statement is the only one that
doesn't set/reset sqlca, I was thinking about adding that
in a way that a call to ecpg_init() gets emitted.

The attached patch implements this. The only downside
is that now DECLARE CURSOR cannot appear outside
of a function, a change in test/preproc/variable.pgc reflects
this fact. The largest part of the patch is the change in the
expected C source outcome of the regression tests. The only
test where the ecpg_log output has changed is variable.pgc.

Best regards,
Zoltán Böszörményi

--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/

Attachment Content-Type Size
pg85-declare-reset-sqlca-1-ctxdiff.patch text/x-patch 51.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2009-08-12 17:24:24 Re: BUG #4961: pg_standby.exe crashes with no args
Previous Message Fujii Masao 2009-08-12 17:08:32 Re: BUG #4961: pg_standby.exe crashes with no args