Skip to content

Commit 4871a30

Browse files
committed
Test: add test cases for new "PGPOOL SET CACHE DELETE".
1 parent 329b5da commit 4871a30

File tree

4 files changed

+105
-0
lines changed

4 files changed

+105
-0
lines changed

src/test/regression/tests/006.memqcache/expected.n

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,3 +596,33 @@ SELECT 10;
596596
10
597597
(1 row)
598598

599+
--
600+
-- PGPOOL SET CACHE DELETE test cases.
601+
--
602+
-- force to create cache
603+
/*FORCE QUERY CACHE*/SELECT 1;
604+
NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
605+
?column?
606+
----------
607+
1
608+
(1 row)
609+
610+
-- make sure the cache was created
611+
/*FORCE QUERY CACHE*/SELECT 1;
612+
?column?
613+
----------
614+
1
615+
(1 row)
616+
617+
-- delete the cache
618+
PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;';
619+
NOTICE: query cache deleted. query: "/*FORCE QUERY CACHE*/SELECT 1;"
620+
SET
621+
-- make sure the cache was deleted
622+
/*FORCE QUERY CACHE*/SELECT 1;
623+
NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
624+
?column?
625+
----------
626+
1
627+
(1 row)
628+

src/test/regression/tests/006.memqcache/expected.r

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,3 +656,35 @@ SELECT 10;
656656
10
657657
(1 row)
658658

659+
--
660+
-- PGPOOL SET CACHE DELETE test cases.
661+
--
662+
-- force to create cache
663+
/*FORCE QUERY CACHE*/SELECT 1;
664+
NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
665+
NOTICE: DB node id: 1 statement: /*FORCE QUERY CACHE*/SELECT 1;
666+
?column?
667+
----------
668+
1
669+
(1 row)
670+
671+
-- make sure the cache was created
672+
/*FORCE QUERY CACHE*/SELECT 1;
673+
?column?
674+
----------
675+
1
676+
(1 row)
677+
678+
-- delete the cache
679+
PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;';
680+
NOTICE: query cache deleted. query: "/*FORCE QUERY CACHE*/SELECT 1;"
681+
SET
682+
-- make sure the cache was deleted
683+
/*FORCE QUERY CACHE*/SELECT 1;
684+
NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
685+
NOTICE: DB node id: 1 statement: /*FORCE QUERY CACHE*/SELECT 1;
686+
?column?
687+
----------
688+
1
689+
(1 row)
690+

src/test/regression/tests/006.memqcache/expected.s

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,3 +596,33 @@ SELECT 10;
596596
10
597597
(1 row)
598598

599+
--
600+
-- PGPOOL SET CACHE DELETE test cases.
601+
--
602+
-- force to create cache
603+
/*FORCE QUERY CACHE*/SELECT 1;
604+
NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
605+
?column?
606+
----------
607+
1
608+
(1 row)
609+
610+
-- make sure the cache was created
611+
/*FORCE QUERY CACHE*/SELECT 1;
612+
?column?
613+
----------
614+
1
615+
(1 row)
616+
617+
-- delete the cache
618+
PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;';
619+
NOTICE: query cache deleted. query: "/*FORCE QUERY CACHE*/SELECT 1;"
620+
SET
621+
-- make sure the cache was deleted
622+
/*FORCE QUERY CACHE*/SELECT 1;
623+
NOTICE: DB node id: 0 statement: /*FORCE QUERY CACHE*/SELECT 1;
624+
?column?
625+
----------
626+
1
627+
(1 row)
628+

src/test/regression/tests/006.memqcache/test.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,19 @@ ALTER ROLE foo WITH CONNECTION LIMIT 10;
458458
SELECT 10;
459459
EOF
460460

461+
$PSQL -a test >> result 2>&1 <<EOF
462+
--
463+
-- PGPOOL SET CACHE DELETE test cases.
464+
--
465+
-- force to create cache
466+
/*FORCE QUERY CACHE*/SELECT 1;
467+
-- make sure the cache was created
468+
/*FORCE QUERY CACHE*/SELECT 1;
469+
-- delete the cache
470+
PGPOOL SET CACHE DELETE '/*FORCE QUERY CACHE*/SELECT 1;';
471+
-- make sure the cache was deleted
472+
/*FORCE QUERY CACHE*/SELECT 1;
473+
EOF
461474
./shutdownall
462475

463476
cd ..

0 commit comments

Comments
 (0)