Test: add test cases for new "PGPOOL SET CACHE DELETE".
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 23 Oct 2024 06:29:17 +0000 (15:29 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 23 Oct 2024 06:29:17 +0000 (15:29 +0900)
src/test/regression/tests/006.memqcache/expected.n
src/test/regression/tests/006.memqcache/expected.r
src/test/regression/tests/006.memqcache/expected.s
src/test/regression/tests/006.memqcache/test.sh

index df85bcee94da3c80ad090d155fba81eb7d6fb17a..962dac4ea259db136c25053f7f515aaf85c09edc 100644 (file)
@@ -596,3 +596,33 @@ SELECT 10;
        10
 (1 row)
 
+--
+-- PGPOOL SET CACHE DELETE test cases.
+--
+-- force to create cache
+/*FORCE QUERY CACHE*/SELECT 1;
+NOTICE:  DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
+ ?column? 
+----------
+        1
+(1 row)
+
+-- make sure the cache was created
+/*FORCE QUERY CACHE*/SELECT 1;
+ ?column? 
+----------
+        1
+(1 row)
+
+-- delete the cache
+PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;';
+NOTICE:  query cache deleted. query: "/*FORCE QUERY CACHE*/SELECT 1;"
+SET
+-- make sure the cache was deleted
+/*FORCE QUERY CACHE*/SELECT 1;
+NOTICE:  DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
+ ?column? 
+----------
+        1
+(1 row)
+
index ebf84694cd2ce43bca8e8d50861a1cf5fdcea99b..33a0aedbcfeef48bd800f3bd5d33ebbcfecd4d88 100644 (file)
@@ -656,3 +656,35 @@ SELECT 10;
        10
 (1 row)
 
+--
+-- PGPOOL SET CACHE DELETE test cases.
+--
+-- force to create cache
+/*FORCE QUERY CACHE*/SELECT 1;
+NOTICE:  DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
+NOTICE:  DB node id: 1 statement: /*FORCE QUERY CACHE*/SELECT 1;
+ ?column? 
+----------
+        1
+(1 row)
+
+-- make sure the cache was created
+/*FORCE QUERY CACHE*/SELECT 1;
+ ?column? 
+----------
+        1
+(1 row)
+
+-- delete the cache
+PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;';
+NOTICE:  query cache deleted. query: "/*FORCE QUERY CACHE*/SELECT 1;"
+SET
+-- make sure the cache was deleted
+/*FORCE QUERY CACHE*/SELECT 1;
+NOTICE:  DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
+NOTICE:  DB node id: 1 statement: /*FORCE QUERY CACHE*/SELECT 1;
+ ?column? 
+----------
+        1
+(1 row)
+
index df85bcee94da3c80ad090d155fba81eb7d6fb17a..962dac4ea259db136c25053f7f515aaf85c09edc 100644 (file)
@@ -596,3 +596,33 @@ SELECT 10;
        10
 (1 row)
 
+--
+-- PGPOOL SET CACHE DELETE test cases.
+--
+-- force to create cache
+/*FORCE QUERY CACHE*/SELECT 1;
+NOTICE:  DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
+ ?column? 
+----------
+        1
+(1 row)
+
+-- make sure the cache was created
+/*FORCE QUERY CACHE*/SELECT 1;
+ ?column? 
+----------
+        1
+(1 row)
+
+-- delete the cache
+PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;';
+NOTICE:  query cache deleted. query: "/*FORCE QUERY CACHE*/SELECT 1;"
+SET
+-- make sure the cache was deleted
+/*FORCE QUERY CACHE*/SELECT 1;
+NOTICE:  DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
+ ?column? 
+----------
+        1
+(1 row)
+
index 00eb1dfe3a39d64561c667ce9bee4aa618db995d..fa9f4b15e30522931f233b21953781b6d7821516 100755 (executable)
@@ -458,6 +458,19 @@ ALTER ROLE foo WITH CONNECTION LIMIT 10;
 SELECT 10;
 EOF
 
+               $PSQL -a test >> result 2>&1 <<EOF
+--
+-- PGPOOL SET CACHE DELETE test cases.
+--
+-- force to create cache
+/*FORCE QUERY CACHE*/SELECT 1;
+-- make sure the cache was created
+/*FORCE QUERY CACHE*/SELECT 1;
+-- delete the cache
+PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;';
+-- make sure the cache was deleted
+/*FORCE QUERY CACHE*/SELECT 1;
+EOF
        ./shutdownall
 
        cd ..