You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Re-simplify management of inStart in pqParseInput3's subroutines.
Commit92785da copied some logic related to advancement of inStartfrom pqParseInput3 into getRowDescriptions and getAnotherTuple,because it wanted to allow user-defined row processor callbacks topotentially longjmp out of the library, and inStart would have to beupdated before that happened to avoid an infinite loop. We laterdecided that that API was impossibly fragile and reverted it, butwe didn't undo all of the related code changes, and this bit ofmessiness survived. Undo it now so that there's just one place inpqParseInput3's processing where inStart is advanced; this willsimplify addition of better tracing support.getParamDescriptions had grown similar processing somewhere alongthe way (not in92785da; I didn't track down just when), but it'sactually buggy because its handling of corrupt-message cases seems tohave been copied from the v2 logic where we lacked a known messagelength. The cases where we "goto not_enough_data" should not simplyreturn EOF, because then we won't consume the message, potentiallycreating an infinite loop. That situation now represents adefinitively corrupt message, and we should report it as such.Although no field reports of getParamDescriptions getting stuck ina loop have been seen, it seems appropriate to back-patch that fix.I chose to back-patch all of this to keep the logic looking more alikein supported branches.Discussion:https://postgr.es/m/2217283.1615411989@sss.pgh.pa.us