Branch: Tag:

2020-05-13

2020-05-13 19:04:42 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Synchronous resync() and fix portalstack for text-multiqueries.

430:    final MUTEX nostash;    final Thread.MutexKey started;    final Thread.Queue stashqueue; -  final Thread.Condition stashavail; +     final Stdio.Buffer stash;    //! @ignore    final int(KEEP..SYNCSEND) stashflushmode;
724:    shortmux = MUTEX();    nostash = MUTEX();    closenext = 0; -  stashavail = Thread.Condition(); +     stashqueue = Thread.Queue();    stash = Stdio.Buffer();    stashcount = Thread.ResourceCount();
2232:    showportalstack("AFTER READYFORQUERY");   #endif    readyforquerycount--; -  if (readyforquery_cb) -  readyforquery_cb(), readyforquery_cb = 0; +  function (:void) cb; +  if (cb = readyforquery_cb) +  readyforquery_cb = 0, cb();    destruct(waitforauthready);    break;    }
2313: Inside #if defined(PG_DEBUG)
   msglen -= 4;    PD("NoData %O\n", portal._query);   #endif +  if (!portal._forcetext) {    portal._fetchlimit = 0; // disables subsequent Executes    portal->_processrowdesc(({}), ({}));    portal = 0; -  +  }    break;    }    case 'H':
2381:    errtype = PROTOCOLERROR;   #endif    string s = cr->read(msglen - 1); -  portal->_storetiming(); -  PD("%O CommandComplete %O\n", portal._portalname, s); +  PD("%O CommandComplete %O\n", +  objectp(portal) && portal._portalname, s);   #ifdef PG_DEBUG    if (cr->read_int8())    errtype = PROTOCOLERROR;
2393: Inside #if defined(PG_DEBUGMORE)
  #ifdef PG_DEBUGMORE    showportalstack("COMMANDCOMPLETE");   #endif +  if (!portal._forcetext) { +  portal->_storetiming();    portal->_releasesession(s);    portal = 0; -  +  }    break;    }    case 'I':
2405: Inside #if defined(PG_DEBUGMORE)
  #ifdef PG_DEBUGMORE    showportalstack("EMPTYQUERYRESPONSE");   #endif +  if (!portal._forcetext) {    portal->_releasesession();    portal = 0; -  +  }    break;    case 'd':    PD("%O CopyData\n", portal._portalname);
2432: Inside #if defined(PG_DEBUG)
   PD("%O CopyDone\n", portal._portalname);    msglen -= 4;   #endif +  if (!portal._forcetext)    portal = 0;    break;    case 'E': {