pike.git/
lib/
modules/
Sql.pmod/
pgsql_util.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2020-06-10
2020-06-10 21:07:47 by Stephen R. van den Berg <srb@cuci.nl>
d88b50e0dc691962ce10b7a3c4b89bc6b9aa9d44 (
31
lines) (+
23
/-
8
)
[
Show
|
Annotate
]
Branch:
master
pgsql: Release portals that had background-exceptions during bind.
2152:
procmessage(); }
+
private void stasherror(int|object portal, mixed err) {
+
if (stringp(err)) {
+
if (!objectp(portal))
+
portal = this;
+
if (!portal->delayederror)
+
portal->delayederror = err;
+
}
+
if (objectp(portal) && c)
+
portal->_purgeportal();
+
}
+
+
private void tryprepbind(Result portal, array dtoid) {
+
mixed err = catch(portal->_preparebind(dtoid));
+
if (err) {
+
stasherror(portal, err);
+
if (!stringp(err))
+
throw(err);
+
}
+
}
+
private void procmessage() { mixed err; int terminating = 0;
2481:
#endif if (portal._tprepared) portal._tprepared.datatypeoid = a;
-
Thread.Thread(portal
->_preparebind
, a);
+
Thread.Thread(
tryprepbind,
portal, a);
break; } case 'T': {
2811:
terminating = 1; err = 0; } else if (stringp(err)) {
-
Result or;
-
if (!objectp(or = portal))
-
or = this;
-
if (!or.delayederror)
-
or.delayederror = err;
+
#ifdef PG_DEBUGMORE showportalstack("THROWN"); #endif
-
if
(
objectp(
portal
))
-
portal->_releasesession("ERROR"
);
+
stasherror
(portal
,
err
);
portal = 0; if (!waitforauthready) continue; // Only continue if authentication did not fail