Skip to content

Commit

Permalink
[pg15] refactor: misc code cleanup
Browse files Browse the repository at this point in the history
Summary:
- bootstrap.c, pg_yb_utils.h: PG commit 09568ec3d31bbd4854b857e8d23c197ad5b25c77 renamed FirstBootstrapObjectId  to FirstGenbkiObjectId . YB's initial merge commit (55782d5) incorrectly introduced YbFirstBootstrapObjectId, instead of using FirstGenbkiObjectId. Clean up YbFirstBootstrapObjectId.
- utility.c:  address a trivial YB_TODO.
- cmdtaglist.h, execnodes.h: clean up non-actionable YB_TODOs. The code seems correct already.
- indexing.c: multi-tuple version of YBCExecuteInsertForDb() doesn't exist and is not required because YB buffers the operations in pggate already. Clean up the non-actionable YB_TODO.

Test Plan: Jenkins: rebase: pg15

Reviewers: jason, fizaa

Reviewed By: fizaa

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D36316
  • Loading branch information
arpang committed Jul 4, 2024
1 parent b24cfaa commit 3e44ae9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 28 deletions.
14 changes: 7 additions & 7 deletions src/postgres/src/backend/bootstrap/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,13 @@ BootstrapModeMain(int argc, char *argv[], bool check_only)
if (IsYugaByteEnabled())
{
YBCCreateDatabase(Template1DbOid,
"template1",
InvalidOid,
"template0",
YbFirstBootstrapObjectId,
false /* colocated */,
NULL /* retry_on_oid_collision */,
0 /* clone_time */);
"template1",
InvalidOid,
"template0",
FirstGenbkiObjectId,
false /* colocated */,
NULL /* retry_on_oid_collision */,
0 /* clone_time */);
}

/*
Expand Down
4 changes: 0 additions & 4 deletions src/postgres/src/backend/catalog/indexing.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,6 @@ CatalogTuplesMultiInsertWithInfo(Relation heapRel, TupleTableSlot **slot,

if (IsYugaByteEnabled())
{
/*
* YB_TODO(arpan): Is there a multi tuple equivalent of
* YBCExecuteInsertForDb?
*/
bool shouldFree;
HeapTuple tuple;
for (int i = 0; i < ntuples; i++)
Expand Down
6 changes: 1 addition & 5 deletions src/postgres/src/backend/tcop/utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -2775,11 +2775,7 @@ CreateCommandTag(Node *parsetree)
tag = CMDTAG_DROP_TABLEGROUP;
break;
case OBJECT_YBPROFILE:
/* YB_TODO(neil) Needs to intro tag profile to the preprocessor.
* tag = CMDTAG_DROP_PROFILE;
*/
elog(WARNING, "unrecognized commandType: drop ybprofile");
tag = CMDTAG_UNKNOWN;
tag = CMDTAG_DROP_PROFILE;
break;
default:
tag = CMDTAG_UNKNOWN;
Expand Down
5 changes: 0 additions & 5 deletions src/postgres/src/include/nodes/execnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -992,11 +992,6 @@ typedef struct SetExprState
* (by InitFunctionCallInfoData) if func.fn_oid is valid. It also saves
* argument values between calls, when setArgsValid is true.
*/
/* YB_TODO(neil)
* - Grep for this field and fix allocation.
* FunctionCallInfo fcinfo_data;
* - Make sure tests work with new code.
*/
FunctionCallInfo fcinfo;
} SetExprState;

Expand Down
3 changes: 0 additions & 3 deletions src/postgres/src/include/pg_yb_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ extern bool yb_enable_docdb_tracing;
extern bool yb_read_from_followers;
extern int32_t yb_follower_read_staleness_ms;

/* YB_TODO: Remove this. */
#define YbFirstBootstrapObjectId 10000

/*
* Iterate over databases and execute a given code snippet.
* Should terminate with YB_FOR_EACH_DB_END.
Expand Down
4 changes: 0 additions & 4 deletions src/postgres/src/include/tcop/cmdtaglist.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
* textual name, so that we can bsearch on it; see GetCommandTagEnum().
*/

/*
* YB_TODO: Define Yugabyte statement tag here
*/

/* symbol name, textual name, event_trigger_ok, table_rewrite_ok, rowcount */
PG_CMDTAG(CMDTAG_UNKNOWN, "???", false, false, false)
PG_CMDTAG(CMDTAG_ALTER_ACCESS_METHOD, "ALTER ACCESS METHOD", true, false, false)
Expand Down

0 comments on commit 3e44ae9

Please sign in to comment.