Test: add test for COPY FROM STDIN hang.
authorTatsuo Ishii <[email protected]>
Tue, 12 Nov 2024 09:36:08 +0000 (18:36 +0900)
committerTatsuo Ishii <[email protected]>
Tue, 12 Nov 2024 09:46:14 +0000 (18:46 +0900)
This is a follow up commit for commit:
ab091663b09ef8c2d0a1841921597948c597444e

Add test case using pgproto to existing 076.copy_hang.
Back-through: v4.1

src/test/regression/tests/076.copy_hang/pgproto.data[new file with mode: 0644]
src/test/regression/tests/076.copy_hang/test.sh

diff --git a/src/test/regression/tests/076.copy_hang/pgproto.data b/src/test/regression/tests/076.copy_hang/pgproto.data
new file mode 100644 (file)
index 0000000..ce6eeeb
--- /dev/null
@@ -0,0 +1,9 @@
+'Q'    "CREATE TEMP TABLE t1(i INT)"
+'Y'
+'Q'    "COPY t1 FROM STDIN"    0
+'d'    "1"
+'H'
+'c'
+'S'
+'Y'
+'X'
index 2abe488ed1653e3b220c7d1bdef6d0e54cc11891..9e0f4c0ce36ce719531bdf0e7cfba9819a3eb2b3 100755 (executable)
@@ -17,6 +17,7 @@
 source $TESTLIBS
 TESTDIR=testdir
 PSQL=$PGBIN/psql
+PGPROTO=$PGPOOL_INSTALL_DIR/bin/pgproto
 
 rm -fr $TESTDIR
 mkdir $TESTDIR
@@ -46,9 +47,21 @@ g
 EOF
 
 if [ ! $? -eq 0 ];then
-    echo ...timed out.
     ./shutdownall
     exit 1
 fi
-echo ...ok.
+
+#
+# Another COPY FROM STDIN hang case.
+# commit ab091663b09ef8c2d0a1841921597948c597444e
+# If Flush or Sync message is sent from frontend during COPY IN mode,
+# pgpool hangs.
+# In order to reproduce the problem, we use pgproto because psql
+# cannot send Flush or Sync during COPY FROM STDIN
+
+timeout 10 $PGPROTO -d test -f ../pgproto.data
+if [ ! $? -eq 0 ];then
+    ./shutdownall
+    exit 1
+fi
 ./shutdownall