summaryrefslogtreecommitdiff
path: root/src/test/regression
diff options
context:
space:
mode:
authorTatsuo Ishii2024-03-20 22:31:29 +0000
committerTatsuo Ishii2024-03-21 00:32:20 +0000
commit82e962215d229cfbb1abf6013a52bb476255ef6c (patch)
tree76fcd6ce590943ae351990e3be35781e6d8c9e17 /src/test/regression
parentcb39accc969617837c0eb61b60335971c6d1994f (diff)
Allow reset queries to run even if extended queries do not end.
Commit 240c668d "Guard against inappropriate protocol data." caused reset queries fail if extended query messages do not end. This commit fix that by checking whether we are running reset queries in SimpleQuery(). Also add the test case for this.
Diffstat (limited to 'src/test/regression')
-rw-r--r--src/test/regression/tests/082.guard_against_bad_protocol/pgproto2.data4
-rwxr-xr-xsrc/test/regression/tests/082.guard_against_bad_protocol/test.sh15
2 files changed, 18 insertions, 1 deletions
diff --git a/src/test/regression/tests/082.guard_against_bad_protocol/pgproto2.data b/src/test/regression/tests/082.guard_against_bad_protocol/pgproto2.data
new file mode 100644
index 000000000..f4edbb4b5
--- /dev/null
+++ b/src/test/regression/tests/082.guard_against_bad_protocol/pgproto2.data
@@ -0,0 +1,4 @@
+'P' "" "SELECT 1" 0
+'B' "" "" 0 0 0
+'E' "" 0
+'X'
diff --git a/src/test/regression/tests/082.guard_against_bad_protocol/test.sh b/src/test/regression/tests/082.guard_against_bad_protocol/test.sh
index 5192c32f3..f1d16e6f3 100755
--- a/src/test/regression/tests/082.guard_against_bad_protocol/test.sh
+++ b/src/test/regression/tests/082.guard_against_bad_protocol/test.sh
@@ -26,6 +26,7 @@ source ./bashrc.ports
./startall
wait_for_pgpool_startup
+# test1:
# Wait for 1 seconds before pgproto ended.
# Usually 1 seconds should be enough to finish pgproto.
# If test suceeded, pgpool emits an error message:
@@ -35,9 +36,21 @@ timeout 1 $PGPROTO -d $PGDATABASE -p $PGPOOL_PORT -f ../pgproto.data |& grep 'si
if [ $? != 0 ];then
# timeout happened or pgproto returned non 0 status
- echo "test failed."
+ echo "test1 failed."
./shutdownall
exit 1
fi
+
+# test2:
+# Check if reset queries can be executed even if extended query messages
+# do not end.
+timeout 1 $PGPROTO -d $PGDATABASE -p $PGPOOL_PORT -f ../pgproto2.data
+if [ $? != 0 ];then
+# timeout happened or pgproto returned non 0 status
+ echo "test2 failed."
+ ./shutdownall
+ exit 1
+fi
+
./shutdownall
exit 0