Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit621ce28

Browse files
committed
add tests for 'pathman_cache_stats' view
1 parent4d9d52a commit621ce28

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

‎expected/pathman_calamity.out

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,34 @@ NOTICE: drop cascades to table calamity.test_range_oid_1
670670
DROP SCHEMA calamity CASCADE;
671671
NOTICE: drop cascades to 18 other objects
672672
DROP EXTENSION pg_pathman;
673+
/*
674+
* -------------------------------------
675+
* Special tests (pathman_cache_stats)
676+
* -------------------------------------
677+
*/
678+
CREATE SCHEMA calamity;
679+
CREATE EXTENSION pg_pathman;
680+
/* check view pathman_cache_stats */
681+
CREATE TABLE calamity.test_pathman_cache_stats(val NUMERIC NOT NULL);
682+
SELECT create_range_partitions('calamity.test_pathman_cache_stats', 'val', 1, 10, 10);
683+
NOTICE: sequence "test_pathman_cache_stats_seq" does not exist, skipping
684+
create_range_partitions
685+
-------------------------
686+
10
687+
(1 row)
688+
689+
SELECT context, entries FROM pathman_cache_stats ORDER BY context;/* OK */
690+
context | entries
691+
-------------------------+---------
692+
maintenance | 0
693+
partition bounds cache | 10
694+
partition parents cache | 10
695+
partition pruning cache | 1
696+
(4 rows)
697+
698+
DROP SCHEMA calamity CASCADE;
699+
NOTICE: drop cascades to 12 other objects
700+
DROP EXTENSION pg_pathman;
673701
/*
674702
* ------------------------------------------
675703
* Special tests (uninitialized pg_pathman)

‎sql/pathman_calamity.sql

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,24 @@ SELECT get_part_range('calamity.test_range_oid_1', NULL::INT4);/* OK */
260260

261261
DROPTABLEcalamity.test_range_oid CASCADE;
262262

263+
DROPSCHEMA calamity CASCADE;
264+
DROP EXTENSION pg_pathman;
265+
266+
267+
268+
/*
269+
* -------------------------------------
270+
* Special tests (pathman_cache_stats)
271+
* -------------------------------------
272+
*/
273+
274+
CREATESCHEMAcalamity;
275+
CREATE EXTENSION pg_pathman;
276+
277+
/* check view pathman_cache_stats*/
278+
CREATETABLEcalamity.test_pathman_cache_stats(valNUMERICNOT NULL);
279+
SELECT create_range_partitions('calamity.test_pathman_cache_stats','val',1,10,10);
280+
SELECT context, entriesFROM pathman_cache_statsORDER BY context;/* OK*/
263281

264282
DROPSCHEMA calamity CASCADE;
265283
DROP EXTENSION pg_pathman;

‎src/include/init.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ static inline const char *
6767
simpify_mcxt_name(MemoryContextmcxt)
6868
{
6969
staticconstchar*top_mcxt="maintenance",
70-
*bound_mcxt="partitioninfo cache",
71-
*parent_mcxt="parent mapping cache",
72-
*constr_mcxt="bounds cache";
70+
*bound_mcxt="partitionpruning cache",
71+
*parent_mcxt="partition parents cache",
72+
*constr_mcxt="partitionbounds cache";
7373

7474
if (mcxt==TopPathmanContext)
7575
returntop_mcxt;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp