Skip to content

Commit 66f4191

Browse files
committed
calamity tests for function drop_range_partition_expand_next()
1 parent 52375ca commit 66f4191

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

expected/pathman_calamity.out

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,15 @@ SELECT build_update_trigger_func_name(NULL) IS NULL;
355355
/* check function stop_concurrent_part_task() */
356356
SELECT stop_concurrent_part_task(1::regclass);
357357
ERROR: cannot find worker for relation "1"
358+
/* check function drop_range_partition_expand_next() */
359+
SELECT drop_range_partition_expand_next('pg_class');
360+
ERROR: relation "pg_class" is not a partition
361+
SELECT drop_range_partition_expand_next(NULL) IS NULL;
362+
?column?
363+
----------
364+
t
365+
(1 row)
366+
358367
/* check invoke_on_partition_created_callback() for RANGE */
359368
SELECT invoke_on_partition_created_callback('calamity.part_test', 'calamity.part_test', 1, NULL, NULL::int);
360369
ERROR: both bounds must be provided for RANGE partition

sql/pathman_calamity.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ SELECT build_update_trigger_func_name(NULL) IS NULL;
124124
/* check function stop_concurrent_part_task() */
125125
SELECT stop_concurrent_part_task(1::regclass);
126126

127+
/* check function drop_range_partition_expand_next() */
128+
SELECT drop_range_partition_expand_next('pg_class');
129+
SELECT drop_range_partition_expand_next(NULL) IS NULL;
130+
127131
/* check invoke_on_partition_created_callback() for RANGE */
128132
SELECT invoke_on_partition_created_callback('calamity.part_test', 'calamity.part_test', 1, NULL, NULL::int);
129133
SELECT invoke_on_partition_created_callback('calamity.part_test', 'calamity.part_test', 1, 1, NULL);

src/pl_range_funcs.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -934,12 +934,12 @@ drop_table_by_oid(Oid relid)
934934
DropStmt *n = makeNode(DropStmt);
935935
const char *relname = get_qualified_rel_name(relid);
936936

937-
n->removeType = OBJECT_TABLE;
938-
n->missing_ok = false;
939-
n->objects = list_make1(stringToQualifiedNameList(relname));
940-
n->arguments = NIL;
941-
n->behavior = DROP_RESTRICT; /* default behavior */
942-
n->concurrent = false;
937+
n->removeType = OBJECT_TABLE;
938+
n->missing_ok = false;
939+
n->objects = list_make1(stringToQualifiedNameList(relname));
940+
n->arguments = NIL;
941+
n->behavior = DROP_RESTRICT; /* default behavior */
942+
n->concurrent = false;
943943

944944
RemoveRelations(n);
945945
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy