View Issue Details

IDProjectCategoryView StatusLast Update
0000328Pgpool-IIBugpublic2017-08-14 13:39
Reportera.dushechkin Assigned Tot-ishii  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionreopened 
PlatformLinuxOSUbuntuOS Version14.04
Product Version3.6.5 
Target Version3.6.6 
Summary0000328: Malformed packet in response to simple query containing only '-- comment'
DescriptionPostgreSQL 9.6.3, pg_dump/pg_restore 9.6.3, 9.6.4.

If one takes DB backup with command:

  pg_dump -h $dbHost -p $dbPort -U $dbUser -d $dbName -F c -b -f $destination/$dumpname

and then restores it via pgpool with command:

  pg_restore -n public -x -U $dbUser -p $dbPort -h $dbHost --no-owner --role=$dbUser -d $dbName $destination/$dumpname

restore process outputs multiple warnings and overall return code 1, which breaks automated processes. Warnings are like:

  pg_restore: [archiver (db)] could not execute query: message contents do not agree with length in message type "C"
      Command was: -- Dumped by pg_dump version 9.6.3

There is no such issue when restoring dump directly to PostgreSQL.

On the wire if connected to PostgreSQL directly:
--> Simple query (0x51)
<-- Empty query (0x49) length 4
<-- Ready for query (0x5a), length 5, status Idle (0x49)

if connected via pgpool2:
--> Simple query (0x51)
<-- Command completion (0x43) length 4
<-- Ready for query (0x5a) of length 5, status Idle (0x49)

Also reproduced on 3.6.4, not reproduced with extended query mode (JDBC) or with psql (I believe psql just ignores comments).
Steps To ReproduceSend simple query containing only comment, like "-- comment".
TagsNo tags attached.

Activities

t-ishii

2017-08-11 19:40

developer   ~0001641

Good catch. Since psql ignores a comment only query, I did not notice it. Can you please try attached patch?
empty-query.diff (2,048 bytes)   
empty-query.diff (2,048 bytes)   

a.dushechkin

2017-08-14 13:23

reporter   ~0001648

Yes, the attached patch fixes the issue for me. Thank you.

t-ishii

2017-08-14 13:38

developer   ~0001649

Thank you for testing. The patch has been committed/pushed to 3.6 and 3.5 stable trees (only those versions are affected by the bug).
The issue resolved now.

Issue History

Date Modified Username Field Change
2017-08-11 15:30 a.dushechkin New Issue
2017-08-11 19:37 t-ishii Assigned To => t-ishii
2017-08-11 19:37 t-ishii Status new => assigned
2017-08-11 19:40 t-ishii File Added: empty-query.diff
2017-08-11 19:40 t-ishii Note Added: 0001641
2017-08-11 19:41 t-ishii Status assigned => resolved
2017-08-11 19:41 t-ishii Target Version => 3.6.6
2017-08-11 19:43 administrator Status resolved => feedback
2017-08-11 19:43 administrator Resolution open => reopened
2017-08-14 13:23 a.dushechkin Note Added: 0001648
2017-08-14 13:23 a.dushechkin Status feedback => assigned
2017-08-14 13:38 t-ishii Note Added: 0001649
2017-08-14 13:39 t-ishii Status assigned => resolved