Skip to content
Snippets Groups Projects
Commit 72b75a21 authored by Stephen R. van den Berg's avatar Stephen R. van den Berg
Browse files

pgsql: Extra diagnostics and release all locks upon async query termination.

parent 5f45f6d4
No related branches found
No related tags found
No related merge requests found
...@@ -469,11 +469,7 @@ class conxion { ...@@ -469,11 +469,7 @@ class conxion {
#endif #endif
while (lock = (waitforreal ? nostash->lock : nostash->trylock)(1)) { while (lock = (waitforreal ? nostash->lock : nostash->trylock)(1)) {
int mode; int mode;
if (!stashcount->drained()) {
lock = 0; // Force release before acquiring next
stashcount->wait_till_drained(); stashcount->wait_till_drained();
continue;
}
#ifdef PG_DEBUGRACE #ifdef PG_DEBUGRACE
conxsess sess = conxsess(this); conxsess sess = conxsess(this);
#endif #endif
...@@ -799,6 +795,7 @@ class sql_result { ...@@ -799,6 +795,7 @@ class sql_result {
"query: %O\n" "query: %O\n"
#if PG_DEBUGHISTORY > 0 #if PG_DEBUGHISTORY > 0
"history: %O\n" "history: %O\n"
"stash: %O\n"
#endif #endif
"fd: %O portalname: %O datarows: %d" "fd: %O portalname: %O datarows: %d"
" synctransact: %d laststatus: %s\n", " synctransact: %d laststatus: %s\n",
...@@ -806,6 +803,8 @@ class sql_result { ...@@ -806,6 +803,8 @@ class sql_result {
qalreadyprinted == this ? "..." : _query, qalreadyprinted == this ? "..." : _query,
#if PG_DEBUGHISTORY > 0 #if PG_DEBUGHISTORY > 0
qalreadyprinted == this ? 0 : c && c->i->history, qalreadyprinted == this ? 0 : c && c->i->history,
qalreadyprinted == this ? 0
: c && (string)c->stash,
#endif #endif
fd, _portalname, fd, _portalname,
datarowtypes && sizeof(datarowtypes), _synctransact, datarowtypes && sizeof(datarowtypes), _synctransact,
...@@ -1499,8 +1498,10 @@ class sql_result { ...@@ -1499,8 +1498,10 @@ class sql_result {
if (!catch(plugbuffer = c->start())) if (!catch(plugbuffer = c->start()))
plugbuffer->sendcmd(_closeportal(plugbuffer, reflock)); plugbuffer->sendcmd(_closeportal(plugbuffer, reflock));
reflock = 0; reflock = 0;
if (_state < CLOSED) if (_state < CLOSED) {
_state = CLOSED; _state = CLOSED;
stmtifkey = 0;
}
datarows->write(1); // Signal EOF datarows->write(1); // Signal EOF
releaseconditions(); releaseconditions();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment