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

Commit2ec3923

Browse files
committed
Check that pathman is initialized in get_pathman_config_relid.
Also, check hash partitioned table consistency always, not under assertchecking.
1 parent079797e commit2ec3923

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

‎src/pg_pathman.c‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,17 @@ _PG_init(void)
333333
Oid
334334
get_pathman_config_relid(boolinvalid_is_ok)
335335
{
336+
if (!IsPathmanInitialized())
337+
{
338+
if (invalid_is_ok)
339+
returnInvalidOid;
340+
elog(ERROR,"pg_pathman is not initialized yet");
341+
}
342+
336343
/* Raise ERROR if Oid is invalid */
337344
if (!OidIsValid(pathman_config_relid)&& !invalid_is_ok)
338-
elog(ERROR,
339-
(!IsPathmanInitialized() ?
340-
"pg_pathman is not initialized yet" :
341-
"unexpected error in function "
342-
CppAsString(get_pathman_config_relid)));
345+
elog(ERROR,"unexpected error in function "
346+
CppAsString(get_pathman_config_relid));
343347

344348
returnpathman_config_relid;
345349
}
@@ -348,13 +352,17 @@ get_pathman_config_relid(bool invalid_is_ok)
348352
Oid
349353
get_pathman_config_params_relid(boolinvalid_is_ok)
350354
{
355+
if (!IsPathmanInitialized())
356+
{
357+
if (invalid_is_ok)
358+
returnInvalidOid;
359+
elog(ERROR,"pg_pathman is not initialized yet");
360+
}
361+
351362
/* Raise ERROR if Oid is invalid */
352363
if (!OidIsValid(pathman_config_relid)&& !invalid_is_ok)
353-
elog(ERROR,
354-
(!IsPathmanInitialized() ?
355-
"pg_pathman is not initialized yet" :
356-
"unexpected error in function "
357-
CppAsString(get_pathman_config_params_relid)));
364+
elog(ERROR,"unexpected error in function "
365+
CppAsString(get_pathman_config_params_relid));
358366

359367
returnpathman_config_params_relid;
360368
}

‎src/relation_info.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,6 @@ fill_prel_with_partitions(PartRelationInfo *prel,
802802
prel->children[i]=prel->ranges[i].child_oid;
803803
}
804804

805-
#ifdefUSE_ASSERT_CHECKING
806805
/* Check that each partition Oid has been assigned properly */
807806
if (prel->parttype==PT_HASH)
808807
for (i=0;i<PrelChildrenCount(prel);i++)
@@ -815,7 +814,6 @@ fill_prel_with_partitions(PartRelationInfo *prel,
815814
get_rel_name_or_relid(PrelParentRelid(prel)));
816815
}
817816
}
818-
#endif
819817
}
820818

821819
/* qsort() comparison function for RangeEntries */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp