Skip to content

2.25.1.0-b188

@jaki jaki tagged this 15 Jan 05:55
Summary:
Type names that YB introduced in postgres code should have "yb" (case
insensitive) in it, most often as a prefix.  Fix any names that don't
have it.  Find such types by comparing with upstream PG.  See the test
plan for example.

As part of this, remove some types that aren't used:

- Opts_t (remove just the type name)
- PreparedParamsData (removed from PG 11.2 to PG 15.2 by
  2f48ede080f42b97b594fb14102c82ca1001b80c, but YB's merge appears to
  not have removed it)
- pull_varattnos_walker_ptr
- yb_catclist_iterator (remove just the type name)

Note:

- struct hdr_iter is defined in a thirdparty library, so that can't be
  changed to have a "yb" prefix.  Instead, change the typedef to have
  "yb" prefix.
- PgStat_MsgHdr* is ifdef'd out because upstream PG removed that related
  code from PG 11.2 to PG 15.2.  Still do the renames anyway even though
  this code is not used.
- Sort typedefs.list.
- It's not possible to add lint rules because knowledge of which types
  are YB-introduced depends on having a copy of the postgres code.  The
  test plan has this in ~/code/postgres, but that is not something that
  can be guaranteed for all users.  A best effort could be to make sure
  all types defined in YB files have "yb" prefix.  That can be a
  followup.

This is part of a series of commits to run pgindent.  The previous
commit is d20a6b3ce4d3840e93b5ecc336080d61b906b790.
Jira: DB-14881

Test Plan:
On Almalinux 8, Zsh (extended glob), upstream postgres REL_15_2 checked
out in ~/code/postgres, ctags version "Exuberant Ctags 5.8",

    [ -z "$(diff <(cd src/postgres; git ls-files ^third-party-extensions ../yb/yql/pggate/***/ybc_*.h | ctags -L - --languages=c,c++ --c-kinds=gstu --c++-kinds=gstu -f /dev/stdout | awk '{print$1}' | uniq) <(cd ~/code/postgres; git ls-files | ctags -L - --languages=c,c++ --c-kinds=gstu --c++-kinds=gstu -f /dev/stdout | awk '{print$1}' | uniq) | grep '>')" ]
    [ -z "$(diff <(cd src/postgres; git ls-files ^third-party-extensions ../yb/yql/pggate/***/ybc_*.h | ctags -L - --languages=c,c++ --c-kinds=gstu --c++-kinds=gstu -f /dev/stdout | awk '{print$1}' | uniq) <(cd ~/code/postgres; git ls-files | ctags -L - --languages=c,c++ --c-kinds=gstu --c++-kinds=gstu -f /dev/stdout | awk '{print$1}' | uniq) | grep '<' | grep -Ev 'Yb|YB|yb')" ]

Close: #25631

Reviewers: kramanathan

Reviewed By: kramanathan

Subscribers: kramanathan, ybase, yql, ycdcxcluster

Differential Revision: https://phorge.dev.yugabyte.com/D41178
Assets 2
Loading