-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MERGE PG15] ysql: add yb_make_greater_string
Summary: When migrating from PG 11.2 to PG 15, we come across commit 49fa99e54ec0ded180b52a4a14e543702d53e8c9 that makes make_greater_string private: Move pattern selectivity code from selfuncs.c to like_support.c. ... This change localizes the use of pattern_fixed_prefix() and make_greater_string() so that they no longer need be exported. (We might get pushback from extensions about that, perhaps, in which case I'd be inclined to re-export them in a new header file like_support.h.) ... ybgin uses make_greater_string for tsvector prefix logic. Since it is not trivial to indirectly get the benefit of make_greater_string through the publicly exposed support functions (they take complex Node argument), lean towards re-exposing the function through new header yb_like_support.h and new function yb_make_greater_string. If, in the future, upstream postgres decides to expose make_greater_string, these changes can be scrapped in favor of using make_greater_string again. Test Plan: Jenkins: compile only, rebase: pg15 Reviewers: neil, amartsinchyk Reviewed By: amartsinchyk Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D23110
- Loading branch information
Showing
3 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*-------------------------------------------------------------------------- | ||
* | ||
* yb_like_support.h | ||
* External like support functions. | ||
* | ||
* Copyright (c) Yugabyte, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy | ||
* of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* IDENTIFICATION | ||
* src/include/utils/yb_like_support.h | ||
*-------------------------------------------------------------------------- | ||
*/ | ||
|
||
#include "postgres.h" | ||
|
||
#include "fmgr.h" | ||
#include "nodes/primnodes.h" | ||
#include "postgres_ext.h" | ||
|
||
/* | ||
* Postgres 11 -> 15 changed make_greater_string to static, so reexpose as | ||
* yb_make_greater_string. If, in the future, postgres decides to expose | ||
* make_greater_string via a like_support.h, this can be replaced by that. | ||
*/ | ||
Const *yb_make_greater_string(const Const *str_const, FmgrInfo *ltproc, | ||
Oid collation); |