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

[PGPRO-5306] more correct checking of b-tree search strategies#229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pashkinelfe merged 1 commit intomasterfrompgpro-5306
Jul 6, 2021
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletionssrc/pg_pathman.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1159,8 +1159,14 @@ handle_array(ArrayType *array,
boolelem_byval;
charelem_align;

/* Check if we can work with this strategy */
if (strategy == 0)
/*
* Check if we can work with this strategy
* We can work only with BTLessStrategyNumber, BTLessEqualStrategyNumber,
* BTEqualStrategyNumber, BTGreaterEqualStrategyNumber and BTGreaterStrategyNumber.
* If new search strategies appear in the future, then access optimizations from
* this function will not work, and the default behavior (handle_array_return:) will work.
*/
if (strategy == InvalidStrategy || strategy > BTGreaterStrategyNumber)
goto handle_array_return;

/* Get element's properties */
Expand All@@ -1177,8 +1183,12 @@ handle_array(ArrayType *array,
List *ranges;
inti;

/* This is only for paranoia's sake */
Assert(BTMaxStrategyNumber == 5 && BTEqualStrategyNumber == 3);
/* This is only for paranoia's sake (checking correctness of following take_min calculation) */
Assert(BTEqualStrategyNumber == 3
&& BTLessStrategyNumber < BTEqualStrategyNumber
&& BTLessEqualStrategyNumber < BTEqualStrategyNumber
&& BTGreaterEqualStrategyNumber > BTEqualStrategyNumber
&& BTGreaterStrategyNumber > BTEqualStrategyNumber);

/* Optimizations for <, <=, >=, > */
if (strategy != BTEqualStrategyNumber)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp