Add regression test for previous commit.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 31 Mar 2020 07:59:57 +0000 (16:59 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 31 Mar 2020 07:59:57 +0000 (16:59 +0900)
src/test/regression/tests/072.meqcache_bug2/extended_query_test.data [new file with mode: 0644]
src/test/regression/tests/072.meqcache_bug2/test.sh [new file with mode: 0755]

diff --git a/src/test/regression/tests/072.meqcache_bug2/extended_query_test.data b/src/test/regression/tests/072.meqcache_bug2/extended_query_test.data
new file mode 100644 (file)
index 0000000..07874b0
--- /dev/null
@@ -0,0 +1,24 @@
+'P'    ""      "SELECT 1"      0
+'B'    ""      ""      0       0       0
+'E'    ""      0
+'S'
+'Y'
+
+'P'    ""      "BEGIN" 0
+'B'    ""      ""      0       0       0
+'E'    ""      0
+
+'P'    ""      "SELECT 1"      0
+'B'    ""      ""      0       0       0
+'S'
+'Y'
+# Hang here if the bug bites!
+'E'    ""      0
+
+'P'    ""      "END"   0
+'B'    ""      ""      0       0       0
+'E'    ""      0
+'S'
+'Y'
+
+'X'
diff --git a/src/test/regression/tests/072.meqcache_bug2/test.sh b/src/test/regression/tests/072.meqcache_bug2/test.sh
new file mode 100755 (executable)
index 0000000..1253b7e
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+#-------------------------------------------------------------------
+# test script for a memqcache bug.
+#
+# If an execute message is issued right after Sync message and query
+# cache hits, Pgpool-II hangs.
+
+source $TESTLIBS
+WHOAMI=`whoami`
+TESTDIR=testdir
+PGPROTO=pgproto
+
+rm -fr $TESTDIR
+mkdir $TESTDIR
+cd $TESTDIR
+
+# create test environment
+echo -n "creating test environment..."
+$PGPOOL_SETUP -m s -n 2 || exit 1
+echo "done."
+
+source ./bashrc.ports
+
+export PGPORT=$PGPOOL_PORT
+
+echo "memory_cache_enabled = on" >> etc/pgpool.conf
+sh startall
+wait_for_pgpool_startup
+
+$PGPROTO -d test -f ../extended_query_test.data        # hang here if the bug bites you...
+sh shutdownall
+exit 0