Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
cbe52f00
Commit
cbe52f00
authored
Nov 13, 2014
by
Stephen R. van den Berg
Browse files
Options
Downloads
Patches
Plain Diff
pgsql: Improve debugging output and release all locks upon error.
parent
c6e93fc1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Sql.pmod/pgsql_util.pmod
+14
-5
14 additions, 5 deletions
lib/modules/Sql.pmod/pgsql_util.pmod
with
14 additions
and
5 deletions
lib/modules/Sql.pmod/pgsql_util.pmod
+
14
−
5
View file @
cbe52f00
...
@@ -171,7 +171,7 @@ class PGassist {
...
@@ -171,7 +171,7 @@ class PGassist {
final int synctransact;
final int synctransact;
#ifdef PG_DEBUG
#ifdef PG_DEBUG
final int queueoutidx;
final int queueoutidx;
final int queueinidx;
final int queueinidx
=-1
;
#endif
#endif
private inline void queueup(pgsql_result portal) {
private inline void queueup(pgsql_result portal) {
...
@@ -407,15 +407,11 @@ class pgsql_result {
...
@@ -407,15 +407,11 @@ class pgsql_result {
switch(type) {
switch(type) {
case 'O':
case 'O':
res=sprintf("pgsql_result numrows: %d eof: %d inflight: %d\n"
res=sprintf("pgsql_result numrows: %d eof: %d inflight: %d\n"
#ifdef PG_DEBUGMORE
"query: %O\n"
"query: %O\n"
#endif
"portalname: %O datarows: %d"
"portalname: %O datarows: %d"
" laststatus: %s\n",
" laststatus: %s\n",
numrows,eoffound,_inflight,
numrows,eoffound,_inflight,
#ifdef PG_DEBUGMORE
_query,
_query,
#endif
_portalname,_datarowdesc&&sizeof(_datarowdesc),
_portalname,_datarowdesc&&sizeof(_datarowdesc),
_statuscmdcomplete||"");
_statuscmdcomplete||"");
break;
break;
...
@@ -676,6 +672,9 @@ class pgsql_result {
...
@@ -676,6 +672,9 @@ class pgsql_result {
Thread.MutexKey lock=prepbuffermux->lock();
Thread.MutexKey lock=prepbuffermux->lock();
prepbufferready->wait(lock);
prepbufferready->wait(lock);
lock=0;
lock=0;
if(_state==closed)
return;
prepbuffermux=0;
}
}
Stdio.Buffer plugbuffer=prepbuffer;
Stdio.Buffer plugbuffer=prepbuffer;
prepbuffer=0;
prepbuffer=0;
...
@@ -775,6 +774,16 @@ class pgsql_result {
...
@@ -775,6 +774,16 @@ class pgsql_result {
PGassist plugbuffer=c->start(1);
PGassist plugbuffer=c->start(1);
plugbuffer->sendcmd(_closeportal(plugbuffer));
plugbuffer->sendcmd(_closeportal(plugbuffer));
pgsqlsess=UNDEFINED;
pgsqlsess=UNDEFINED;
Thread.MutexKey lock;
if(prepbuffermux) {
Thread.MutexKey lock=prepbuffermux->lock();
prepbufferready->signal();
}
if(!_datarowdesc) {
lock=_ddescribemux->lock();
_ddescribe->broadcast();
}
lock=0;
}
}
protected void destroy() {
protected void destroy() {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment