• Alvaro Herrera's avatar
    Fix libpq state machine in pipeline mode · 690339fc
    Alvaro Herrera authored
    The original coding required that PQpipelineSync had been called before
    the first call to PQgetResult, and failure to do that would result in an
    unexpected NULL result being returned.  Fix by setting the right state
    when a query is sent, rather than leaving it unchanged and having
    PQpipelineSync apply the necessary state change.
    
    A new test case to verify the behavior is added, which relies on the new
    PQsendFlushRequest() function added by commit a7192326c74d.
    
    Backpatch to 14, where pipeline mode was added.
    Reported-by: default avatarBoris Kolpackov <boris@codesynthesis.com>
    Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
    Discussion: https://postgr.es/m/boris.20210616110321@codesynthesis.com
    690339fc
fe-exec.c 105 KB