summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTatsuo Ishii2024-11-12 09:36:08 +0000
committerTatsuo Ishii2024-11-12 09:46:14 +0000
commit2c9c23629d567c572b83cede0bc42a9877effeff (patch)
treeedcbaea0472fbabed67c6c4e381fcab8c0865be1 /src
parentab091663b09ef8c2d0a1841921597948c597444e (diff)
Test: add test for COPY FROM STDIN hang.
This is a follow up commit for commit: ab091663b09ef8c2d0a1841921597948c597444e Add test case using pgproto to existing 076.copy_hang. Backpatch-through: v4.1
Diffstat (limited to 'src')
-rw-r--r--src/test/regression/tests/076.copy_hang/pgproto.data9
-rwxr-xr-xsrc/test/regression/tests/076.copy_hang/test.sh17
2 files changed, 24 insertions, 2 deletions
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
index 000000000..ce6eeebc1
--- /dev/null
+++ b/src/test/regression/tests/076.copy_hang/pgproto.data
@@ -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'
diff --git a/src/test/regression/tests/076.copy_hang/test.sh b/src/test/regression/tests/076.copy_hang/test.sh
index 2abe488ed..9e0f4c0ce 100755
--- a/src/test/regression/tests/076.copy_hang/test.sh
+++ b/src/test/regression/tests/076.copy_hang/test.sh
@@ -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