Use lfirst_node() macro

This adds some extra safety plus makes to itnent of the code more
obvious.
pull/220/head
Andreas Karlsson 5 months ago committed by Andreas Karlsson
parent 51e48623dd
commit 8d1ef844a0
  1. 8
      contrib/pg_tde/src/pg_tde_event_capture.c

@ -269,7 +269,7 @@ pg_tde_ddl_command_start_capture(PG_FUNCTION_ARGS)
{
foreach(lcmd, stmt->cmds)
{
AlterTableCmd *cmd = castNode(AlterTableCmd, lfirst(lcmd));
AlterTableCmd *cmd = lfirst_node(AlterTableCmd, lcmd);
if (cmd->subtype == AT_SetAccessMethod)
setAccessMethod = cmd;
@ -319,7 +319,7 @@ pg_tde_ddl_command_start_capture(PG_FUNCTION_ARGS)
foreach(option, stmt->options)
{
DefElem *defel = (DefElem *) lfirst(option);
DefElem *defel = lfirst_node(DefElem, option);
if (strcmp(defel->defname, "owned_by") == 0)
{
@ -368,7 +368,7 @@ pg_tde_ddl_command_start_capture(PG_FUNCTION_ARGS)
{
foreach(option, stmt->options)
{
DefElem *defel = (DefElem *) lfirst(option);
DefElem *defel = lfirst_node(DefElem, option);
if (strcmp(defel->defname, "owned_by") == 0)
{
@ -516,7 +516,7 @@ pg_tde_proccess_utility(PlannedStmt *pstmt,
foreach(option, stmt->options)
{
DefElem *defel = (DefElem *) lfirst(option);
DefElem *defel = lfirst_node(DefElem, option);
if (strcmp(defel->defname, "template") == 0)
dbtemplate = defGetString(defel);

Loading…
Cancel
Save