diff --git a/src/pg_query_fingerprint_conds.c b/src/pg_query_fingerprint_conds.c index 8247423b..278d50ab 100644 --- a/src/pg_query_fingerprint_conds.c +++ b/src/pg_query_fingerprint_conds.c @@ -9,6 +9,10 @@ case T_TableFunc: _fingerprintString(ctx, "TableFunc"); _fingerprintTableFunc(ctx, obj, parent, field_name, depth); break; +case T_IntoClause: + _fingerprintString(ctx, "IntoClause"); + _fingerprintIntoClause(ctx, obj, parent, field_name, depth); + break; case T_Var: _fingerprintString(ctx, "Var"); _fingerprintVar(ctx, obj, parent, field_name, depth); @@ -137,6 +141,26 @@ case T_XmlExpr: _fingerprintString(ctx, "XmlExpr"); _fingerprintXmlExpr(ctx, obj, parent, field_name, depth); break; +case T_JsonFormat: + _fingerprintString(ctx, "JsonFormat"); + _fingerprintJsonFormat(ctx, obj, parent, field_name, depth); + break; +case T_JsonReturning: + _fingerprintString(ctx, "JsonReturning"); + _fingerprintJsonReturning(ctx, obj, parent, field_name, depth); + break; +case T_JsonValueExpr: + _fingerprintString(ctx, "JsonValueExpr"); + _fingerprintJsonValueExpr(ctx, obj, parent, field_name, depth); + break; +case T_JsonConstructorExpr: + _fingerprintString(ctx, "JsonConstructorExpr"); + _fingerprintJsonConstructorExpr(ctx, obj, parent, field_name, depth); + break; +case T_JsonIsPredicate: + _fingerprintString(ctx, "JsonIsPredicate"); + _fingerprintJsonIsPredicate(ctx, obj, parent, field_name, depth); + break; case T_NullTest: _fingerprintString(ctx, "NullTest"); _fingerprintNullTest(ctx, obj, parent, field_name, depth); @@ -188,22 +212,248 @@ case T_OnConflictExpr: _fingerprintString(ctx, "OnConflictExpr"); _fingerprintOnConflictExpr(ctx, obj, parent, field_name, depth); break; -case T_IntoClause: - _fingerprintString(ctx, "IntoClause"); - _fingerprintIntoClause(ctx, obj, parent, field_name, depth); +case T_Query: + _fingerprintString(ctx, "Query"); + _fingerprintQuery(ctx, obj, parent, field_name, depth); + break; +case T_TypeName: + _fingerprintString(ctx, "TypeName"); + _fingerprintTypeName(ctx, obj, parent, field_name, depth); + break; +case T_ColumnRef: + _fingerprintString(ctx, "ColumnRef"); + _fingerprintColumnRef(ctx, obj, parent, field_name, depth); + break; +case T_ParamRef: + // Intentionally ignoring for fingerprinting + break; +case T_A_Expr: + _fingerprintString(ctx, "A_Expr"); + _fingerprintA_Expr(ctx, obj, parent, field_name, depth); + break; +case T_TypeCast: + if (!IsA(castNode(TypeCast, (void*) obj)->arg, A_Const) && !IsA(castNode(TypeCast, (void*) obj)->arg, ParamRef)) + { + _fingerprintString(ctx, "TypeCast"); + _fingerprintTypeCast(ctx, obj, parent, field_name, depth); + } + break; +case T_CollateClause: + _fingerprintString(ctx, "CollateClause"); + _fingerprintCollateClause(ctx, obj, parent, field_name, depth); + break; +case T_RoleSpec: + _fingerprintString(ctx, "RoleSpec"); + _fingerprintRoleSpec(ctx, obj, parent, field_name, depth); + break; +case T_FuncCall: + _fingerprintString(ctx, "FuncCall"); + _fingerprintFuncCall(ctx, obj, parent, field_name, depth); + break; +case T_A_Star: + _fingerprintString(ctx, "A_Star"); + _fingerprintA_Star(ctx, obj, parent, field_name, depth); + break; +case T_A_Indices: + _fingerprintString(ctx, "A_Indices"); + _fingerprintA_Indices(ctx, obj, parent, field_name, depth); + break; +case T_A_Indirection: + _fingerprintString(ctx, "A_Indirection"); + _fingerprintA_Indirection(ctx, obj, parent, field_name, depth); + break; +case T_A_ArrayExpr: + _fingerprintString(ctx, "A_ArrayExpr"); + _fingerprintA_ArrayExpr(ctx, obj, parent, field_name, depth); + break; +case T_ResTarget: + _fingerprintString(ctx, "ResTarget"); + _fingerprintResTarget(ctx, obj, parent, field_name, depth); + break; +case T_MultiAssignRef: + _fingerprintString(ctx, "MultiAssignRef"); + _fingerprintMultiAssignRef(ctx, obj, parent, field_name, depth); + break; +case T_SortBy: + _fingerprintString(ctx, "SortBy"); + _fingerprintSortBy(ctx, obj, parent, field_name, depth); + break; +case T_WindowDef: + _fingerprintString(ctx, "WindowDef"); + _fingerprintWindowDef(ctx, obj, parent, field_name, depth); + break; +case T_RangeSubselect: + _fingerprintString(ctx, "RangeSubselect"); + _fingerprintRangeSubselect(ctx, obj, parent, field_name, depth); + break; +case T_RangeFunction: + _fingerprintString(ctx, "RangeFunction"); + _fingerprintRangeFunction(ctx, obj, parent, field_name, depth); + break; +case T_RangeTableFunc: + _fingerprintString(ctx, "RangeTableFunc"); + _fingerprintRangeTableFunc(ctx, obj, parent, field_name, depth); + break; +case T_RangeTableFuncCol: + _fingerprintString(ctx, "RangeTableFuncCol"); + _fingerprintRangeTableFuncCol(ctx, obj, parent, field_name, depth); + break; +case T_RangeTableSample: + _fingerprintString(ctx, "RangeTableSample"); + _fingerprintRangeTableSample(ctx, obj, parent, field_name, depth); + break; +case T_ColumnDef: + _fingerprintString(ctx, "ColumnDef"); + _fingerprintColumnDef(ctx, obj, parent, field_name, depth); + break; +case T_TableLikeClause: + _fingerprintString(ctx, "TableLikeClause"); + _fingerprintTableLikeClause(ctx, obj, parent, field_name, depth); + break; +case T_IndexElem: + _fingerprintString(ctx, "IndexElem"); + _fingerprintIndexElem(ctx, obj, parent, field_name, depth); + break; +case T_DefElem: + _fingerprintString(ctx, "DefElem"); + _fingerprintDefElem(ctx, obj, parent, field_name, depth); + break; +case T_LockingClause: + _fingerprintString(ctx, "LockingClause"); + _fingerprintLockingClause(ctx, obj, parent, field_name, depth); + break; +case T_XmlSerialize: + _fingerprintString(ctx, "XmlSerialize"); + _fingerprintXmlSerialize(ctx, obj, parent, field_name, depth); + break; +case T_PartitionElem: + _fingerprintString(ctx, "PartitionElem"); + _fingerprintPartitionElem(ctx, obj, parent, field_name, depth); + break; +case T_PartitionSpec: + _fingerprintString(ctx, "PartitionSpec"); + _fingerprintPartitionSpec(ctx, obj, parent, field_name, depth); + break; +case T_PartitionBoundSpec: + _fingerprintString(ctx, "PartitionBoundSpec"); + _fingerprintPartitionBoundSpec(ctx, obj, parent, field_name, depth); + break; +case T_PartitionRangeDatum: + _fingerprintString(ctx, "PartitionRangeDatum"); + _fingerprintPartitionRangeDatum(ctx, obj, parent, field_name, depth); + break; +case T_PartitionCmd: + _fingerprintString(ctx, "PartitionCmd"); + _fingerprintPartitionCmd(ctx, obj, parent, field_name, depth); + break; +case T_RangeTblEntry: + _fingerprintString(ctx, "RangeTblEntry"); + _fingerprintRangeTblEntry(ctx, obj, parent, field_name, depth); + break; +case T_RTEPermissionInfo: + _fingerprintString(ctx, "RTEPermissionInfo"); + _fingerprintRTEPermissionInfo(ctx, obj, parent, field_name, depth); + break; +case T_RangeTblFunction: + _fingerprintString(ctx, "RangeTblFunction"); + _fingerprintRangeTblFunction(ctx, obj, parent, field_name, depth); + break; +case T_TableSampleClause: + _fingerprintString(ctx, "TableSampleClause"); + _fingerprintTableSampleClause(ctx, obj, parent, field_name, depth); + break; +case T_WithCheckOption: + _fingerprintString(ctx, "WithCheckOption"); + _fingerprintWithCheckOption(ctx, obj, parent, field_name, depth); + break; +case T_SortGroupClause: + _fingerprintString(ctx, "SortGroupClause"); + _fingerprintSortGroupClause(ctx, obj, parent, field_name, depth); + break; +case T_GroupingSet: + _fingerprintString(ctx, "GroupingSet"); + _fingerprintGroupingSet(ctx, obj, parent, field_name, depth); + break; +case T_WindowClause: + _fingerprintString(ctx, "WindowClause"); + _fingerprintWindowClause(ctx, obj, parent, field_name, depth); + break; +case T_RowMarkClause: + _fingerprintString(ctx, "RowMarkClause"); + _fingerprintRowMarkClause(ctx, obj, parent, field_name, depth); + break; +case T_WithClause: + _fingerprintString(ctx, "WithClause"); + _fingerprintWithClause(ctx, obj, parent, field_name, depth); + break; +case T_InferClause: + _fingerprintString(ctx, "InferClause"); + _fingerprintInferClause(ctx, obj, parent, field_name, depth); + break; +case T_OnConflictClause: + _fingerprintString(ctx, "OnConflictClause"); + _fingerprintOnConflictClause(ctx, obj, parent, field_name, depth); + break; +case T_CTESearchClause: + _fingerprintString(ctx, "CTESearchClause"); + _fingerprintCTESearchClause(ctx, obj, parent, field_name, depth); + break; +case T_CTECycleClause: + _fingerprintString(ctx, "CTECycleClause"); + _fingerprintCTECycleClause(ctx, obj, parent, field_name, depth); + break; +case T_CommonTableExpr: + _fingerprintString(ctx, "CommonTableExpr"); + _fingerprintCommonTableExpr(ctx, obj, parent, field_name, depth); + break; +case T_MergeWhenClause: + _fingerprintString(ctx, "MergeWhenClause"); + _fingerprintMergeWhenClause(ctx, obj, parent, field_name, depth); break; case T_MergeAction: _fingerprintString(ctx, "MergeAction"); _fingerprintMergeAction(ctx, obj, parent, field_name, depth); break; +case T_TriggerTransition: + _fingerprintString(ctx, "TriggerTransition"); + _fingerprintTriggerTransition(ctx, obj, parent, field_name, depth); + break; +case T_JsonOutput: + _fingerprintString(ctx, "JsonOutput"); + _fingerprintJsonOutput(ctx, obj, parent, field_name, depth); + break; +case T_JsonKeyValue: + _fingerprintString(ctx, "JsonKeyValue"); + _fingerprintJsonKeyValue(ctx, obj, parent, field_name, depth); + break; +case T_JsonObjectConstructor: + _fingerprintString(ctx, "JsonObjectConstructor"); + _fingerprintJsonObjectConstructor(ctx, obj, parent, field_name, depth); + break; +case T_JsonArrayConstructor: + _fingerprintString(ctx, "JsonArrayConstructor"); + _fingerprintJsonArrayConstructor(ctx, obj, parent, field_name, depth); + break; +case T_JsonArrayQueryConstructor: + _fingerprintString(ctx, "JsonArrayQueryConstructor"); + _fingerprintJsonArrayQueryConstructor(ctx, obj, parent, field_name, depth); + break; +case T_JsonAggConstructor: + _fingerprintString(ctx, "JsonAggConstructor"); + _fingerprintJsonAggConstructor(ctx, obj, parent, field_name, depth); + break; +case T_JsonObjectAgg: + _fingerprintString(ctx, "JsonObjectAgg"); + _fingerprintJsonObjectAgg(ctx, obj, parent, field_name, depth); + break; +case T_JsonArrayAgg: + _fingerprintString(ctx, "JsonArrayAgg"); + _fingerprintJsonArrayAgg(ctx, obj, parent, field_name, depth); + break; case T_RawStmt: _fingerprintString(ctx, "RawStmt"); _fingerprintRawStmt(ctx, obj, parent, field_name, depth); break; -case T_Query: - _fingerprintString(ctx, "Query"); - _fingerprintQuery(ctx, obj, parent, field_name, depth); - break; case T_InsertStmt: _fingerprintString(ctx, "InsertStmt"); _fingerprintInsertStmt(ctx, obj, parent, field_name, depth); @@ -224,6 +474,10 @@ case T_SelectStmt: _fingerprintString(ctx, "SelectStmt"); _fingerprintSelectStmt(ctx, obj, parent, field_name, depth); break; +case T_SetOperationStmt: + _fingerprintString(ctx, "SetOperationStmt"); + _fingerprintSetOperationStmt(ctx, obj, parent, field_name, depth); + break; case T_ReturnStmt: _fingerprintString(ctx, "ReturnStmt"); _fingerprintReturnStmt(ctx, obj, parent, field_name, depth); @@ -232,26 +486,42 @@ case T_PLAssignStmt: _fingerprintString(ctx, "PLAssignStmt"); _fingerprintPLAssignStmt(ctx, obj, parent, field_name, depth); break; +case T_CreateSchemaStmt: + _fingerprintString(ctx, "CreateSchemaStmt"); + _fingerprintCreateSchemaStmt(ctx, obj, parent, field_name, depth); + break; case T_AlterTableStmt: _fingerprintString(ctx, "AlterTableStmt"); _fingerprintAlterTableStmt(ctx, obj, parent, field_name, depth); break; +case T_ReplicaIdentityStmt: + _fingerprintString(ctx, "ReplicaIdentityStmt"); + _fingerprintReplicaIdentityStmt(ctx, obj, parent, field_name, depth); + break; case T_AlterTableCmd: _fingerprintString(ctx, "AlterTableCmd"); _fingerprintAlterTableCmd(ctx, obj, parent, field_name, depth); break; +case T_AlterCollationStmt: + _fingerprintString(ctx, "AlterCollationStmt"); + _fingerprintAlterCollationStmt(ctx, obj, parent, field_name, depth); + break; case T_AlterDomainStmt: _fingerprintString(ctx, "AlterDomainStmt"); _fingerprintAlterDomainStmt(ctx, obj, parent, field_name, depth); break; -case T_SetOperationStmt: - _fingerprintString(ctx, "SetOperationStmt"); - _fingerprintSetOperationStmt(ctx, obj, parent, field_name, depth); - break; case T_GrantStmt: _fingerprintString(ctx, "GrantStmt"); _fingerprintGrantStmt(ctx, obj, parent, field_name, depth); break; +case T_ObjectWithArgs: + _fingerprintString(ctx, "ObjectWithArgs"); + _fingerprintObjectWithArgs(ctx, obj, parent, field_name, depth); + break; +case T_AccessPriv: + _fingerprintString(ctx, "AccessPriv"); + _fingerprintAccessPriv(ctx, obj, parent, field_name, depth); + break; case T_GrantRoleStmt: _fingerprintString(ctx, "GrantRoleStmt"); _fingerprintGrantRoleStmt(ctx, obj, parent, field_name, depth); @@ -260,26 +530,166 @@ case T_AlterDefaultPrivilegesStmt: _fingerprintString(ctx, "AlterDefaultPrivilegesStmt"); _fingerprintAlterDefaultPrivilegesStmt(ctx, obj, parent, field_name, depth); break; -case T_ClosePortalStmt: - _fingerprintString(ctx, "ClosePortalStmt"); - _fingerprintClosePortalStmt(ctx, obj, parent, field_name, depth); +case T_CopyStmt: + _fingerprintString(ctx, "CopyStmt"); + _fingerprintCopyStmt(ctx, obj, parent, field_name, depth); break; -case T_ClusterStmt: - _fingerprintString(ctx, "ClusterStmt"); - _fingerprintClusterStmt(ctx, obj, parent, field_name, depth); +case T_VariableSetStmt: + _fingerprintString(ctx, "VariableSetStmt"); + _fingerprintVariableSetStmt(ctx, obj, parent, field_name, depth); break; -case T_CopyStmt: - _fingerprintString(ctx, "CopyStmt"); - _fingerprintCopyStmt(ctx, obj, parent, field_name, depth); +case T_VariableShowStmt: + _fingerprintString(ctx, "VariableShowStmt"); + _fingerprintVariableShowStmt(ctx, obj, parent, field_name, depth); break; case T_CreateStmt: _fingerprintString(ctx, "CreateStmt"); _fingerprintCreateStmt(ctx, obj, parent, field_name, depth); break; +case T_Constraint: + _fingerprintString(ctx, "Constraint"); + _fingerprintConstraint(ctx, obj, parent, field_name, depth); + break; +case T_CreateTableSpaceStmt: + _fingerprintString(ctx, "CreateTableSpaceStmt"); + _fingerprintCreateTableSpaceStmt(ctx, obj, parent, field_name, depth); + break; +case T_DropTableSpaceStmt: + _fingerprintString(ctx, "DropTableSpaceStmt"); + _fingerprintDropTableSpaceStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterTableSpaceOptionsStmt: + _fingerprintString(ctx, "AlterTableSpaceOptionsStmt"); + _fingerprintAlterTableSpaceOptionsStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterTableMoveAllStmt: + _fingerprintString(ctx, "AlterTableMoveAllStmt"); + _fingerprintAlterTableMoveAllStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateExtensionStmt: + _fingerprintString(ctx, "CreateExtensionStmt"); + _fingerprintCreateExtensionStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterExtensionStmt: + _fingerprintString(ctx, "AlterExtensionStmt"); + _fingerprintAlterExtensionStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterExtensionContentsStmt: + _fingerprintString(ctx, "AlterExtensionContentsStmt"); + _fingerprintAlterExtensionContentsStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateFdwStmt: + _fingerprintString(ctx, "CreateFdwStmt"); + _fingerprintCreateFdwStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterFdwStmt: + _fingerprintString(ctx, "AlterFdwStmt"); + _fingerprintAlterFdwStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateForeignServerStmt: + _fingerprintString(ctx, "CreateForeignServerStmt"); + _fingerprintCreateForeignServerStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterForeignServerStmt: + _fingerprintString(ctx, "AlterForeignServerStmt"); + _fingerprintAlterForeignServerStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateForeignTableStmt: + _fingerprintString(ctx, "CreateForeignTableStmt"); + _fingerprintCreateForeignTableStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateUserMappingStmt: + _fingerprintString(ctx, "CreateUserMappingStmt"); + _fingerprintCreateUserMappingStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterUserMappingStmt: + _fingerprintString(ctx, "AlterUserMappingStmt"); + _fingerprintAlterUserMappingStmt(ctx, obj, parent, field_name, depth); + break; +case T_DropUserMappingStmt: + _fingerprintString(ctx, "DropUserMappingStmt"); + _fingerprintDropUserMappingStmt(ctx, obj, parent, field_name, depth); + break; +case T_ImportForeignSchemaStmt: + _fingerprintString(ctx, "ImportForeignSchemaStmt"); + _fingerprintImportForeignSchemaStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreatePolicyStmt: + _fingerprintString(ctx, "CreatePolicyStmt"); + _fingerprintCreatePolicyStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterPolicyStmt: + _fingerprintString(ctx, "AlterPolicyStmt"); + _fingerprintAlterPolicyStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateAmStmt: + _fingerprintString(ctx, "CreateAmStmt"); + _fingerprintCreateAmStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateTrigStmt: + _fingerprintString(ctx, "CreateTrigStmt"); + _fingerprintCreateTrigStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateEventTrigStmt: + _fingerprintString(ctx, "CreateEventTrigStmt"); + _fingerprintCreateEventTrigStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterEventTrigStmt: + _fingerprintString(ctx, "AlterEventTrigStmt"); + _fingerprintAlterEventTrigStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreatePLangStmt: + _fingerprintString(ctx, "CreatePLangStmt"); + _fingerprintCreatePLangStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateRoleStmt: + _fingerprintString(ctx, "CreateRoleStmt"); + _fingerprintCreateRoleStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterRoleStmt: + _fingerprintString(ctx, "AlterRoleStmt"); + _fingerprintAlterRoleStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterRoleSetStmt: + _fingerprintString(ctx, "AlterRoleSetStmt"); + _fingerprintAlterRoleSetStmt(ctx, obj, parent, field_name, depth); + break; +case T_DropRoleStmt: + _fingerprintString(ctx, "DropRoleStmt"); + _fingerprintDropRoleStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateSeqStmt: + _fingerprintString(ctx, "CreateSeqStmt"); + _fingerprintCreateSeqStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterSeqStmt: + _fingerprintString(ctx, "AlterSeqStmt"); + _fingerprintAlterSeqStmt(ctx, obj, parent, field_name, depth); + break; case T_DefineStmt: _fingerprintString(ctx, "DefineStmt"); _fingerprintDefineStmt(ctx, obj, parent, field_name, depth); break; +case T_CreateDomainStmt: + _fingerprintString(ctx, "CreateDomainStmt"); + _fingerprintCreateDomainStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateOpClassStmt: + _fingerprintString(ctx, "CreateOpClassStmt"); + _fingerprintCreateOpClassStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateOpClassItem: + _fingerprintString(ctx, "CreateOpClassItem"); + _fingerprintCreateOpClassItem(ctx, obj, parent, field_name, depth); + break; +case T_CreateOpFamilyStmt: + _fingerprintString(ctx, "CreateOpFamilyStmt"); + _fingerprintCreateOpFamilyStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterOpFamilyStmt: + _fingerprintString(ctx, "AlterOpFamilyStmt"); + _fingerprintAlterOpFamilyStmt(ctx, obj, parent, field_name, depth); + break; case T_DropStmt: _fingerprintString(ctx, "DropStmt"); _fingerprintDropStmt(ctx, obj, parent, field_name, depth); @@ -292,6 +702,18 @@ case T_CommentStmt: _fingerprintString(ctx, "CommentStmt"); _fingerprintCommentStmt(ctx, obj, parent, field_name, depth); break; +case T_SecLabelStmt: + _fingerprintString(ctx, "SecLabelStmt"); + _fingerprintSecLabelStmt(ctx, obj, parent, field_name, depth); + break; +case T_DeclareCursorStmt: + _fingerprintString(ctx, "DeclareCursorStmt"); + _fingerprintDeclareCursorStmt(ctx, obj, parent, field_name, depth); + break; +case T_ClosePortalStmt: + _fingerprintString(ctx, "ClosePortalStmt"); + _fingerprintClosePortalStmt(ctx, obj, parent, field_name, depth); + break; case T_FetchStmt: _fingerprintString(ctx, "FetchStmt"); _fingerprintFetchStmt(ctx, obj, parent, field_name, depth); @@ -300,10 +722,26 @@ case T_IndexStmt: _fingerprintString(ctx, "IndexStmt"); _fingerprintIndexStmt(ctx, obj, parent, field_name, depth); break; +case T_CreateStatsStmt: + _fingerprintString(ctx, "CreateStatsStmt"); + _fingerprintCreateStatsStmt(ctx, obj, parent, field_name, depth); + break; +case T_StatsElem: + _fingerprintString(ctx, "StatsElem"); + _fingerprintStatsElem(ctx, obj, parent, field_name, depth); + break; +case T_AlterStatsStmt: + _fingerprintString(ctx, "AlterStatsStmt"); + _fingerprintAlterStatsStmt(ctx, obj, parent, field_name, depth); + break; case T_CreateFunctionStmt: _fingerprintString(ctx, "CreateFunctionStmt"); _fingerprintCreateFunctionStmt(ctx, obj, parent, field_name, depth); break; +case T_FunctionParameter: + _fingerprintString(ctx, "FunctionParameter"); + _fingerprintFunctionParameter(ctx, obj, parent, field_name, depth); + break; case T_AlterFunctionStmt: _fingerprintString(ctx, "AlterFunctionStmt"); _fingerprintAlterFunctionStmt(ctx, obj, parent, field_name, depth); @@ -312,10 +750,42 @@ case T_DoStmt: _fingerprintString(ctx, "DoStmt"); _fingerprintDoStmt(ctx, obj, parent, field_name, depth); break; +case T_InlineCodeBlock: + _fingerprintString(ctx, "InlineCodeBlock"); + _fingerprintInlineCodeBlock(ctx, obj, parent, field_name, depth); + break; +case T_CallStmt: + _fingerprintString(ctx, "CallStmt"); + _fingerprintCallStmt(ctx, obj, parent, field_name, depth); + break; +case T_CallContext: + _fingerprintString(ctx, "CallContext"); + _fingerprintCallContext(ctx, obj, parent, field_name, depth); + break; case T_RenameStmt: _fingerprintString(ctx, "RenameStmt"); _fingerprintRenameStmt(ctx, obj, parent, field_name, depth); break; +case T_AlterObjectDependsStmt: + _fingerprintString(ctx, "AlterObjectDependsStmt"); + _fingerprintAlterObjectDependsStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterObjectSchemaStmt: + _fingerprintString(ctx, "AlterObjectSchemaStmt"); + _fingerprintAlterObjectSchemaStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterOwnerStmt: + _fingerprintString(ctx, "AlterOwnerStmt"); + _fingerprintAlterOwnerStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterOperatorStmt: + _fingerprintString(ctx, "AlterOperatorStmt"); + _fingerprintAlterOperatorStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterTypeStmt: + _fingerprintString(ctx, "AlterTypeStmt"); + _fingerprintAlterTypeStmt(ctx, obj, parent, field_name, depth); + break; case T_RuleStmt: _fingerprintString(ctx, "RuleStmt"); _fingerprintRuleStmt(ctx, obj, parent, field_name, depth); @@ -336,6 +806,22 @@ case T_TransactionStmt: _fingerprintString(ctx, "TransactionStmt"); _fingerprintTransactionStmt(ctx, obj, parent, field_name, depth); break; +case T_CompositeTypeStmt: + _fingerprintString(ctx, "CompositeTypeStmt"); + _fingerprintCompositeTypeStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateEnumStmt: + _fingerprintString(ctx, "CreateEnumStmt"); + _fingerprintCreateEnumStmt(ctx, obj, parent, field_name, depth); + break; +case T_CreateRangeStmt: + _fingerprintString(ctx, "CreateRangeStmt"); + _fingerprintCreateRangeStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterEnumStmt: + _fingerprintString(ctx, "AlterEnumStmt"); + _fingerprintAlterEnumStmt(ctx, obj, parent, field_name, depth); + break; case T_ViewStmt: _fingerprintString(ctx, "ViewStmt"); _fingerprintViewStmt(ctx, obj, parent, field_name, depth); @@ -344,22 +830,42 @@ case T_LoadStmt: _fingerprintString(ctx, "LoadStmt"); _fingerprintLoadStmt(ctx, obj, parent, field_name, depth); break; -case T_CreateDomainStmt: - _fingerprintString(ctx, "CreateDomainStmt"); - _fingerprintCreateDomainStmt(ctx, obj, parent, field_name, depth); - break; case T_CreatedbStmt: _fingerprintString(ctx, "CreatedbStmt"); _fingerprintCreatedbStmt(ctx, obj, parent, field_name, depth); break; +case T_AlterDatabaseStmt: + _fingerprintString(ctx, "AlterDatabaseStmt"); + _fingerprintAlterDatabaseStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterDatabaseRefreshCollStmt: + _fingerprintString(ctx, "AlterDatabaseRefreshCollStmt"); + _fingerprintAlterDatabaseRefreshCollStmt(ctx, obj, parent, field_name, depth); + break; +case T_AlterDatabaseSetStmt: + _fingerprintString(ctx, "AlterDatabaseSetStmt"); + _fingerprintAlterDatabaseSetStmt(ctx, obj, parent, field_name, depth); + break; case T_DropdbStmt: _fingerprintString(ctx, "DropdbStmt"); _fingerprintDropdbStmt(ctx, obj, parent, field_name, depth); break; +case T_AlterSystemStmt: + _fingerprintString(ctx, "AlterSystemStmt"); + _fingerprintAlterSystemStmt(ctx, obj, parent, field_name, depth); + break; +case T_ClusterStmt: + _fingerprintString(ctx, "ClusterStmt"); + _fingerprintClusterStmt(ctx, obj, parent, field_name, depth); + break; case T_VacuumStmt: _fingerprintString(ctx, "VacuumStmt"); _fingerprintVacuumStmt(ctx, obj, parent, field_name, depth); break; +case T_VacuumRelation: + _fingerprintString(ctx, "VacuumRelation"); + _fingerprintVacuumRelation(ctx, obj, parent, field_name, depth); + break; case T_ExplainStmt: _fingerprintString(ctx, "ExplainStmt"); _fingerprintExplainStmt(ctx, obj, parent, field_name, depth); @@ -368,46 +874,18 @@ case T_CreateTableAsStmt: _fingerprintString(ctx, "CreateTableAsStmt"); _fingerprintCreateTableAsStmt(ctx, obj, parent, field_name, depth); break; -case T_CreateSeqStmt: - _fingerprintString(ctx, "CreateSeqStmt"); - _fingerprintCreateSeqStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterSeqStmt: - _fingerprintString(ctx, "AlterSeqStmt"); - _fingerprintAlterSeqStmt(ctx, obj, parent, field_name, depth); - break; -case T_VariableSetStmt: - _fingerprintString(ctx, "VariableSetStmt"); - _fingerprintVariableSetStmt(ctx, obj, parent, field_name, depth); +case T_RefreshMatViewStmt: + _fingerprintString(ctx, "RefreshMatViewStmt"); + _fingerprintRefreshMatViewStmt(ctx, obj, parent, field_name, depth); break; -case T_VariableShowStmt: - _fingerprintString(ctx, "VariableShowStmt"); - _fingerprintVariableShowStmt(ctx, obj, parent, field_name, depth); +case T_CheckPointStmt: + _fingerprintString(ctx, "CheckPointStmt"); + _fingerprintCheckPointStmt(ctx, obj, parent, field_name, depth); break; case T_DiscardStmt: _fingerprintString(ctx, "DiscardStmt"); _fingerprintDiscardStmt(ctx, obj, parent, field_name, depth); break; -case T_CreateTrigStmt: - _fingerprintString(ctx, "CreateTrigStmt"); - _fingerprintCreateTrigStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreatePLangStmt: - _fingerprintString(ctx, "CreatePLangStmt"); - _fingerprintCreatePLangStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateRoleStmt: - _fingerprintString(ctx, "CreateRoleStmt"); - _fingerprintCreateRoleStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterRoleStmt: - _fingerprintString(ctx, "AlterRoleStmt"); - _fingerprintAlterRoleStmt(ctx, obj, parent, field_name, depth); - break; -case T_DropRoleStmt: - _fingerprintString(ctx, "DropRoleStmt"); - _fingerprintDropRoleStmt(ctx, obj, parent, field_name, depth); - break; case T_LockStmt: _fingerprintString(ctx, "LockStmt"); _fingerprintLockStmt(ctx, obj, parent, field_name, depth); @@ -420,30 +898,6 @@ case T_ReindexStmt: _fingerprintString(ctx, "ReindexStmt"); _fingerprintReindexStmt(ctx, obj, parent, field_name, depth); break; -case T_CheckPointStmt: - _fingerprintString(ctx, "CheckPointStmt"); - _fingerprintCheckPointStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateSchemaStmt: - _fingerprintString(ctx, "CreateSchemaStmt"); - _fingerprintCreateSchemaStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterDatabaseStmt: - _fingerprintString(ctx, "AlterDatabaseStmt"); - _fingerprintAlterDatabaseStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterDatabaseRefreshCollStmt: - _fingerprintString(ctx, "AlterDatabaseRefreshCollStmt"); - _fingerprintAlterDatabaseRefreshCollStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterDatabaseSetStmt: - _fingerprintString(ctx, "AlterDatabaseSetStmt"); - _fingerprintAlterDatabaseSetStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterRoleSetStmt: - _fingerprintString(ctx, "AlterRoleSetStmt"); - _fingerprintAlterRoleSetStmt(ctx, obj, parent, field_name, depth); - break; case T_CreateConversionStmt: _fingerprintString(ctx, "CreateConversionStmt"); _fingerprintCreateConversionStmt(ctx, obj, parent, field_name, depth); @@ -452,17 +906,9 @@ case T_CreateCastStmt: _fingerprintString(ctx, "CreateCastStmt"); _fingerprintCreateCastStmt(ctx, obj, parent, field_name, depth); break; -case T_CreateOpClassStmt: - _fingerprintString(ctx, "CreateOpClassStmt"); - _fingerprintCreateOpClassStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateOpFamilyStmt: - _fingerprintString(ctx, "CreateOpFamilyStmt"); - _fingerprintCreateOpFamilyStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterOpFamilyStmt: - _fingerprintString(ctx, "AlterOpFamilyStmt"); - _fingerprintAlterOpFamilyStmt(ctx, obj, parent, field_name, depth); +case T_CreateTransformStmt: + _fingerprintString(ctx, "CreateTransformStmt"); + _fingerprintCreateTransformStmt(ctx, obj, parent, field_name, depth); break; case T_PrepareStmt: _fingerprintString(ctx, "PrepareStmt"); @@ -476,38 +922,6 @@ case T_DeallocateStmt: _fingerprintString(ctx, "DeallocateStmt"); _fingerprintDeallocateStmt(ctx, obj, parent, field_name, depth); break; -case T_DeclareCursorStmt: - _fingerprintString(ctx, "DeclareCursorStmt"); - _fingerprintDeclareCursorStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateTableSpaceStmt: - _fingerprintString(ctx, "CreateTableSpaceStmt"); - _fingerprintCreateTableSpaceStmt(ctx, obj, parent, field_name, depth); - break; -case T_DropTableSpaceStmt: - _fingerprintString(ctx, "DropTableSpaceStmt"); - _fingerprintDropTableSpaceStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterObjectDependsStmt: - _fingerprintString(ctx, "AlterObjectDependsStmt"); - _fingerprintAlterObjectDependsStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterObjectSchemaStmt: - _fingerprintString(ctx, "AlterObjectSchemaStmt"); - _fingerprintAlterObjectSchemaStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterOwnerStmt: - _fingerprintString(ctx, "AlterOwnerStmt"); - _fingerprintAlterOwnerStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterOperatorStmt: - _fingerprintString(ctx, "AlterOperatorStmt"); - _fingerprintAlterOperatorStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterTypeStmt: - _fingerprintString(ctx, "AlterTypeStmt"); - _fingerprintAlterTypeStmt(ctx, obj, parent, field_name, depth); - break; case T_DropOwnedStmt: _fingerprintString(ctx, "DropOwnedStmt"); _fingerprintDropOwnedStmt(ctx, obj, parent, field_name, depth); @@ -516,22 +930,6 @@ case T_ReassignOwnedStmt: _fingerprintString(ctx, "ReassignOwnedStmt"); _fingerprintReassignOwnedStmt(ctx, obj, parent, field_name, depth); break; -case T_CompositeTypeStmt: - _fingerprintString(ctx, "CompositeTypeStmt"); - _fingerprintCompositeTypeStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateEnumStmt: - _fingerprintString(ctx, "CreateEnumStmt"); - _fingerprintCreateEnumStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateRangeStmt: - _fingerprintString(ctx, "CreateRangeStmt"); - _fingerprintCreateRangeStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterEnumStmt: - _fingerprintString(ctx, "AlterEnumStmt"); - _fingerprintAlterEnumStmt(ctx, obj, parent, field_name, depth); - break; case T_AlterTSDictionaryStmt: _fingerprintString(ctx, "AlterTSDictionaryStmt"); _fingerprintAlterTSDictionaryStmt(ctx, obj, parent, field_name, depth); @@ -540,101 +938,13 @@ case T_AlterTSConfigurationStmt: _fingerprintString(ctx, "AlterTSConfigurationStmt"); _fingerprintAlterTSConfigurationStmt(ctx, obj, parent, field_name, depth); break; -case T_CreateFdwStmt: - _fingerprintString(ctx, "CreateFdwStmt"); - _fingerprintCreateFdwStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterFdwStmt: - _fingerprintString(ctx, "AlterFdwStmt"); - _fingerprintAlterFdwStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateForeignServerStmt: - _fingerprintString(ctx, "CreateForeignServerStmt"); - _fingerprintCreateForeignServerStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterForeignServerStmt: - _fingerprintString(ctx, "AlterForeignServerStmt"); - _fingerprintAlterForeignServerStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateUserMappingStmt: - _fingerprintString(ctx, "CreateUserMappingStmt"); - _fingerprintCreateUserMappingStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterUserMappingStmt: - _fingerprintString(ctx, "AlterUserMappingStmt"); - _fingerprintAlterUserMappingStmt(ctx, obj, parent, field_name, depth); - break; -case T_DropUserMappingStmt: - _fingerprintString(ctx, "DropUserMappingStmt"); - _fingerprintDropUserMappingStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterTableSpaceOptionsStmt: - _fingerprintString(ctx, "AlterTableSpaceOptionsStmt"); - _fingerprintAlterTableSpaceOptionsStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterTableMoveAllStmt: - _fingerprintString(ctx, "AlterTableMoveAllStmt"); - _fingerprintAlterTableMoveAllStmt(ctx, obj, parent, field_name, depth); - break; -case T_SecLabelStmt: - _fingerprintString(ctx, "SecLabelStmt"); - _fingerprintSecLabelStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateForeignTableStmt: - _fingerprintString(ctx, "CreateForeignTableStmt"); - _fingerprintCreateForeignTableStmt(ctx, obj, parent, field_name, depth); - break; -case T_ImportForeignSchemaStmt: - _fingerprintString(ctx, "ImportForeignSchemaStmt"); - _fingerprintImportForeignSchemaStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateExtensionStmt: - _fingerprintString(ctx, "CreateExtensionStmt"); - _fingerprintCreateExtensionStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterExtensionStmt: - _fingerprintString(ctx, "AlterExtensionStmt"); - _fingerprintAlterExtensionStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterExtensionContentsStmt: - _fingerprintString(ctx, "AlterExtensionContentsStmt"); - _fingerprintAlterExtensionContentsStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateEventTrigStmt: - _fingerprintString(ctx, "CreateEventTrigStmt"); - _fingerprintCreateEventTrigStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterEventTrigStmt: - _fingerprintString(ctx, "AlterEventTrigStmt"); - _fingerprintAlterEventTrigStmt(ctx, obj, parent, field_name, depth); - break; -case T_RefreshMatViewStmt: - _fingerprintString(ctx, "RefreshMatViewStmt"); - _fingerprintRefreshMatViewStmt(ctx, obj, parent, field_name, depth); - break; -case T_ReplicaIdentityStmt: - _fingerprintString(ctx, "ReplicaIdentityStmt"); - _fingerprintReplicaIdentityStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterSystemStmt: - _fingerprintString(ctx, "AlterSystemStmt"); - _fingerprintAlterSystemStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreatePolicyStmt: - _fingerprintString(ctx, "CreatePolicyStmt"); - _fingerprintCreatePolicyStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterPolicyStmt: - _fingerprintString(ctx, "AlterPolicyStmt"); - _fingerprintAlterPolicyStmt(ctx, obj, parent, field_name, depth); - break; -case T_CreateTransformStmt: - _fingerprintString(ctx, "CreateTransformStmt"); - _fingerprintCreateTransformStmt(ctx, obj, parent, field_name, depth); +case T_PublicationTable: + _fingerprintString(ctx, "PublicationTable"); + _fingerprintPublicationTable(ctx, obj, parent, field_name, depth); break; -case T_CreateAmStmt: - _fingerprintString(ctx, "CreateAmStmt"); - _fingerprintCreateAmStmt(ctx, obj, parent, field_name, depth); +case T_PublicationObjSpec: + _fingerprintString(ctx, "PublicationObjSpec"); + _fingerprintPublicationObjSpec(ctx, obj, parent, field_name, depth); break; case T_CreatePublicationStmt: _fingerprintString(ctx, "CreatePublicationStmt"); @@ -656,257 +966,3 @@ case T_DropSubscriptionStmt: _fingerprintString(ctx, "DropSubscriptionStmt"); _fingerprintDropSubscriptionStmt(ctx, obj, parent, field_name, depth); break; -case T_CreateStatsStmt: - _fingerprintString(ctx, "CreateStatsStmt"); - _fingerprintCreateStatsStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterCollationStmt: - _fingerprintString(ctx, "AlterCollationStmt"); - _fingerprintAlterCollationStmt(ctx, obj, parent, field_name, depth); - break; -case T_CallStmt: - _fingerprintString(ctx, "CallStmt"); - _fingerprintCallStmt(ctx, obj, parent, field_name, depth); - break; -case T_AlterStatsStmt: - _fingerprintString(ctx, "AlterStatsStmt"); - _fingerprintAlterStatsStmt(ctx, obj, parent, field_name, depth); - break; -case T_A_Expr: - _fingerprintString(ctx, "A_Expr"); - _fingerprintA_Expr(ctx, obj, parent, field_name, depth); - break; -case T_ColumnRef: - _fingerprintString(ctx, "ColumnRef"); - _fingerprintColumnRef(ctx, obj, parent, field_name, depth); - break; -case T_ParamRef: - // Intentionally ignoring for fingerprinting - break; -case T_FuncCall: - _fingerprintString(ctx, "FuncCall"); - _fingerprintFuncCall(ctx, obj, parent, field_name, depth); - break; -case T_A_Star: - _fingerprintString(ctx, "A_Star"); - _fingerprintA_Star(ctx, obj, parent, field_name, depth); - break; -case T_A_Indices: - _fingerprintString(ctx, "A_Indices"); - _fingerprintA_Indices(ctx, obj, parent, field_name, depth); - break; -case T_A_Indirection: - _fingerprintString(ctx, "A_Indirection"); - _fingerprintA_Indirection(ctx, obj, parent, field_name, depth); - break; -case T_A_ArrayExpr: - _fingerprintString(ctx, "A_ArrayExpr"); - _fingerprintA_ArrayExpr(ctx, obj, parent, field_name, depth); - break; -case T_ResTarget: - _fingerprintString(ctx, "ResTarget"); - _fingerprintResTarget(ctx, obj, parent, field_name, depth); - break; -case T_MultiAssignRef: - _fingerprintString(ctx, "MultiAssignRef"); - _fingerprintMultiAssignRef(ctx, obj, parent, field_name, depth); - break; -case T_TypeCast: - if (!IsA(castNode(TypeCast, (void*) obj)->arg, A_Const) && !IsA(castNode(TypeCast, (void*) obj)->arg, ParamRef)) - { - _fingerprintString(ctx, "TypeCast"); - _fingerprintTypeCast(ctx, obj, parent, field_name, depth); - } - break; -case T_CollateClause: - _fingerprintString(ctx, "CollateClause"); - _fingerprintCollateClause(ctx, obj, parent, field_name, depth); - break; -case T_SortBy: - _fingerprintString(ctx, "SortBy"); - _fingerprintSortBy(ctx, obj, parent, field_name, depth); - break; -case T_WindowDef: - _fingerprintString(ctx, "WindowDef"); - _fingerprintWindowDef(ctx, obj, parent, field_name, depth); - break; -case T_RangeSubselect: - _fingerprintString(ctx, "RangeSubselect"); - _fingerprintRangeSubselect(ctx, obj, parent, field_name, depth); - break; -case T_RangeFunction: - _fingerprintString(ctx, "RangeFunction"); - _fingerprintRangeFunction(ctx, obj, parent, field_name, depth); - break; -case T_RangeTableSample: - _fingerprintString(ctx, "RangeTableSample"); - _fingerprintRangeTableSample(ctx, obj, parent, field_name, depth); - break; -case T_RangeTableFunc: - _fingerprintString(ctx, "RangeTableFunc"); - _fingerprintRangeTableFunc(ctx, obj, parent, field_name, depth); - break; -case T_RangeTableFuncCol: - _fingerprintString(ctx, "RangeTableFuncCol"); - _fingerprintRangeTableFuncCol(ctx, obj, parent, field_name, depth); - break; -case T_TypeName: - _fingerprintString(ctx, "TypeName"); - _fingerprintTypeName(ctx, obj, parent, field_name, depth); - break; -case T_ColumnDef: - _fingerprintString(ctx, "ColumnDef"); - _fingerprintColumnDef(ctx, obj, parent, field_name, depth); - break; -case T_IndexElem: - _fingerprintString(ctx, "IndexElem"); - _fingerprintIndexElem(ctx, obj, parent, field_name, depth); - break; -case T_StatsElem: - _fingerprintString(ctx, "StatsElem"); - _fingerprintStatsElem(ctx, obj, parent, field_name, depth); - break; -case T_Constraint: - _fingerprintString(ctx, "Constraint"); - _fingerprintConstraint(ctx, obj, parent, field_name, depth); - break; -case T_DefElem: - _fingerprintString(ctx, "DefElem"); - _fingerprintDefElem(ctx, obj, parent, field_name, depth); - break; -case T_RangeTblEntry: - _fingerprintString(ctx, "RangeTblEntry"); - _fingerprintRangeTblEntry(ctx, obj, parent, field_name, depth); - break; -case T_RangeTblFunction: - _fingerprintString(ctx, "RangeTblFunction"); - _fingerprintRangeTblFunction(ctx, obj, parent, field_name, depth); - break; -case T_TableSampleClause: - _fingerprintString(ctx, "TableSampleClause"); - _fingerprintTableSampleClause(ctx, obj, parent, field_name, depth); - break; -case T_WithCheckOption: - _fingerprintString(ctx, "WithCheckOption"); - _fingerprintWithCheckOption(ctx, obj, parent, field_name, depth); - break; -case T_SortGroupClause: - _fingerprintString(ctx, "SortGroupClause"); - _fingerprintSortGroupClause(ctx, obj, parent, field_name, depth); - break; -case T_GroupingSet: - _fingerprintString(ctx, "GroupingSet"); - _fingerprintGroupingSet(ctx, obj, parent, field_name, depth); - break; -case T_WindowClause: - _fingerprintString(ctx, "WindowClause"); - _fingerprintWindowClause(ctx, obj, parent, field_name, depth); - break; -case T_ObjectWithArgs: - _fingerprintString(ctx, "ObjectWithArgs"); - _fingerprintObjectWithArgs(ctx, obj, parent, field_name, depth); - break; -case T_AccessPriv: - _fingerprintString(ctx, "AccessPriv"); - _fingerprintAccessPriv(ctx, obj, parent, field_name, depth); - break; -case T_CreateOpClassItem: - _fingerprintString(ctx, "CreateOpClassItem"); - _fingerprintCreateOpClassItem(ctx, obj, parent, field_name, depth); - break; -case T_TableLikeClause: - _fingerprintString(ctx, "TableLikeClause"); - _fingerprintTableLikeClause(ctx, obj, parent, field_name, depth); - break; -case T_FunctionParameter: - _fingerprintString(ctx, "FunctionParameter"); - _fingerprintFunctionParameter(ctx, obj, parent, field_name, depth); - break; -case T_LockingClause: - _fingerprintString(ctx, "LockingClause"); - _fingerprintLockingClause(ctx, obj, parent, field_name, depth); - break; -case T_RowMarkClause: - _fingerprintString(ctx, "RowMarkClause"); - _fingerprintRowMarkClause(ctx, obj, parent, field_name, depth); - break; -case T_XmlSerialize: - _fingerprintString(ctx, "XmlSerialize"); - _fingerprintXmlSerialize(ctx, obj, parent, field_name, depth); - break; -case T_WithClause: - _fingerprintString(ctx, "WithClause"); - _fingerprintWithClause(ctx, obj, parent, field_name, depth); - break; -case T_InferClause: - _fingerprintString(ctx, "InferClause"); - _fingerprintInferClause(ctx, obj, parent, field_name, depth); - break; -case T_OnConflictClause: - _fingerprintString(ctx, "OnConflictClause"); - _fingerprintOnConflictClause(ctx, obj, parent, field_name, depth); - break; -case T_CTESearchClause: - _fingerprintString(ctx, "CTESearchClause"); - _fingerprintCTESearchClause(ctx, obj, parent, field_name, depth); - break; -case T_CTECycleClause: - _fingerprintString(ctx, "CTECycleClause"); - _fingerprintCTECycleClause(ctx, obj, parent, field_name, depth); - break; -case T_CommonTableExpr: - _fingerprintString(ctx, "CommonTableExpr"); - _fingerprintCommonTableExpr(ctx, obj, parent, field_name, depth); - break; -case T_MergeWhenClause: - _fingerprintString(ctx, "MergeWhenClause"); - _fingerprintMergeWhenClause(ctx, obj, parent, field_name, depth); - break; -case T_RoleSpec: - _fingerprintString(ctx, "RoleSpec"); - _fingerprintRoleSpec(ctx, obj, parent, field_name, depth); - break; -case T_TriggerTransition: - _fingerprintString(ctx, "TriggerTransition"); - _fingerprintTriggerTransition(ctx, obj, parent, field_name, depth); - break; -case T_PartitionElem: - _fingerprintString(ctx, "PartitionElem"); - _fingerprintPartitionElem(ctx, obj, parent, field_name, depth); - break; -case T_PartitionSpec: - _fingerprintString(ctx, "PartitionSpec"); - _fingerprintPartitionSpec(ctx, obj, parent, field_name, depth); - break; -case T_PartitionBoundSpec: - _fingerprintString(ctx, "PartitionBoundSpec"); - _fingerprintPartitionBoundSpec(ctx, obj, parent, field_name, depth); - break; -case T_PartitionRangeDatum: - _fingerprintString(ctx, "PartitionRangeDatum"); - _fingerprintPartitionRangeDatum(ctx, obj, parent, field_name, depth); - break; -case T_PartitionCmd: - _fingerprintString(ctx, "PartitionCmd"); - _fingerprintPartitionCmd(ctx, obj, parent, field_name, depth); - break; -case T_VacuumRelation: - _fingerprintString(ctx, "VacuumRelation"); - _fingerprintVacuumRelation(ctx, obj, parent, field_name, depth); - break; -case T_PublicationObjSpec: - _fingerprintString(ctx, "PublicationObjSpec"); - _fingerprintPublicationObjSpec(ctx, obj, parent, field_name, depth); - break; -case T_PublicationTable: - _fingerprintString(ctx, "PublicationTable"); - _fingerprintPublicationTable(ctx, obj, parent, field_name, depth); - break; -case T_InlineCodeBlock: - _fingerprintString(ctx, "InlineCodeBlock"); - _fingerprintInlineCodeBlock(ctx, obj, parent, field_name, depth); - break; -case T_CallContext: - _fingerprintString(ctx, "CallContext"); - _fingerprintCallContext(ctx, obj, parent, field_name, depth); - break; diff --git a/src/pg_query_fingerprint_defs.c b/src/pg_query_fingerprint_defs.c index c8fee7e1..0837af60 100644 --- a/src/pg_query_fingerprint_defs.c +++ b/src/pg_query_fingerprint_defs.c @@ -1,6 +1,7 @@ static void _fingerprintAlias(FingerprintContext *ctx, const Alias *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintRangeVar(FingerprintContext *ctx, const RangeVar *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintTableFunc(FingerprintContext *ctx, const TableFunc *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintIntoClause(FingerprintContext *ctx, const IntoClause *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintVar(FingerprintContext *ctx, const Var *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintConst(FingerprintContext *ctx, const Const *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintParam(FingerprintContext *ctx, const Param *node, const void *parent, const char *field_name, unsigned int depth); @@ -33,6 +34,11 @@ static void _fingerprintCoalesceExpr(FingerprintContext *ctx, const CoalesceExpr static void _fingerprintMinMaxExpr(FingerprintContext *ctx, const MinMaxExpr *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintSQLValueFunction(FingerprintContext *ctx, const SQLValueFunction *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintXmlExpr(FingerprintContext *ctx, const XmlExpr *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonFormat(FingerprintContext *ctx, const JsonFormat *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonReturning(FingerprintContext *ctx, const JsonReturning *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonValueExpr(FingerprintContext *ctx, const JsonValueExpr *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonConstructorExpr(FingerprintContext *ctx, const JsonConstructorExpr *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonIsPredicate(FingerprintContext *ctx, const JsonIsPredicate *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintNullTest(FingerprintContext *ctx, const NullTest *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintBooleanTest(FingerprintContext *ctx, const BooleanTest *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCoerceToDomain(FingerprintContext *ctx, const CoerceToDomain *node, const void *parent, const char *field_name, unsigned int depth); @@ -46,186 +52,194 @@ static void _fingerprintRangeTblRef(FingerprintContext *ctx, const RangeTblRef * static void _fingerprintJoinExpr(FingerprintContext *ctx, const JoinExpr *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintFromExpr(FingerprintContext *ctx, const FromExpr *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintOnConflictExpr(FingerprintContext *ctx, const OnConflictExpr *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintIntoClause(FingerprintContext *ctx, const IntoClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintTypeName(FingerprintContext *ctx, const TypeName *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintColumnRef(FingerprintContext *ctx, const ColumnRef *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintParamRef(FingerprintContext *ctx, const ParamRef *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintA_Expr(FingerprintContext *ctx, const A_Expr *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintTypeCast(FingerprintContext *ctx, const TypeCast *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCollateClause(FingerprintContext *ctx, const CollateClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRoleSpec(FingerprintContext *ctx, const RoleSpec *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintFuncCall(FingerprintContext *ctx, const FuncCall *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintA_Star(FingerprintContext *ctx, const A_Star *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintA_Indices(FingerprintContext *ctx, const A_Indices *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintA_Indirection(FingerprintContext *ctx, const A_Indirection *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintA_ArrayExpr(FingerprintContext *ctx, const A_ArrayExpr *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintResTarget(FingerprintContext *ctx, const ResTarget *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintMultiAssignRef(FingerprintContext *ctx, const MultiAssignRef *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintSortBy(FingerprintContext *ctx, const SortBy *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintWindowDef(FingerprintContext *ctx, const WindowDef *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRangeSubselect(FingerprintContext *ctx, const RangeSubselect *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRangeFunction(FingerprintContext *ctx, const RangeFunction *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRangeTableFunc(FingerprintContext *ctx, const RangeTableFunc *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRangeTableFuncCol(FingerprintContext *ctx, const RangeTableFuncCol *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRangeTableSample(FingerprintContext *ctx, const RangeTableSample *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintColumnDef(FingerprintContext *ctx, const ColumnDef *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintTableLikeClause(FingerprintContext *ctx, const TableLikeClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintIndexElem(FingerprintContext *ctx, const IndexElem *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintDefElem(FingerprintContext *ctx, const DefElem *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintLockingClause(FingerprintContext *ctx, const LockingClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintXmlSerialize(FingerprintContext *ctx, const XmlSerialize *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintPartitionElem(FingerprintContext *ctx, const PartitionElem *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintPartitionSpec(FingerprintContext *ctx, const PartitionSpec *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintPartitionBoundSpec(FingerprintContext *ctx, const PartitionBoundSpec *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintPartitionRangeDatum(FingerprintContext *ctx, const PartitionRangeDatum *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintPartitionCmd(FingerprintContext *ctx, const PartitionCmd *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRangeTblEntry(FingerprintContext *ctx, const RangeTblEntry *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRTEPermissionInfo(FingerprintContext *ctx, const RTEPermissionInfo *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRangeTblFunction(FingerprintContext *ctx, const RangeTblFunction *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintTableSampleClause(FingerprintContext *ctx, const TableSampleClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintWithCheckOption(FingerprintContext *ctx, const WithCheckOption *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintSortGroupClause(FingerprintContext *ctx, const SortGroupClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintGroupingSet(FingerprintContext *ctx, const GroupingSet *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintWindowClause(FingerprintContext *ctx, const WindowClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRowMarkClause(FingerprintContext *ctx, const RowMarkClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintWithClause(FingerprintContext *ctx, const WithClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintInferClause(FingerprintContext *ctx, const InferClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintOnConflictClause(FingerprintContext *ctx, const OnConflictClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCTESearchClause(FingerprintContext *ctx, const CTESearchClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCTECycleClause(FingerprintContext *ctx, const CTECycleClause *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCommonTableExpr(FingerprintContext *ctx, const CommonTableExpr *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintMergeWhenClause(FingerprintContext *ctx, const MergeWhenClause *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintMergeAction(FingerprintContext *ctx, const MergeAction *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintTriggerTransition(FingerprintContext *ctx, const TriggerTransition *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonOutput(FingerprintContext *ctx, const JsonOutput *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonKeyValue(FingerprintContext *ctx, const JsonKeyValue *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonObjectConstructor(FingerprintContext *ctx, const JsonObjectConstructor *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonArrayConstructor(FingerprintContext *ctx, const JsonArrayConstructor *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonArrayQueryConstructor(FingerprintContext *ctx, const JsonArrayQueryConstructor *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonAggConstructor(FingerprintContext *ctx, const JsonAggConstructor *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonObjectAgg(FingerprintContext *ctx, const JsonObjectAgg *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintJsonArrayAgg(FingerprintContext *ctx, const JsonArrayAgg *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintRawStmt(FingerprintContext *ctx, const RawStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintInsertStmt(FingerprintContext *ctx, const InsertStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintDeleteStmt(FingerprintContext *ctx, const DeleteStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintUpdateStmt(FingerprintContext *ctx, const UpdateStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintMergeStmt(FingerprintContext *ctx, const MergeStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintSetOperationStmt(FingerprintContext *ctx, const SetOperationStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintReturnStmt(FingerprintContext *ctx, const ReturnStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintPLAssignStmt(FingerprintContext *ctx, const PLAssignStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateSchemaStmt(FingerprintContext *ctx, const CreateSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintAlterTableStmt(FingerprintContext *ctx, const AlterTableStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintReplicaIdentityStmt(FingerprintContext *ctx, const ReplicaIdentityStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintAlterTableCmd(FingerprintContext *ctx, const AlterTableCmd *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterCollationStmt(FingerprintContext *ctx, const AlterCollationStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintAlterDomainStmt(FingerprintContext *ctx, const AlterDomainStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintSetOperationStmt(FingerprintContext *ctx, const SetOperationStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintGrantStmt(FingerprintContext *ctx, const GrantStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintObjectWithArgs(FingerprintContext *ctx, const ObjectWithArgs *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAccessPriv(FingerprintContext *ctx, const AccessPriv *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintGrantRoleStmt(FingerprintContext *ctx, const GrantRoleStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintAlterDefaultPrivilegesStmt(FingerprintContext *ctx, const AlterDefaultPrivilegesStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintClosePortalStmt(FingerprintContext *ctx, const ClosePortalStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintClusterStmt(FingerprintContext *ctx, const ClusterStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCopyStmt(FingerprintContext *ctx, const CopyStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintVariableSetStmt(FingerprintContext *ctx, const VariableSetStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintVariableShowStmt(FingerprintContext *ctx, const VariableShowStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCreateStmt(FingerprintContext *ctx, const CreateStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintConstraint(FingerprintContext *ctx, const Constraint *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateTableSpaceStmt(FingerprintContext *ctx, const CreateTableSpaceStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintDropTableSpaceStmt(FingerprintContext *ctx, const DropTableSpaceStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterTableSpaceOptionsStmt(FingerprintContext *ctx, const AlterTableSpaceOptionsStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterTableMoveAllStmt(FingerprintContext *ctx, const AlterTableMoveAllStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateExtensionStmt(FingerprintContext *ctx, const CreateExtensionStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterExtensionStmt(FingerprintContext *ctx, const AlterExtensionStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterExtensionContentsStmt(FingerprintContext *ctx, const AlterExtensionContentsStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateFdwStmt(FingerprintContext *ctx, const CreateFdwStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterFdwStmt(FingerprintContext *ctx, const AlterFdwStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateForeignServerStmt(FingerprintContext *ctx, const CreateForeignServerStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterForeignServerStmt(FingerprintContext *ctx, const AlterForeignServerStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateForeignTableStmt(FingerprintContext *ctx, const CreateForeignTableStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateUserMappingStmt(FingerprintContext *ctx, const CreateUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterUserMappingStmt(FingerprintContext *ctx, const AlterUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintDropUserMappingStmt(FingerprintContext *ctx, const DropUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintImportForeignSchemaStmt(FingerprintContext *ctx, const ImportForeignSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreatePolicyStmt(FingerprintContext *ctx, const CreatePolicyStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterPolicyStmt(FingerprintContext *ctx, const AlterPolicyStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateAmStmt(FingerprintContext *ctx, const CreateAmStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateTrigStmt(FingerprintContext *ctx, const CreateTrigStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateEventTrigStmt(FingerprintContext *ctx, const CreateEventTrigStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterEventTrigStmt(FingerprintContext *ctx, const AlterEventTrigStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreatePLangStmt(FingerprintContext *ctx, const CreatePLangStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateRoleStmt(FingerprintContext *ctx, const CreateRoleStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterRoleStmt(FingerprintContext *ctx, const AlterRoleStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterRoleSetStmt(FingerprintContext *ctx, const AlterRoleSetStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintDropRoleStmt(FingerprintContext *ctx, const DropRoleStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateSeqStmt(FingerprintContext *ctx, const CreateSeqStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterSeqStmt(FingerprintContext *ctx, const AlterSeqStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintDefineStmt(FingerprintContext *ctx, const DefineStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateDomainStmt(FingerprintContext *ctx, const CreateDomainStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateOpClassStmt(FingerprintContext *ctx, const CreateOpClassStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateOpClassItem(FingerprintContext *ctx, const CreateOpClassItem *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateOpFamilyStmt(FingerprintContext *ctx, const CreateOpFamilyStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterOpFamilyStmt(FingerprintContext *ctx, const AlterOpFamilyStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintDropStmt(FingerprintContext *ctx, const DropStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintTruncateStmt(FingerprintContext *ctx, const TruncateStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCommentStmt(FingerprintContext *ctx, const CommentStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintSecLabelStmt(FingerprintContext *ctx, const SecLabelStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintDeclareCursorStmt(FingerprintContext *ctx, const DeclareCursorStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintClosePortalStmt(FingerprintContext *ctx, const ClosePortalStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintFetchStmt(FingerprintContext *ctx, const FetchStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintIndexStmt(FingerprintContext *ctx, const IndexStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateStatsStmt(FingerprintContext *ctx, const CreateStatsStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintStatsElem(FingerprintContext *ctx, const StatsElem *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterStatsStmt(FingerprintContext *ctx, const AlterStatsStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCreateFunctionStmt(FingerprintContext *ctx, const CreateFunctionStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintFunctionParameter(FingerprintContext *ctx, const FunctionParameter *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintAlterFunctionStmt(FingerprintContext *ctx, const AlterFunctionStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintDoStmt(FingerprintContext *ctx, const DoStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintInlineCodeBlock(FingerprintContext *ctx, const InlineCodeBlock *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCallStmt(FingerprintContext *ctx, const CallStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCallContext(FingerprintContext *ctx, const CallContext *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintRenameStmt(FingerprintContext *ctx, const RenameStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterObjectDependsStmt(FingerprintContext *ctx, const AlterObjectDependsStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterObjectSchemaStmt(FingerprintContext *ctx, const AlterObjectSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterOwnerStmt(FingerprintContext *ctx, const AlterOwnerStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterOperatorStmt(FingerprintContext *ctx, const AlterOperatorStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterTypeStmt(FingerprintContext *ctx, const AlterTypeStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintRuleStmt(FingerprintContext *ctx, const RuleStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintNotifyStmt(FingerprintContext *ctx, const NotifyStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintListenStmt(FingerprintContext *ctx, const ListenStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintUnlistenStmt(FingerprintContext *ctx, const UnlistenStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintTransactionStmt(FingerprintContext *ctx, const TransactionStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCompositeTypeStmt(FingerprintContext *ctx, const CompositeTypeStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateEnumStmt(FingerprintContext *ctx, const CreateEnumStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateRangeStmt(FingerprintContext *ctx, const CreateRangeStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterEnumStmt(FingerprintContext *ctx, const AlterEnumStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintViewStmt(FingerprintContext *ctx, const ViewStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintLoadStmt(FingerprintContext *ctx, const LoadStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateDomainStmt(FingerprintContext *ctx, const CreateDomainStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCreatedbStmt(FingerprintContext *ctx, const CreatedbStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterDatabaseStmt(FingerprintContext *ctx, const AlterDatabaseStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterDatabaseRefreshCollStmt(FingerprintContext *ctx, const AlterDatabaseRefreshCollStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterDatabaseSetStmt(FingerprintContext *ctx, const AlterDatabaseSetStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintDropdbStmt(FingerprintContext *ctx, const DropdbStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintAlterSystemStmt(FingerprintContext *ctx, const AlterSystemStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintClusterStmt(FingerprintContext *ctx, const ClusterStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintVacuumStmt(FingerprintContext *ctx, const VacuumStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintVacuumRelation(FingerprintContext *ctx, const VacuumRelation *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintExplainStmt(FingerprintContext *ctx, const ExplainStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCreateTableAsStmt(FingerprintContext *ctx, const CreateTableAsStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateSeqStmt(FingerprintContext *ctx, const CreateSeqStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterSeqStmt(FingerprintContext *ctx, const AlterSeqStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintVariableSetStmt(FingerprintContext *ctx, const VariableSetStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintVariableShowStmt(FingerprintContext *ctx, const VariableShowStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintRefreshMatViewStmt(FingerprintContext *ctx, const RefreshMatViewStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCheckPointStmt(FingerprintContext *ctx, const CheckPointStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintDiscardStmt(FingerprintContext *ctx, const DiscardStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateTrigStmt(FingerprintContext *ctx, const CreateTrigStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreatePLangStmt(FingerprintContext *ctx, const CreatePLangStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateRoleStmt(FingerprintContext *ctx, const CreateRoleStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterRoleStmt(FingerprintContext *ctx, const AlterRoleStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintDropRoleStmt(FingerprintContext *ctx, const DropRoleStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintLockStmt(FingerprintContext *ctx, const LockStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintConstraintsSetStmt(FingerprintContext *ctx, const ConstraintsSetStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintReindexStmt(FingerprintContext *ctx, const ReindexStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCheckPointStmt(FingerprintContext *ctx, const CheckPointStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateSchemaStmt(FingerprintContext *ctx, const CreateSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterDatabaseStmt(FingerprintContext *ctx, const AlterDatabaseStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterDatabaseRefreshCollStmt(FingerprintContext *ctx, const AlterDatabaseRefreshCollStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterDatabaseSetStmt(FingerprintContext *ctx, const AlterDatabaseSetStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterRoleSetStmt(FingerprintContext *ctx, const AlterRoleSetStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCreateConversionStmt(FingerprintContext *ctx, const CreateConversionStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCreateCastStmt(FingerprintContext *ctx, const CreateCastStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateOpClassStmt(FingerprintContext *ctx, const CreateOpClassStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateOpFamilyStmt(FingerprintContext *ctx, const CreateOpFamilyStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterOpFamilyStmt(FingerprintContext *ctx, const AlterOpFamilyStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintCreateTransformStmt(FingerprintContext *ctx, const CreateTransformStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintPrepareStmt(FingerprintContext *ctx, const PrepareStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintExecuteStmt(FingerprintContext *ctx, const ExecuteStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintDeallocateStmt(FingerprintContext *ctx, const DeallocateStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintDeclareCursorStmt(FingerprintContext *ctx, const DeclareCursorStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateTableSpaceStmt(FingerprintContext *ctx, const CreateTableSpaceStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintDropTableSpaceStmt(FingerprintContext *ctx, const DropTableSpaceStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterObjectDependsStmt(FingerprintContext *ctx, const AlterObjectDependsStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterObjectSchemaStmt(FingerprintContext *ctx, const AlterObjectSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterOwnerStmt(FingerprintContext *ctx, const AlterOwnerStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterOperatorStmt(FingerprintContext *ctx, const AlterOperatorStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterTypeStmt(FingerprintContext *ctx, const AlterTypeStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintDropOwnedStmt(FingerprintContext *ctx, const DropOwnedStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintReassignOwnedStmt(FingerprintContext *ctx, const ReassignOwnedStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCompositeTypeStmt(FingerprintContext *ctx, const CompositeTypeStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateEnumStmt(FingerprintContext *ctx, const CreateEnumStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateRangeStmt(FingerprintContext *ctx, const CreateRangeStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterEnumStmt(FingerprintContext *ctx, const AlterEnumStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintAlterTSDictionaryStmt(FingerprintContext *ctx, const AlterTSDictionaryStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintAlterTSConfigurationStmt(FingerprintContext *ctx, const AlterTSConfigurationStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateFdwStmt(FingerprintContext *ctx, const CreateFdwStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterFdwStmt(FingerprintContext *ctx, const AlterFdwStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateForeignServerStmt(FingerprintContext *ctx, const CreateForeignServerStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterForeignServerStmt(FingerprintContext *ctx, const AlterForeignServerStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateUserMappingStmt(FingerprintContext *ctx, const CreateUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterUserMappingStmt(FingerprintContext *ctx, const AlterUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintDropUserMappingStmt(FingerprintContext *ctx, const DropUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterTableSpaceOptionsStmt(FingerprintContext *ctx, const AlterTableSpaceOptionsStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterTableMoveAllStmt(FingerprintContext *ctx, const AlterTableMoveAllStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintSecLabelStmt(FingerprintContext *ctx, const SecLabelStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateForeignTableStmt(FingerprintContext *ctx, const CreateForeignTableStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintImportForeignSchemaStmt(FingerprintContext *ctx, const ImportForeignSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateExtensionStmt(FingerprintContext *ctx, const CreateExtensionStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterExtensionStmt(FingerprintContext *ctx, const AlterExtensionStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterExtensionContentsStmt(FingerprintContext *ctx, const AlterExtensionContentsStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateEventTrigStmt(FingerprintContext *ctx, const CreateEventTrigStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterEventTrigStmt(FingerprintContext *ctx, const AlterEventTrigStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintRefreshMatViewStmt(FingerprintContext *ctx, const RefreshMatViewStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintReplicaIdentityStmt(FingerprintContext *ctx, const ReplicaIdentityStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterSystemStmt(FingerprintContext *ctx, const AlterSystemStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreatePolicyStmt(FingerprintContext *ctx, const CreatePolicyStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterPolicyStmt(FingerprintContext *ctx, const AlterPolicyStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateTransformStmt(FingerprintContext *ctx, const CreateTransformStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateAmStmt(FingerprintContext *ctx, const CreateAmStmt *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintPublicationTable(FingerprintContext *ctx, const PublicationTable *node, const void *parent, const char *field_name, unsigned int depth); +static void _fingerprintPublicationObjSpec(FingerprintContext *ctx, const PublicationObjSpec *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCreatePublicationStmt(FingerprintContext *ctx, const CreatePublicationStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintAlterPublicationStmt(FingerprintContext *ctx, const AlterPublicationStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintCreateSubscriptionStmt(FingerprintContext *ctx, const CreateSubscriptionStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintAlterSubscriptionStmt(FingerprintContext *ctx, const AlterSubscriptionStmt *node, const void *parent, const char *field_name, unsigned int depth); static void _fingerprintDropSubscriptionStmt(FingerprintContext *ctx, const DropSubscriptionStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateStatsStmt(FingerprintContext *ctx, const CreateStatsStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterCollationStmt(FingerprintContext *ctx, const AlterCollationStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCallStmt(FingerprintContext *ctx, const CallStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAlterStatsStmt(FingerprintContext *ctx, const AlterStatsStmt *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintA_Expr(FingerprintContext *ctx, const A_Expr *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintColumnRef(FingerprintContext *ctx, const ColumnRef *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintParamRef(FingerprintContext *ctx, const ParamRef *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintFuncCall(FingerprintContext *ctx, const FuncCall *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintA_Star(FingerprintContext *ctx, const A_Star *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintA_Indices(FingerprintContext *ctx, const A_Indices *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintA_Indirection(FingerprintContext *ctx, const A_Indirection *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintA_ArrayExpr(FingerprintContext *ctx, const A_ArrayExpr *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintResTarget(FingerprintContext *ctx, const ResTarget *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintMultiAssignRef(FingerprintContext *ctx, const MultiAssignRef *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintTypeCast(FingerprintContext *ctx, const TypeCast *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCollateClause(FingerprintContext *ctx, const CollateClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintSortBy(FingerprintContext *ctx, const SortBy *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintWindowDef(FingerprintContext *ctx, const WindowDef *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintRangeSubselect(FingerprintContext *ctx, const RangeSubselect *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintRangeFunction(FingerprintContext *ctx, const RangeFunction *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintRangeTableSample(FingerprintContext *ctx, const RangeTableSample *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintRangeTableFunc(FingerprintContext *ctx, const RangeTableFunc *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintRangeTableFuncCol(FingerprintContext *ctx, const RangeTableFuncCol *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintTypeName(FingerprintContext *ctx, const TypeName *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintColumnDef(FingerprintContext *ctx, const ColumnDef *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintIndexElem(FingerprintContext *ctx, const IndexElem *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintStatsElem(FingerprintContext *ctx, const StatsElem *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintConstraint(FingerprintContext *ctx, const Constraint *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintDefElem(FingerprintContext *ctx, const DefElem *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintRangeTblEntry(FingerprintContext *ctx, const RangeTblEntry *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintRangeTblFunction(FingerprintContext *ctx, const RangeTblFunction *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintTableSampleClause(FingerprintContext *ctx, const TableSampleClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintWithCheckOption(FingerprintContext *ctx, const WithCheckOption *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintSortGroupClause(FingerprintContext *ctx, const SortGroupClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintGroupingSet(FingerprintContext *ctx, const GroupingSet *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintWindowClause(FingerprintContext *ctx, const WindowClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintObjectWithArgs(FingerprintContext *ctx, const ObjectWithArgs *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintAccessPriv(FingerprintContext *ctx, const AccessPriv *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCreateOpClassItem(FingerprintContext *ctx, const CreateOpClassItem *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintTableLikeClause(FingerprintContext *ctx, const TableLikeClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintFunctionParameter(FingerprintContext *ctx, const FunctionParameter *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintLockingClause(FingerprintContext *ctx, const LockingClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintRowMarkClause(FingerprintContext *ctx, const RowMarkClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintXmlSerialize(FingerprintContext *ctx, const XmlSerialize *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintWithClause(FingerprintContext *ctx, const WithClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintInferClause(FingerprintContext *ctx, const InferClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintOnConflictClause(FingerprintContext *ctx, const OnConflictClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCTESearchClause(FingerprintContext *ctx, const CTESearchClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCTECycleClause(FingerprintContext *ctx, const CTECycleClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCommonTableExpr(FingerprintContext *ctx, const CommonTableExpr *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintMergeWhenClause(FingerprintContext *ctx, const MergeWhenClause *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintRoleSpec(FingerprintContext *ctx, const RoleSpec *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintTriggerTransition(FingerprintContext *ctx, const TriggerTransition *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintPartitionElem(FingerprintContext *ctx, const PartitionElem *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintPartitionSpec(FingerprintContext *ctx, const PartitionSpec *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintPartitionBoundSpec(FingerprintContext *ctx, const PartitionBoundSpec *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintPartitionRangeDatum(FingerprintContext *ctx, const PartitionRangeDatum *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintPartitionCmd(FingerprintContext *ctx, const PartitionCmd *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintVacuumRelation(FingerprintContext *ctx, const VacuumRelation *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintPublicationObjSpec(FingerprintContext *ctx, const PublicationObjSpec *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintPublicationTable(FingerprintContext *ctx, const PublicationTable *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintInlineCodeBlock(FingerprintContext *ctx, const InlineCodeBlock *node, const void *parent, const char *field_name, unsigned int depth); -static void _fingerprintCallContext(FingerprintContext *ctx, const CallContext *node, const void *parent, const char *field_name, unsigned int depth); static void @@ -418,12 +432,12 @@ _fingerprintTableFunc(FingerprintContext *ctx, const TableFunc *node, const void // Intentionally ignoring node->location for fingerprinting if (true) { - int x; + int x = -1; Bitmapset *bms = bms_copy(node->notnulls); _fingerprintString(ctx, "notnulls"); - while ((x = bms_first_member(bms)) >= 0) { + while ((x = bms_next_member(bms, x)) >= 0) { char buffer[50]; sprintf(buffer, "%d", x); _fingerprintString(ctx, buffer); @@ -491,21 +505,105 @@ _fingerprintTableFunc(FingerprintContext *ctx, const TableFunc *node, const void } static void -_fingerprintVar(FingerprintContext *ctx, const Var *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintIntoClause(FingerprintContext *ctx, const IntoClause *node, const void *parent, const char *field_name, unsigned int depth) { - // Intentionally ignoring node->location for fingerprinting + if (node->accessMethod != NULL) { + _fingerprintString(ctx, "accessMethod"); + _fingerprintString(ctx, node->accessMethod); + } - if (node->varattno != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->varattno); - _fingerprintString(ctx, "varattno"); - _fingerprintString(ctx, buffer); + if (node->colNames != NULL && node->colNames->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "colNames"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->colNames, node, "colNames", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->colNames) == 1 && linitial(node->colNames) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (true) { + _fingerprintString(ctx, "onCommit"); + _fingerprintString(ctx, _enumToStringOnCommitAction(node->onCommit)); + } + + if (node->options != NULL && node->options->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "options"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->rel != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "rel"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintRangeVar(ctx, node->rel, node, "rel", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (node->skipData) { + _fingerprintString(ctx, "skipData"); + _fingerprintString(ctx, "true"); + } + + if (node->tableSpaceName != NULL) { + _fingerprintString(ctx, "tableSpaceName"); + _fingerprintString(ctx, node->tableSpaceName); } - if (node->varattnosyn != 0) { + if (node->viewQuery != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "viewQuery"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->viewQuery, node, "viewQuery", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + +} + +static void +_fingerprintVar(FingerprintContext *ctx, const Var *node, const void *parent, const char *field_name, unsigned int depth) +{ + // Intentionally ignoring node->location for fingerprinting + + if (node->varattno != 0) { char buffer[50]; - sprintf(buffer, "%d", node->varattnosyn); - _fingerprintString(ctx, "varattnosyn"); + sprintf(buffer, "%d", node->varattno); + _fingerprintString(ctx, "varattno"); _fingerprintString(ctx, buffer); } @@ -530,11 +628,19 @@ _fingerprintVar(FingerprintContext *ctx, const Var *node, const void *parent, co _fingerprintString(ctx, buffer); } - if (node->varnosyn != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->varnosyn); - _fingerprintString(ctx, "varnosyn"); - _fingerprintString(ctx, buffer); + if (true) { + int x = -1; + Bitmapset *bms = bms_copy(node->varnullingrels); + + _fingerprintString(ctx, "varnullingrels"); + + while ((x = bms_next_member(bms, x)) >= 0) { + char buffer[50]; + sprintf(buffer, "%d", x); + _fingerprintString(ctx, buffer); + } + + bms_free(bms); } if (node->vartype != 0) { @@ -773,13 +879,6 @@ _fingerprintAggref(FingerprintContext *ctx, const Aggref *node, const void *pare _fingerprintString(ctx, buffer); } - if (node->aggtranstype != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->aggtranstype); - _fingerprintString(ctx, "aggtranstype"); - _fingerprintString(ctx, buffer); - } - if (node->aggtype != 0) { char buffer[50]; sprintf(buffer, "%d", node->aggtype); @@ -845,22 +944,6 @@ _fingerprintGroupingFunc(FingerprintContext *ctx, const GroupingFunc *node, cons } XXH3_freeState(prev); } - if (node->cols != NULL && node->cols->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "cols"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->cols, node, "cols", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cols) == 1 && linitial(node->cols) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } // Intentionally ignoring node->location for fingerprinting if (node->refs != NULL && node->refs->length > 0) { @@ -1209,13 +1292,6 @@ _fingerprintOpExpr(FingerprintContext *ctx, const OpExpr *node, const void *pare _fingerprintString(ctx, buffer); } - if (node->opfuncid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->opfuncid); - _fingerprintString(ctx, "opfuncid"); - _fingerprintString(ctx, buffer); - } - if (node->opno != 0) { char buffer[50]; sprintf(buffer, "%d", node->opno); @@ -1256,13 +1332,6 @@ _fingerprintScalarArrayOpExpr(FingerprintContext *ctx, const ScalarArrayOpExpr * } XXH3_freeState(prev); } - if (node->hashfuncid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->hashfuncid); - _fingerprintString(ctx, "hashfuncid"); - _fingerprintString(ctx, buffer); - } - if (node->inputcollid != 0) { char buffer[50]; sprintf(buffer, "%d", node->inputcollid); @@ -1272,20 +1341,6 @@ _fingerprintScalarArrayOpExpr(FingerprintContext *ctx, const ScalarArrayOpExpr * // Intentionally ignoring node->location for fingerprinting - if (node->negfuncid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->negfuncid); - _fingerprintString(ctx, "negfuncid"); - _fingerprintString(ctx, buffer); - } - - if (node->opfuncid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->opfuncid); - _fingerprintString(ctx, "opfuncid"); - _fingerprintString(ctx, buffer); - } - if (node->opno != 0) { char buffer[50]; sprintf(buffer, "%d", node->opno); @@ -2384,6 +2439,11 @@ _fingerprintXmlExpr(FingerprintContext *ctx, const XmlExpr *node, const void *pa } XXH3_freeState(prev); } + if (node->indent) { + _fingerprintString(ctx, "indent"); + _fingerprintString(ctx, "true"); + } + // Intentionally ignoring node->location for fingerprinting if (node->name != NULL) { @@ -2434,17 +2494,34 @@ _fingerprintXmlExpr(FingerprintContext *ctx, const XmlExpr *node, const void *pa } static void -_fingerprintNullTest(FingerprintContext *ctx, const NullTest *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintJsonFormat(FingerprintContext *ctx, const JsonFormat *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->arg != NULL) { + if (true) { + _fingerprintString(ctx, "encoding"); + _fingerprintString(ctx, _enumToStringJsonEncoding(node->encoding)); + } + + if (true) { + _fingerprintString(ctx, "format_type"); + _fingerprintString(ctx, _enumToStringJsonFormatType(node->format_type)); + } + + // Intentionally ignoring node->location for fingerprinting + +} + +static void +_fingerprintJsonReturning(FingerprintContext *ctx, const JsonReturning *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->format != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "arg"); + _fingerprintString(ctx, "format"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); + _fingerprintJsonFormat(ctx, node->format, node, "format", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -2453,32 +2530,34 @@ _fingerprintNullTest(FingerprintContext *ctx, const NullTest *node, const void * XXH3_freeState(prev); } - if (node->argisrow) { - _fingerprintString(ctx, "argisrow"); - _fingerprintString(ctx, "true"); + if (node->typid != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->typid); + _fingerprintString(ctx, "typid"); + _fingerprintString(ctx, buffer); } - // Intentionally ignoring node->location for fingerprinting - - if (true) { - _fingerprintString(ctx, "nulltesttype"); - _fingerprintString(ctx, _enumToStringNullTestType(node->nulltesttype)); + if (node->typmod != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->typmod); + _fingerprintString(ctx, "typmod"); + _fingerprintString(ctx, buffer); } } static void -_fingerprintBooleanTest(FingerprintContext *ctx, const BooleanTest *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintJsonValueExpr(FingerprintContext *ctx, const JsonValueExpr *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->arg != NULL) { + if (node->format != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "arg"); + _fingerprintString(ctx, "format"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); + _fingerprintJsonFormat(ctx, node->format, node, "format", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -2487,27 +2566,15 @@ _fingerprintBooleanTest(FingerprintContext *ctx, const BooleanTest *node, const XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "booltesttype"); - _fingerprintString(ctx, _enumToStringBoolTestType(node->booltesttype)); - } - - // Intentionally ignoring node->location for fingerprinting - -} - -static void -_fingerprintCoerceToDomain(FingerprintContext *ctx, const CoerceToDomain *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->arg != NULL) { + if (node->formatted_expr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "arg"); + _fingerprintString(ctx, "formatted_expr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); + _fingerprintNode(ctx, node->formatted_expr, node, "formatted_expr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -2516,63 +2583,305 @@ _fingerprintCoerceToDomain(FingerprintContext *ctx, const CoerceToDomain *node, XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "coercionformat"); - _fingerprintString(ctx, _enumToStringCoercionForm(node->coercionformat)); - } - - // Intentionally ignoring node->location for fingerprinting - - if (node->resultcollid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->resultcollid); - _fingerprintString(ctx, "resultcollid"); - _fingerprintString(ctx, buffer); - } + if (node->raw_expr != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; - if (node->resulttype != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->resulttype); - _fingerprintString(ctx, "resulttype"); - _fingerprintString(ctx, buffer); - } + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "raw_expr"); - if (node->resulttypmod != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->resulttypmod); - _fingerprintString(ctx, "resulttypmod"); - _fingerprintString(ctx, buffer); + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->raw_expr, node, "raw_expr", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); } } static void -_fingerprintCoerceToDomainValue(FingerprintContext *ctx, const CoerceToDomainValue *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintJsonConstructorExpr(FingerprintContext *ctx, const JsonConstructorExpr *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->collation != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->collation); - _fingerprintString(ctx, "collation"); - _fingerprintString(ctx, buffer); - } - - // Intentionally ignoring node->location for fingerprinting - - if (node->typeId != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->typeId); - _fingerprintString(ctx, "typeId"); - _fingerprintString(ctx, buffer); + if (node->absent_on_null) { + _fingerprintString(ctx, "absent_on_null"); + _fingerprintString(ctx, "true"); } - if (node->typeMod != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->typeMod); - _fingerprintString(ctx, "typeMod"); - _fingerprintString(ctx, buffer); - } + if (node->args != NULL && node->args->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; -} + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "args"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->args, node, "args", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->coercion != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "coercion"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->coercion, node, "coercion", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (node->func != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "func"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->func, node, "func", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + // Intentionally ignoring node->location for fingerprinting + + if (node->returning != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "returning"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintJsonReturning(ctx, node->returning, node, "returning", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (true) { + _fingerprintString(ctx, "type"); + _fingerprintString(ctx, _enumToStringJsonConstructorType(node->type)); + } + + if (node->unique) { + _fingerprintString(ctx, "unique"); + _fingerprintString(ctx, "true"); + } + +} + +static void +_fingerprintJsonIsPredicate(FingerprintContext *ctx, const JsonIsPredicate *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->expr != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "expr"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->expr, node, "expr", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (node->format != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "format"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintJsonFormat(ctx, node->format, node, "format", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (true) { + _fingerprintString(ctx, "item_type"); + _fingerprintString(ctx, _enumToStringJsonValueType(node->item_type)); + } + + // Intentionally ignoring node->location for fingerprinting + + if (node->unique_keys) { + _fingerprintString(ctx, "unique_keys"); + _fingerprintString(ctx, "true"); + } + +} + +static void +_fingerprintNullTest(FingerprintContext *ctx, const NullTest *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->arg != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "arg"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (node->argisrow) { + _fingerprintString(ctx, "argisrow"); + _fingerprintString(ctx, "true"); + } + + // Intentionally ignoring node->location for fingerprinting + + if (true) { + _fingerprintString(ctx, "nulltesttype"); + _fingerprintString(ctx, _enumToStringNullTestType(node->nulltesttype)); + } + +} + +static void +_fingerprintBooleanTest(FingerprintContext *ctx, const BooleanTest *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->arg != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "arg"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (true) { + _fingerprintString(ctx, "booltesttype"); + _fingerprintString(ctx, _enumToStringBoolTestType(node->booltesttype)); + } + + // Intentionally ignoring node->location for fingerprinting + +} + +static void +_fingerprintCoerceToDomain(FingerprintContext *ctx, const CoerceToDomain *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->arg != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "arg"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (true) { + _fingerprintString(ctx, "coercionformat"); + _fingerprintString(ctx, _enumToStringCoercionForm(node->coercionformat)); + } + + // Intentionally ignoring node->location for fingerprinting + + if (node->resultcollid != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->resultcollid); + _fingerprintString(ctx, "resultcollid"); + _fingerprintString(ctx, buffer); + } + + if (node->resulttype != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->resulttype); + _fingerprintString(ctx, "resulttype"); + _fingerprintString(ctx, buffer); + } + + if (node->resulttypmod != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->resulttypmod); + _fingerprintString(ctx, "resulttypmod"); + _fingerprintString(ctx, buffer); + } + +} + +static void +_fingerprintCoerceToDomainValue(FingerprintContext *ctx, const CoerceToDomainValue *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->collation != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->collation); + _fingerprintString(ctx, "collation"); + _fingerprintString(ctx, buffer); + } + + // Intentionally ignoring node->location for fingerprinting + + if (node->typeId != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->typeId); + _fingerprintString(ctx, "typeId"); + _fingerprintString(ctx, buffer); + } + + if (node->typeMod != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->typeMod); + _fingerprintString(ctx, "typeMod"); + _fingerprintString(ctx, buffer); + } + +} static void _fingerprintSetToDefault(FingerprintContext *ctx, const SetToDefault *node, const void *parent, const char *field_name, unsigned int depth) @@ -2999,193 +3308,7 @@ _fingerprintOnConflictExpr(FingerprintContext *ctx, const OnConflictExpr *node, } static void -_fingerprintIntoClause(FingerprintContext *ctx, const IntoClause *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->accessMethod != NULL) { - _fingerprintString(ctx, "accessMethod"); - _fingerprintString(ctx, node->accessMethod); - } - - if (node->colNames != NULL && node->colNames->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "colNames"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->colNames, node, "colNames", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->colNames) == 1 && linitial(node->colNames) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - if (true) { - _fingerprintString(ctx, "onCommit"); - _fingerprintString(ctx, _enumToStringOnCommitAction(node->onCommit)); - } - - if (node->options != NULL && node->options->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - if (node->rel != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "rel"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->rel, node, "rel", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - - if (node->skipData) { - _fingerprintString(ctx, "skipData"); - _fingerprintString(ctx, "true"); - } - - if (node->tableSpaceName != NULL) { - _fingerprintString(ctx, "tableSpaceName"); - _fingerprintString(ctx, node->tableSpaceName); - } - - if (node->viewQuery != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "viewQuery"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->viewQuery, node, "viewQuery", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - -} - -static void -_fingerprintMergeAction(FingerprintContext *ctx, const MergeAction *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (true) { - _fingerprintString(ctx, "commandType"); - _fingerprintString(ctx, _enumToStringCmdType(node->commandType)); - } - - if (node->matched) { - _fingerprintString(ctx, "matched"); - _fingerprintString(ctx, "true"); - } - - if (true) { - _fingerprintString(ctx, "override"); - _fingerprintString(ctx, _enumToStringOverridingKind(node->override)); - } - - if (node->qual != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "qual"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->qual, node, "qual", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - - if (node->targetList != NULL && node->targetList->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "targetList"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - if (node->updateColnos != NULL && node->updateColnos->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "updateColnos"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->updateColnos, node, "updateColnos", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->updateColnos) == 1 && linitial(node->updateColnos) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } -} - -static void -_fingerprintRawStmt(FingerprintContext *ctx, const RawStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->stmt != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "stmt"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->stmt, node, "stmt", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - - // Intentionally ignoring node->stmt_len for fingerprinting - - // Intentionally ignoring node->stmt_location for fingerprinting - -} - -static void -_fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent, const char *field_name, unsigned int depth) { if (node->canSetTag) { _fingerprintString(ctx, "canSetTag"); @@ -3448,13 +3571,6 @@ _fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent _fingerprintString(ctx, _enumToStringOverridingKind(node->override)); } - if (node->queryId != 0) { - char buffer[50]; - sprintf(buffer, "%ld", node->queryId); - _fingerprintString(ctx, "queryId"); - _fingerprintString(ctx, buffer); - } - if (true) { _fingerprintString(ctx, "querySource"); _fingerprintString(ctx, _enumToStringQuerySource(node->querySource)); @@ -3515,6 +3631,22 @@ _fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent } XXH3_freeState(prev); } + if (node->rteperminfos != NULL && node->rteperminfos->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "rteperminfos"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->rteperminfos, node, "rteperminfos", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->rteperminfos) == 1 && linitial(node->rteperminfos) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } if (node->setOperations != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; @@ -3630,88 +3762,133 @@ _fingerprintQuery(FingerprintContext *ctx, const Query *node, const void *parent } static void -_fingerprintInsertStmt(FingerprintContext *ctx, const InsertStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintTypeName(FingerprintContext *ctx, const TypeName *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->cols != NULL && node->cols->length > 0) { + if (node->arrayBounds != NULL && node->arrayBounds->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "cols"); + _fingerprintString(ctx, "arrayBounds"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->cols, node, "cols", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cols) == 1 && linitial(node->cols) == NIL)) { + _fingerprintNode(ctx, node->arrayBounds, node, "arrayBounds", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->arrayBounds) == 1 && linitial(node->arrayBounds) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->onConflictClause != NULL) { + // Intentionally ignoring node->location for fingerprinting + + if (node->names != NULL && node->names->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "onConflictClause"); + _fingerprintString(ctx, "names"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintOnConflictClause(ctx, node->onConflictClause, node, "onConflictClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->names, node, "names", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->names) == 1 && linitial(node->names) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->pct_type) { + _fingerprintString(ctx, "pct_type"); + _fingerprintString(ctx, "true"); + } - if (true) { - _fingerprintString(ctx, "override"); - _fingerprintString(ctx, _enumToStringOverridingKind(node->override)); + if (node->setof) { + _fingerprintString(ctx, "setof"); + _fingerprintString(ctx, "true"); } - if (node->relation != NULL) { + if (node->typeOid != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->typeOid); + _fingerprintString(ctx, "typeOid"); + _fingerprintString(ctx, buffer); + } + + if (node->typemod != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->typemod); + _fingerprintString(ctx, "typemod"); + _fingerprintString(ctx, buffer); + } + + if (node->typmods != NULL && node->typmods->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "typmods"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->typmods, node, "typmods", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typmods) == 1 && linitial(node->typmods) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->returningList != NULL && node->returningList->length > 0) { +static void +_fingerprintColumnRef(FingerprintContext *ctx, const ColumnRef *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->fields != NULL && node->fields->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "returningList"); + _fingerprintString(ctx, "fields"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->returningList, node, "returningList", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->returningList) == 1 && linitial(node->returningList) == NIL)) { + _fingerprintNode(ctx, node->fields, node, "fields", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fields) == 1 && linitial(node->fields) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->selectStmt != NULL) { + // Intentionally ignoring node->location for fingerprinting + +} + +static void +_fingerprintParamRef(FingerprintContext *ctx, const ParamRef *node, const void *parent, const char *field_name, unsigned int depth) +{ + // Intentionally ignoring all fields for fingerprinting +} + +static void +_fingerprintA_Expr(FingerprintContext *ctx, const A_Expr *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (true) { + _fingerprintString(ctx, "kind"); + if (node->kind == AEXPR_OP_ANY || node->kind == AEXPR_IN) + _fingerprintString(ctx, "AEXPR_OP"); + else + _fingerprintString(ctx, _enumToStringA_Expr_Kind(node->kind)); + } + + if (node->lexpr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "selectStmt"); + _fingerprintString(ctx, "lexpr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->selectStmt, node, "selectStmt", depth + 1); + _fingerprintNode(ctx, node->lexpr, node, "lexpr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -3720,37 +3897,33 @@ _fingerprintInsertStmt(FingerprintContext *ctx, const InsertStmt *node, const vo XXH3_freeState(prev); } - if (node->withClause != NULL) { + // Intentionally ignoring node->location for fingerprinting + + if (node->name != NULL && node->name->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "withClause"); + _fingerprintString(ctx, "name"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->name, node, "name", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->name) == 1 && linitial(node->name) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - -} - -static void -_fingerprintDeleteStmt(FingerprintContext *ctx, const DeleteStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->relation != NULL) { + if (node->rexpr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "rexpr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintNode(ctx, node->rexpr, node, "rexpr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -3759,47 +3932,61 @@ _fingerprintDeleteStmt(FingerprintContext *ctx, const DeleteStmt *node, const vo XXH3_freeState(prev); } - if (node->returningList != NULL && node->returningList->length > 0) { +} + +static void +_fingerprintTypeCast(FingerprintContext *ctx, const TypeCast *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->arg != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "returningList"); + _fingerprintString(ctx, "arg"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->returningList, node, "returningList", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->returningList) == 1 && linitial(node->returningList) == NIL)) { + _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->usingClause != NULL && node->usingClause->length > 0) { + + // Intentionally ignoring node->location for fingerprinting + + if (node->typeName != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "usingClause"); + _fingerprintString(ctx, "typeName"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->usingClause, node, "usingClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->usingClause) == 1 && linitial(node->usingClause) == NIL)) { + _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->whereClause != NULL) { + +} + +static void +_fingerprintCollateClause(FingerprintContext *ctx, const CollateClause *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->arg != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whereClause"); + _fingerprintString(ctx, "arg"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -3808,53 +3995,60 @@ _fingerprintDeleteStmt(FingerprintContext *ctx, const DeleteStmt *node, const vo XXH3_freeState(prev); } - if (node->withClause != NULL) { + if (node->collname != NULL && node->collname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "withClause"); + _fingerprintString(ctx, "collname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->collname, node, "collname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->collname) == 1 && linitial(node->collname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + // Intentionally ignoring node->location for fingerprinting } static void -_fingerprintUpdateStmt(FingerprintContext *ctx, const UpdateStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintRoleSpec(FingerprintContext *ctx, const RoleSpec *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->fromClause != NULL && node->fromClause->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; + // Intentionally ignoring node->location for fingerprinting - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "fromClause"); + if (node->rolename != NULL) { + _fingerprintString(ctx, "rolename"); + _fingerprintString(ctx, node->rolename); + } - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->fromClause, node, "fromClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fromClause) == 1 && linitial(node->fromClause) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); + if (true) { + _fingerprintString(ctx, "roletype"); + _fingerprintString(ctx, _enumToStringRoleSpecType(node->roletype)); } - if (node->relation != NULL) { + +} + +static void +_fingerprintFuncCall(FingerprintContext *ctx, const FuncCall *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->agg_distinct) { + _fingerprintString(ctx, "agg_distinct"); + _fingerprintString(ctx, "true"); + } + + if (node->agg_filter != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "agg_filter"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintNode(ctx, node->agg_filter, node, "agg_filter", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -3863,64 +4057,85 @@ _fingerprintUpdateStmt(FingerprintContext *ctx, const UpdateStmt *node, const vo XXH3_freeState(prev); } - if (node->returningList != NULL && node->returningList->length > 0) { + if (node->agg_order != NULL && node->agg_order->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "returningList"); + _fingerprintString(ctx, "agg_order"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->returningList, node, "returningList", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->returningList) == 1 && linitial(node->returningList) == NIL)) { + _fingerprintNode(ctx, node->agg_order, node, "agg_order", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->agg_order) == 1 && linitial(node->agg_order) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->targetList != NULL && node->targetList->length > 0) { + if (node->agg_star) { + _fingerprintString(ctx, "agg_star"); + _fingerprintString(ctx, "true"); + } + + if (node->agg_within_group) { + _fingerprintString(ctx, "agg_within_group"); + _fingerprintString(ctx, "true"); + } + + if (node->args != NULL && node->args->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "targetList"); + _fingerprintString(ctx, "args"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) { + _fingerprintNode(ctx, node->args, node, "args", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->whereClause != NULL) { + if (node->func_variadic) { + _fingerprintString(ctx, "func_variadic"); + _fingerprintString(ctx, "true"); + } + + if (true) { + _fingerprintString(ctx, "funcformat"); + _fingerprintString(ctx, _enumToStringCoercionForm(node->funcformat)); + } + + if (node->funcname != NULL && node->funcname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whereClause"); + _fingerprintString(ctx, "funcname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->funcname, node, "funcname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funcname) == 1 && linitial(node->funcname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + // Intentionally ignoring node->location for fingerprinting - if (node->withClause != NULL) { + if (node->over != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "withClause"); + _fingerprintString(ctx, "over"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1); + _fingerprintWindowDef(ctx, node->over, node, "over", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -3932,17 +4147,27 @@ _fingerprintUpdateStmt(FingerprintContext *ctx, const UpdateStmt *node, const vo } static void -_fingerprintMergeStmt(FingerprintContext *ctx, const MergeStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintA_Star(FingerprintContext *ctx, const A_Star *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->joinCondition != NULL) { +} + +static void +_fingerprintA_Indices(FingerprintContext *ctx, const A_Indices *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->is_slice) { + _fingerprintString(ctx, "is_slice"); + _fingerprintString(ctx, "true"); + } + + if (node->lidx != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "joinCondition"); + _fingerprintString(ctx, "lidx"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->joinCondition, node, "joinCondition", depth + 1); + _fingerprintNode(ctx, node->lidx, node, "lidx", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -3951,31 +4176,37 @@ _fingerprintMergeStmt(FingerprintContext *ctx, const MergeStmt *node, const void XXH3_freeState(prev); } - if (node->mergeWhenClauses != NULL && node->mergeWhenClauses->length > 0) { + if (node->uidx != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "mergeWhenClauses"); + _fingerprintString(ctx, "uidx"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->mergeWhenClauses, node, "mergeWhenClauses", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->mergeWhenClauses) == 1 && linitial(node->mergeWhenClauses) == NIL)) { + _fingerprintNode(ctx, node->uidx, node, "uidx", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->relation != NULL) { + +} + +static void +_fingerprintA_Indirection(FingerprintContext *ctx, const A_Indirection *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->arg != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "arg"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -3984,112 +4215,118 @@ _fingerprintMergeStmt(FingerprintContext *ctx, const MergeStmt *node, const void XXH3_freeState(prev); } - if (node->sourceRelation != NULL) { + if (node->indirection != NULL && node->indirection->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "sourceRelation"); + _fingerprintString(ctx, "indirection"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->sourceRelation, node, "sourceRelation", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->indirection, node, "indirection", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indirection) == 1 && linitial(node->indirection) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->withClause != NULL) { +static void +_fingerprintA_ArrayExpr(FingerprintContext *ctx, const A_ArrayExpr *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->elements != NULL && node->elements->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "withClause"); + _fingerprintString(ctx, "elements"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->elements, node, "elements", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->elements) == 1 && linitial(node->elements) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + // Intentionally ignoring node->location for fingerprinting } static void -_fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintResTarget(FingerprintContext *ctx, const ResTarget *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->all) { - _fingerprintString(ctx, "all"); - _fingerprintString(ctx, "true"); - } - - if (node->distinctClause != NULL && node->distinctClause->length > 0) { + if (node->indirection != NULL && node->indirection->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "distinctClause"); + _fingerprintString(ctx, "indirection"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->distinctClause, node, "distinctClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->distinctClause) == 1 && linitial(node->distinctClause) == NIL)) { + _fingerprintNode(ctx, node->indirection, node, "indirection", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indirection) == 1 && linitial(node->indirection) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->fromClause != NULL && node->fromClause->length > 0) { + // Intentionally ignoring node->location for fingerprinting + + if (node->name != NULL && (field_name == NULL || parent == NULL || !IsA(parent, SelectStmt) || strcmp(field_name, "targetList") != 0)) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); + } + + if (node->val != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "fromClause"); + _fingerprintString(ctx, "val"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->fromClause, node, "fromClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fromClause) == 1 && linitial(node->fromClause) == NIL)) { + _fingerprintNode(ctx, node->val, node, "val", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->groupClause != NULL && node->groupClause->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "groupClause"); +} - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->groupClause, node, "groupClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->groupClause) == 1 && linitial(node->groupClause) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); +static void +_fingerprintMultiAssignRef(FingerprintContext *ctx, const MultiAssignRef *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->colno != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->colno); + _fingerprintString(ctx, "colno"); + _fingerprintString(ctx, buffer); } - if (node->groupDistinct) { - _fingerprintString(ctx, "groupDistinct"); - _fingerprintString(ctx, "true"); + + if (node->ncolumns != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->ncolumns); + _fingerprintString(ctx, "ncolumns"); + _fingerprintString(ctx, buffer); } - if (node->havingClause != NULL) { + if (node->source != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "havingClause"); + _fingerprintString(ctx, "source"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->havingClause, node, "havingClause", depth + 1); + _fingerprintNode(ctx, node->source, node, "source", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4098,15 +4335,22 @@ _fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const vo XXH3_freeState(prev); } - if (node->intoClause != NULL) { +} + +static void +_fingerprintSortBy(FingerprintContext *ctx, const SortBy *node, const void *parent, const char *field_name, unsigned int depth) +{ + // Intentionally ignoring node->location for fingerprinting + + if (node->node != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "intoClause"); + _fingerprintString(ctx, "node"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintIntoClause(ctx, node->intoClause, node, "intoClause", depth + 1); + _fingerprintNode(ctx, node->node, node, "node", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4115,49 +4359,46 @@ _fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const vo XXH3_freeState(prev); } - if (node->larg != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "larg"); + if (true) { + _fingerprintString(ctx, "sortby_dir"); + _fingerprintString(ctx, _enumToStringSortByDir(node->sortby_dir)); + } - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintSelectStmt(ctx, node->larg, node, "larg", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); + if (true) { + _fingerprintString(ctx, "sortby_nulls"); + _fingerprintString(ctx, _enumToStringSortByNulls(node->sortby_nulls)); } - if (node->limitCount != NULL) { + if (node->useOp != NULL && node->useOp->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "limitCount"); + _fingerprintString(ctx, "useOp"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->limitCount, node, "limitCount", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->useOp, node, "useOp", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->useOp) == 1 && linitial(node->useOp) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->limitOffset != NULL) { +static void +_fingerprintWindowDef(FingerprintContext *ctx, const WindowDef *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->endOffset != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "limitOffset"); + _fingerprintString(ctx, "endOffset"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->limitOffset, node, "limitOffset", depth + 1); + _fingerprintNode(ctx, node->endOffset, node, "endOffset", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4166,106 +4407,132 @@ _fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const vo XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "limitOption"); - _fingerprintString(ctx, _enumToStringLimitOption(node->limitOption)); + if (node->frameOptions != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->frameOptions); + _fingerprintString(ctx, "frameOptions"); + _fingerprintString(ctx, buffer); } - if (node->lockingClause != NULL && node->lockingClause->length > 0) { + // Intentionally ignoring node->location for fingerprinting + + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); + } + + if (node->orderClause != NULL && node->orderClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "lockingClause"); + _fingerprintString(ctx, "orderClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->lockingClause, node, "lockingClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->lockingClause) == 1 && linitial(node->lockingClause) == NIL)) { + _fingerprintNode(ctx, node->orderClause, node, "orderClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->orderClause) == 1 && linitial(node->orderClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "op"); - _fingerprintString(ctx, _enumToStringSetOperation(node->op)); - } - - if (node->rarg != NULL) { + if (node->partitionClause != NULL && node->partitionClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "rarg"); + _fingerprintString(ctx, "partitionClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintSelectStmt(ctx, node->rarg, node, "rarg", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->partitionClause, node, "partitionClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->partitionClause) == 1 && linitial(node->partitionClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->refname != NULL) { + _fingerprintString(ctx, "refname"); + _fingerprintString(ctx, node->refname); + } - if (node->sortClause != NULL && node->sortClause->length > 0) { + if (node->startOffset != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "sortClause"); + _fingerprintString(ctx, "startOffset"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->sortClause, node, "sortClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->sortClause) == 1 && linitial(node->sortClause) == NIL)) { + _fingerprintNode(ctx, node->startOffset, node, "startOffset", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->targetList != NULL && node->targetList->length > 0) { + +} + +static void +_fingerprintRangeSubselect(FingerprintContext *ctx, const RangeSubselect *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->alias != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "targetList"); + _fingerprintString(ctx, "alias"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) { + _fingerprintAlias(ctx, node->alias, node, "alias", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->valuesLists != NULL && node->valuesLists->length > 0) { + + if (node->lateral) { + _fingerprintString(ctx, "lateral"); + _fingerprintString(ctx, "true"); + } + + if (node->subquery != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "valuesLists"); + _fingerprintString(ctx, "subquery"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->valuesLists, node, "valuesLists", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->valuesLists) == 1 && linitial(node->valuesLists) == NIL)) { + _fingerprintNode(ctx, node->subquery, node, "subquery", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->whereClause != NULL) { + +} + +static void +_fingerprintRangeFunction(FingerprintContext *ctx, const RangeFunction *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->alias != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whereClause"); + _fingerprintString(ctx, "alias"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + _fingerprintAlias(ctx, node->alias, node, "alias", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4274,53 +4541,67 @@ _fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const vo XXH3_freeState(prev); } - if (node->windowClause != NULL && node->windowClause->length > 0) { + if (node->coldeflist != NULL && node->coldeflist->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "windowClause"); + _fingerprintString(ctx, "coldeflist"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->windowClause, node, "windowClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->windowClause) == 1 && linitial(node->windowClause) == NIL)) { + _fingerprintNode(ctx, node->coldeflist, node, "coldeflist", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->coldeflist) == 1 && linitial(node->coldeflist) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->withClause != NULL) { + if (node->functions != NULL && node->functions->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "withClause"); + _fingerprintString(ctx, "functions"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->functions, node, "functions", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->functions) == 1 && linitial(node->functions) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->is_rowsfrom) { + _fingerprintString(ctx, "is_rowsfrom"); + _fingerprintString(ctx, "true"); + } + + if (node->lateral) { + _fingerprintString(ctx, "lateral"); + _fingerprintString(ctx, "true"); + } + + if (node->ordinality) { + _fingerprintString(ctx, "ordinality"); + _fingerprintString(ctx, "true"); + } } static void -_fingerprintReturnStmt(FingerprintContext *ctx, const ReturnStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintRangeTableFunc(FingerprintContext *ctx, const RangeTableFunc *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->returnval != NULL) { + if (node->alias != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "returnval"); + _fingerprintString(ctx, "alias"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->returnval, node, "returnval", depth + 1); + _fingerprintAlias(ctx, node->alias, node, "alias", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4329,50 +4610,31 @@ _fingerprintReturnStmt(FingerprintContext *ctx, const ReturnStmt *node, const vo XXH3_freeState(prev); } -} - -static void -_fingerprintPLAssignStmt(FingerprintContext *ctx, const PLAssignStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->indirection != NULL && node->indirection->length > 0) { + if (node->columns != NULL && node->columns->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "indirection"); + _fingerprintString(ctx, "columns"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->indirection, node, "indirection", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indirection) == 1 && linitial(node->indirection) == NIL)) { + _fingerprintNode(ctx, node->columns, node, "columns", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->columns) == 1 && linitial(node->columns) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting - - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); - } - - if (node->nnames != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->nnames); - _fingerprintString(ctx, "nnames"); - _fingerprintString(ctx, buffer); - } - - if (node->val != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; + if (node->docexpr != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "val"); + _fingerprintString(ctx, "docexpr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintSelectStmt(ctx, node->val, node, "val", depth + 1); + _fingerprintNode(ctx, node->docexpr, node, "docexpr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4381,46 +4643,38 @@ _fingerprintPLAssignStmt(FingerprintContext *ctx, const PLAssignStmt *node, cons XXH3_freeState(prev); } -} + if (node->lateral) { + _fingerprintString(ctx, "lateral"); + _fingerprintString(ctx, "true"); + } -static void -_fingerprintAlterTableStmt(FingerprintContext *ctx, const AlterTableStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->cmds != NULL && node->cmds->length > 0) { + // Intentionally ignoring node->location for fingerprinting + + if (node->namespaces != NULL && node->namespaces->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "cmds"); + _fingerprintString(ctx, "namespaces"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->cmds, node, "cmds", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cmds) == 1 && linitial(node->cmds) == NIL)) { + _fingerprintNode(ctx, node->namespaces, node, "namespaces", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->namespaces) == 1 && linitial(node->namespaces) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); - _fingerprintString(ctx, "true"); - } - - if (true) { - _fingerprintString(ctx, "objtype"); - _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); - } - - if (node->relation != NULL) { + if (node->rowexpr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "rowexpr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintNode(ctx, node->rowexpr, node, "rowexpr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4432,22 +4686,17 @@ _fingerprintAlterTableStmt(FingerprintContext *ctx, const AlterTableStmt *node, } static void -_fingerprintAlterTableCmd(FingerprintContext *ctx, const AlterTableCmd *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintRangeTableFuncCol(FingerprintContext *ctx, const RangeTableFuncCol *node, const void *parent, const char *field_name, unsigned int depth) { - if (true) { - _fingerprintString(ctx, "behavior"); - _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); - } - - if (node->def != NULL) { + if (node->coldefexpr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "def"); + _fingerprintString(ctx, "coldefexpr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->def, node, "def", depth + 1); + _fingerprintNode(ctx, node->coldefexpr, node, "coldefexpr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4456,25 +4705,15 @@ _fingerprintAlterTableCmd(FingerprintContext *ctx, const AlterTableCmd *node, co XXH3_freeState(prev); } - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); - _fingerprintString(ctx, "true"); - } - - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); - } - - if (node->newowner != NULL) { + if (node->colexpr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "newowner"); + _fingerprintString(ctx, "colexpr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->newowner, node, "newowner", depth + 1); + _fingerprintNode(ctx, node->colexpr, node, "colexpr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4483,67 +4722,24 @@ _fingerprintAlterTableCmd(FingerprintContext *ctx, const AlterTableCmd *node, co XXH3_freeState(prev); } - if (node->num != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->num); - _fingerprintString(ctx, "num"); - _fingerprintString(ctx, buffer); + if (node->colname != NULL) { + _fingerprintString(ctx, "colname"); + _fingerprintString(ctx, node->colname); } - if (node->recurse) { - _fingerprintString(ctx, "recurse"); + if (node->for_ordinality) { + _fingerprintString(ctx, "for_ordinality"); _fingerprintString(ctx, "true"); } - if (true) { - _fingerprintString(ctx, "subtype"); - _fingerprintString(ctx, _enumToStringAlterTableType(node->subtype)); - } - -} - -static void -_fingerprintAlterDomainStmt(FingerprintContext *ctx, const AlterDomainStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (true) { - _fingerprintString(ctx, "behavior"); - _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); - } - - if (node->def != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "def"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->def, node, "def", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); + if (node->is_not_null) { + _fingerprintString(ctx, "is_not_null"); _fingerprintString(ctx, "true"); } - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); - } - - if (node->subtype != 0) { - char buffer[2] = {node->subtype, '\0'}; - _fingerprintString(ctx, "subtype"); - _fingerprintString(ctx, buffer); - } + // Intentionally ignoring node->location for fingerprinting - if (node->typeName != NULL && node->typeName->length > 0) { + if (node->typeName != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; @@ -4551,97 +4747,80 @@ _fingerprintAlterDomainStmt(FingerprintContext *ctx, const AlterDomainStmt *node _fingerprintString(ctx, "typeName"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->typeName, node, "typeName", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typeName) == 1 && linitial(node->typeName) == NIL)) { + _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + } static void -_fingerprintSetOperationStmt(FingerprintContext *ctx, const SetOperationStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintRangeTableSample(FingerprintContext *ctx, const RangeTableSample *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->all) { - _fingerprintString(ctx, "all"); - _fingerprintString(ctx, "true"); - } - - if (node->colCollations != NULL && node->colCollations->length > 0) { + if (node->args != NULL && node->args->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "colCollations"); + _fingerprintString(ctx, "args"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->colCollations, node, "colCollations", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->colCollations) == 1 && linitial(node->colCollations) == NIL)) { + _fingerprintNode(ctx, node->args, node, "args", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->colTypes != NULL && node->colTypes->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "colTypes"); + // Intentionally ignoring node->location for fingerprinting - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->colTypes, node, "colTypes", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->colTypes) == 1 && linitial(node->colTypes) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - if (node->colTypmods != NULL && node->colTypmods->length > 0) { + if (node->method != NULL && node->method->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "colTypmods"); + _fingerprintString(ctx, "method"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->colTypmods, node, "colTypmods", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->colTypmods) == 1 && linitial(node->colTypmods) == NIL)) { + _fingerprintNode(ctx, node->method, node, "method", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->method) == 1 && linitial(node->method) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->groupClauses != NULL && node->groupClauses->length > 0) { + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "groupClauses"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->groupClauses, node, "groupClauses", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->groupClauses) == 1 && linitial(node->groupClauses) == NIL)) { + _fingerprintNode(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->larg != NULL) { + + if (node->repeatable != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "larg"); + _fingerprintString(ctx, "repeatable"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->larg, node, "larg", depth + 1); + _fingerprintNode(ctx, node->repeatable, node, "repeatable", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4650,20 +4829,20 @@ _fingerprintSetOperationStmt(FingerprintContext *ctx, const SetOperationStmt *no XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "op"); - _fingerprintString(ctx, _enumToStringSetOperation(node->op)); - } +} - if (node->rarg != NULL) { +static void +_fingerprintColumnDef(FingerprintContext *ctx, const ColumnDef *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->collClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "rarg"); + _fingerprintString(ctx, "collClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->rarg, node, "rarg", depth + 1); + _fingerprintCollateClause(ctx, node->collClause, node, "collClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4672,46 +4851,48 @@ _fingerprintSetOperationStmt(FingerprintContext *ctx, const SetOperationStmt *no XXH3_freeState(prev); } -} + if (node->collOid != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->collOid); + _fingerprintString(ctx, "collOid"); + _fingerprintString(ctx, buffer); + } -static void -_fingerprintGrantStmt(FingerprintContext *ctx, const GrantStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (true) { - _fingerprintString(ctx, "behavior"); - _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); + if (node->colname != NULL) { + _fingerprintString(ctx, "colname"); + _fingerprintString(ctx, node->colname); } - if (node->grant_option) { - _fingerprintString(ctx, "grant_option"); - _fingerprintString(ctx, "true"); + if (node->compression != NULL) { + _fingerprintString(ctx, "compression"); + _fingerprintString(ctx, node->compression); } - if (node->grantees != NULL && node->grantees->length > 0) { + if (node->constraints != NULL && node->constraints->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "grantees"); + _fingerprintString(ctx, "constraints"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->grantees, node, "grantees", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->grantees) == 1 && linitial(node->grantees) == NIL)) { + _fingerprintNode(ctx, node->constraints, node, "constraints", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->constraints) == 1 && linitial(node->constraints) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->grantor != NULL) { + if (node->cooked_default != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "grantor"); + _fingerprintString(ctx, "cooked_default"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->grantor, node, "grantor", depth + 1); + _fingerprintNode(ctx, node->cooked_default, node, "cooked_default", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4720,109 +4901,141 @@ _fingerprintGrantStmt(FingerprintContext *ctx, const GrantStmt *node, const void XXH3_freeState(prev); } - if (node->is_grant) { - _fingerprintString(ctx, "is_grant"); - _fingerprintString(ctx, "true"); - } - - if (node->objects != NULL && node->objects->length > 0) { + if (node->fdwoptions != NULL && node->fdwoptions->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "objects"); + _fingerprintString(ctx, "fdwoptions"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->objects, node, "objects", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objects) == 1 && linitial(node->objects) == NIL)) { + _fingerprintNode(ctx, node->fdwoptions, node, "fdwoptions", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fdwoptions) == 1 && linitial(node->fdwoptions) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "objtype"); - _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); + if (node->generated != 0) { + char buffer[2] = {node->generated, '\0'}; + _fingerprintString(ctx, "generated"); + _fingerprintString(ctx, buffer); } - if (node->privileges != NULL && node->privileges->length > 0) { + if (node->identity != 0) { + char buffer[2] = {node->identity, '\0'}; + _fingerprintString(ctx, "identity"); + _fingerprintString(ctx, buffer); + } + + if (node->identitySequence != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "privileges"); + _fingerprintString(ctx, "identitySequence"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->privileges, node, "privileges", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->privileges) == 1 && linitial(node->privileges) == NIL)) { + _fingerprintRangeVar(ctx, node->identitySequence, node, "identitySequence", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "targtype"); - _fingerprintString(ctx, _enumToStringGrantTargetType(node->targtype)); + + if (node->inhcount != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->inhcount); + _fingerprintString(ctx, "inhcount"); + _fingerprintString(ctx, buffer); } -} + if (node->is_from_type) { + _fingerprintString(ctx, "is_from_type"); + _fingerprintString(ctx, "true"); + } -static void -_fingerprintGrantRoleStmt(FingerprintContext *ctx, const GrantRoleStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->admin_opt) { - _fingerprintString(ctx, "admin_opt"); + if (node->is_local) { + _fingerprintString(ctx, "is_local"); _fingerprintString(ctx, "true"); } - if (true) { - _fingerprintString(ctx, "behavior"); - _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); + if (node->is_not_null) { + _fingerprintString(ctx, "is_not_null"); + _fingerprintString(ctx, "true"); } - if (node->granted_roles != NULL && node->granted_roles->length > 0) { + // Intentionally ignoring node->location for fingerprinting + + if (node->raw_default != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "granted_roles"); + _fingerprintString(ctx, "raw_default"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->granted_roles, node, "granted_roles", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->granted_roles) == 1 && linitial(node->granted_roles) == NIL)) { + _fingerprintNode(ctx, node->raw_default, node, "raw_default", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->grantee_roles != NULL && node->grantee_roles->length > 0) { + + if (node->storage != 0) { + char buffer[2] = {node->storage, '\0'}; + _fingerprintString(ctx, "storage"); + _fingerprintString(ctx, buffer); + } + + if (node->storage_name != NULL) { + _fingerprintString(ctx, "storage_name"); + _fingerprintString(ctx, node->storage_name); + } + + if (node->typeName != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "grantee_roles"); + _fingerprintString(ctx, "typeName"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->grantee_roles, node, "grantee_roles", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->grantee_roles) == 1 && linitial(node->grantee_roles) == NIL)) { + _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->grantor != NULL) { + +} + +static void +_fingerprintTableLikeClause(FingerprintContext *ctx, const TableLikeClause *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->options != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->options); + _fingerprintString(ctx, "options"); + _fingerprintString(ctx, buffer); + } + + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "grantor"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->grantor, node, "grantor", depth + 1); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4831,160 +5044,187 @@ _fingerprintGrantRoleStmt(FingerprintContext *ctx, const GrantRoleStmt *node, co XXH3_freeState(prev); } - if (node->is_grant) { - _fingerprintString(ctx, "is_grant"); - _fingerprintString(ctx, "true"); + if (node->relationOid != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->relationOid); + _fingerprintString(ctx, "relationOid"); + _fingerprintString(ctx, buffer); } } static void -_fingerprintAlterDefaultPrivilegesStmt(FingerprintContext *ctx, const AlterDefaultPrivilegesStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintIndexElem(FingerprintContext *ctx, const IndexElem *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->action != NULL) { + if (node->collation != NULL && node->collation->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "action"); + _fingerprintString(ctx, "collation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintGrantStmt(ctx, node->action, node, "action", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->collation, node, "collation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->collation) == 1 && linitial(node->collation) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->options != NULL && node->options->length > 0) { + if (node->expr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "expr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->expr, node, "expr", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} -static void -_fingerprintClosePortalStmt(FingerprintContext *ctx, const ClosePortalStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - // Intentionally ignoring node->portalname for fingerprinting + if (node->indexcolname != NULL) { + _fingerprintString(ctx, "indexcolname"); + _fingerprintString(ctx, node->indexcolname); + } -} + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); + } -static void -_fingerprintClusterStmt(FingerprintContext *ctx, const ClusterStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->indexname != NULL) { - _fingerprintString(ctx, "indexname"); - _fingerprintString(ctx, node->indexname); + if (true) { + _fingerprintString(ctx, "nulls_ordering"); + _fingerprintString(ctx, _enumToStringSortByNulls(node->nulls_ordering)); } - if (node->params != NULL && node->params->length > 0) { + if (node->opclass != NULL && node->opclass->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "params"); + _fingerprintString(ctx, "opclass"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->params, node, "params", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->params) == 1 && linitial(node->params) == NIL)) { + _fingerprintNode(ctx, node->opclass, node, "opclass", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opclass) == 1 && linitial(node->opclass) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->relation != NULL) { + if (node->opclassopts != NULL && node->opclassopts->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "opclassopts"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->opclassopts, node, "opclassopts", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opclassopts) == 1 && linitial(node->opclassopts) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (true) { + _fingerprintString(ctx, "ordering"); + _fingerprintString(ctx, _enumToStringSortByDir(node->ordering)); + } } static void -_fingerprintCopyStmt(FingerprintContext *ctx, const CopyStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintDefElem(FingerprintContext *ctx, const DefElem *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->attlist != NULL && node->attlist->length > 0) { + if (node->arg != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "attlist"); + _fingerprintString(ctx, "arg"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->attlist, node, "attlist", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->attlist) == 1 && linitial(node->attlist) == NIL)) { + _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->filename != NULL) { - _fingerprintString(ctx, "filename"); - _fingerprintString(ctx, node->filename); + + if (true) { + _fingerprintString(ctx, "defaction"); + _fingerprintString(ctx, _enumToStringDefElemAction(node->defaction)); } - if (node->is_from) { - _fingerprintString(ctx, "is_from"); - _fingerprintString(ctx, "true"); + if (node->defname != NULL) { + _fingerprintString(ctx, "defname"); + _fingerprintString(ctx, node->defname); } - if (node->is_program) { - _fingerprintString(ctx, "is_program"); - _fingerprintString(ctx, "true"); + if (node->defnamespace != NULL) { + _fingerprintString(ctx, "defnamespace"); + _fingerprintString(ctx, node->defnamespace); } - if (node->options != NULL && node->options->length > 0) { + // Intentionally ignoring node->location for fingerprinting + +} + +static void +_fingerprintLockingClause(FingerprintContext *ctx, const LockingClause *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->lockedRels != NULL && node->lockedRels->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "lockedRels"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->lockedRels, node, "lockedRels", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->lockedRels) == 1 && linitial(node->lockedRels) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->query != NULL) { + if (true) { + _fingerprintString(ctx, "strength"); + _fingerprintString(ctx, _enumToStringLockClauseStrength(node->strength)); + } + + if (true) { + _fingerprintString(ctx, "waitPolicy"); + _fingerprintString(ctx, _enumToStringLockWaitPolicy(node->waitPolicy)); + } + +} + +static void +_fingerprintXmlSerialize(FingerprintContext *ctx, const XmlSerialize *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->expr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "query"); + _fingerprintString(ctx, "expr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->query, node, "query", depth + 1); + _fingerprintNode(ctx, node->expr, node, "expr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -4993,15 +5233,22 @@ _fingerprintCopyStmt(FingerprintContext *ctx, const CopyStmt *node, const void * XXH3_freeState(prev); } - if (node->relation != NULL) { + if (node->indent) { + _fingerprintString(ctx, "indent"); + _fingerprintString(ctx, "true"); + } + + // Intentionally ignoring node->location for fingerprinting + + if (node->typeName != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "typeName"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5010,15 +5257,41 @@ _fingerprintCopyStmt(FingerprintContext *ctx, const CopyStmt *node, const void * XXH3_freeState(prev); } - if (node->whereClause != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; + if (true) { + _fingerprintString(ctx, "xmloption"); + _fingerprintString(ctx, _enumToStringXmlOptionType(node->xmloption)); + } - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whereClause"); +} + +static void +_fingerprintPartitionElem(FingerprintContext *ctx, const PartitionElem *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->collation != NULL && node->collation->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "collation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + _fingerprintNode(ctx, node->collation, node, "collation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->collation) == 1 && linitial(node->collation) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->expr != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "expr"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->expr, node, "expr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5027,100 +5300,158 @@ _fingerprintCopyStmt(FingerprintContext *ctx, const CopyStmt *node, const void * XXH3_freeState(prev); } + // Intentionally ignoring node->location for fingerprinting + + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); + } + + if (node->opclass != NULL && node->opclass->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "opclass"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->opclass, node, "opclass", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opclass) == 1 && linitial(node->opclass) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } } static void -_fingerprintCreateStmt(FingerprintContext *ctx, const CreateStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintPartitionSpec(FingerprintContext *ctx, const PartitionSpec *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->accessMethod != NULL) { - _fingerprintString(ctx, "accessMethod"); - _fingerprintString(ctx, node->accessMethod); - } + // Intentionally ignoring node->location for fingerprinting - if (node->constraints != NULL && node->constraints->length > 0) { + if (node->partParams != NULL && node->partParams->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "constraints"); + _fingerprintString(ctx, "partParams"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->constraints, node, "constraints", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->constraints) == 1 && linitial(node->constraints) == NIL)) { + _fingerprintNode(ctx, node->partParams, node, "partParams", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->partParams) == 1 && linitial(node->partParams) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->if_not_exists) { - _fingerprintString(ctx, "if_not_exists"); + if (true) { + _fingerprintString(ctx, "strategy"); + _fingerprintString(ctx, _enumToStringPartitionStrategy(node->strategy)); + } + +} + +static void +_fingerprintPartitionBoundSpec(FingerprintContext *ctx, const PartitionBoundSpec *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->is_default) { + _fingerprintString(ctx, "is_default"); _fingerprintString(ctx, "true"); } - if (node->inhRelations != NULL && node->inhRelations->length > 0) { + if (node->listdatums != NULL && node->listdatums->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "inhRelations"); + _fingerprintString(ctx, "listdatums"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->inhRelations, node, "inhRelations", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->inhRelations) == 1 && linitial(node->inhRelations) == NIL)) { + _fingerprintNode(ctx, node->listdatums, node, "listdatums", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->listdatums) == 1 && linitial(node->listdatums) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->ofTypename != NULL) { + // Intentionally ignoring node->location for fingerprinting + + if (node->lowerdatums != NULL && node->lowerdatums->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "ofTypename"); + _fingerprintString(ctx, "lowerdatums"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->ofTypename, node, "ofTypename", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->lowerdatums, node, "lowerdatums", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->lowerdatums) == 1 && linitial(node->lowerdatums) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->modulus != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->modulus); + _fingerprintString(ctx, "modulus"); + _fingerprintString(ctx, buffer); + } - if (true) { - _fingerprintString(ctx, "oncommit"); - _fingerprintString(ctx, _enumToStringOnCommitAction(node->oncommit)); + if (node->remainder != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->remainder); + _fingerprintString(ctx, "remainder"); + _fingerprintString(ctx, buffer); } - if (node->options != NULL && node->options->length > 0) { + if (node->strategy != 0) { + char buffer[2] = {node->strategy, '\0'}; + _fingerprintString(ctx, "strategy"); + _fingerprintString(ctx, buffer); + } + + if (node->upperdatums != NULL && node->upperdatums->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "upperdatums"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->upperdatums, node, "upperdatums", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->upperdatums) == 1 && linitial(node->upperdatums) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->partbound != NULL) { +} + +static void +_fingerprintPartitionRangeDatum(FingerprintContext *ctx, const PartitionRangeDatum *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (true) { + _fingerprintString(ctx, "kind"); + _fingerprintString(ctx, _enumToStringPartitionRangeDatumKind(node->kind)); + } + + // Intentionally ignoring node->location for fingerprinting + + if (node->value != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "partbound"); + _fingerprintString(ctx, "value"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintPartitionBoundSpec(ctx, node->partbound, node, "partbound", depth + 1); + _fingerprintNode(ctx, node->value, node, "value", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5129,15 +5460,20 @@ _fingerprintCreateStmt(FingerprintContext *ctx, const CreateStmt *node, const vo XXH3_freeState(prev); } - if (node->partspec != NULL) { +} + +static void +_fingerprintPartitionCmd(FingerprintContext *ctx, const PartitionCmd *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->bound != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "partspec"); + _fingerprintString(ctx, "bound"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintPartitionSpec(ctx, node->partspec, node, "partspec", depth + 1); + _fingerprintPartitionBoundSpec(ctx, node->bound, node, "bound", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5146,15 +5482,20 @@ _fingerprintCreateStmt(FingerprintContext *ctx, const CreateStmt *node, const vo XXH3_freeState(prev); } - if (node->relation != NULL) { + if (node->concurrent) { + _fingerprintString(ctx, "concurrent"); + _fingerprintString(ctx, "true"); + } + + if (node->name != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "name"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintRangeVar(ctx, node->name, node, "name", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5163,191 +5504,157 @@ _fingerprintCreateStmt(FingerprintContext *ctx, const CreateStmt *node, const vo XXH3_freeState(prev); } - if (node->tableElts != NULL && node->tableElts->length > 0) { +} + +static void +_fingerprintRangeTblEntry(FingerprintContext *ctx, const RangeTblEntry *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->alias != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "tableElts"); + _fingerprintString(ctx, "alias"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->tableElts, node, "tableElts", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->tableElts) == 1 && linitial(node->tableElts) == NIL)) { + _fingerprintAlias(ctx, node->alias, node, "alias", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->tablespacename != NULL) { - _fingerprintString(ctx, "tablespacename"); - _fingerprintString(ctx, node->tablespacename); - } -} - -static void -_fingerprintDefineStmt(FingerprintContext *ctx, const DefineStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->args != NULL && node->args->length > 0) { + if (node->colcollations != NULL && node->colcollations->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "args"); + _fingerprintString(ctx, "colcollations"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->args, node, "args", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { + _fingerprintNode(ctx, node->colcollations, node, "colcollations", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->colcollations) == 1 && linitial(node->colcollations) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->definition != NULL && node->definition->length > 0) { + if (node->coltypes != NULL && node->coltypes->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "definition"); + _fingerprintString(ctx, "coltypes"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->definition, node, "definition", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->definition) == 1 && linitial(node->definition) == NIL)) { + _fingerprintNode(ctx, node->coltypes, node, "coltypes", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->coltypes) == 1 && linitial(node->coltypes) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->defnames != NULL && node->defnames->length > 0) { + if (node->coltypmods != NULL && node->coltypmods->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "defnames"); + _fingerprintString(ctx, "coltypmods"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->defnames, node, "defnames", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->defnames) == 1 && linitial(node->defnames) == NIL)) { + _fingerprintNode(ctx, node->coltypmods, node, "coltypmods", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->coltypmods) == 1 && linitial(node->coltypmods) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->if_not_exists) { - _fingerprintString(ctx, "if_not_exists"); - _fingerprintString(ctx, "true"); + if (node->ctelevelsup != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->ctelevelsup); + _fingerprintString(ctx, "ctelevelsup"); + _fingerprintString(ctx, buffer); } - if (true) { - _fingerprintString(ctx, "kind"); - _fingerprintString(ctx, _enumToStringObjectType(node->kind)); + if (node->ctename != NULL) { + _fingerprintString(ctx, "ctename"); + _fingerprintString(ctx, node->ctename); } - if (node->oldstyle) { - _fingerprintString(ctx, "oldstyle"); - _fingerprintString(ctx, "true"); + if (node->enrname != NULL) { + _fingerprintString(ctx, "enrname"); + _fingerprintString(ctx, node->enrname); } - if (node->replace) { - _fingerprintString(ctx, "replace"); - _fingerprintString(ctx, "true"); + if (node->enrtuples != 0) { + char buffer[50]; + sprintf(buffer, "%f", node->enrtuples); + _fingerprintString(ctx, "enrtuples"); + _fingerprintString(ctx, buffer); } -} + if (node->eref != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; -static void -_fingerprintDropStmt(FingerprintContext *ctx, const DropStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (true) { - _fingerprintString(ctx, "behavior"); - _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); - } - - if (node->concurrent) { - _fingerprintString(ctx, "concurrent"); - _fingerprintString(ctx, "true"); - } - - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); - _fingerprintString(ctx, "true"); - } - - if (node->objects != NULL && node->objects->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "objects"); + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "eref"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->objects, node, "objects", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objects) == 1 && linitial(node->objects) == NIL)) { + _fingerprintAlias(ctx, node->eref, node, "eref", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "removeType"); - _fingerprintString(ctx, _enumToStringObjectType(node->removeType)); - } - -} -static void -_fingerprintTruncateStmt(FingerprintContext *ctx, const TruncateStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (true) { - _fingerprintString(ctx, "behavior"); - _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); + if (node->funcordinality) { + _fingerprintString(ctx, "funcordinality"); + _fingerprintString(ctx, "true"); } - if (node->relations != NULL && node->relations->length > 0) { + if (node->functions != NULL && node->functions->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relations"); + _fingerprintString(ctx, "functions"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->relations, node, "relations", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->relations) == 1 && linitial(node->relations) == NIL)) { + _fingerprintNode(ctx, node->functions, node, "functions", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->functions) == 1 && linitial(node->functions) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->restart_seqs) { - _fingerprintString(ctx, "restart_seqs"); + if (node->inFromCl) { + _fingerprintString(ctx, "inFromCl"); _fingerprintString(ctx, "true"); } -} - -static void -_fingerprintCommentStmt(FingerprintContext *ctx, const CommentStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->comment != NULL) { - _fingerprintString(ctx, "comment"); - _fingerprintString(ctx, node->comment); + if (node->inh) { + _fingerprintString(ctx, "inh"); + _fingerprintString(ctx, "true"); } - if (node->object != NULL) { + if (node->join_using_alias != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "object"); + _fingerprintString(ctx, "join_using_alias"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->object, node, "object", depth + 1); + _fingerprintAlias(ctx, node->join_using_alias, node, "join_using_alias", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5356,191 +5663,138 @@ _fingerprintCommentStmt(FingerprintContext *ctx, const CommentStmt *node, const XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "objtype"); - _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); - } - -} - -static void -_fingerprintFetchStmt(FingerprintContext *ctx, const FetchStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (true) { - _fingerprintString(ctx, "direction"); - _fingerprintString(ctx, _enumToStringFetchDirection(node->direction)); - } - - if (node->howMany != 0) { - char buffer[50]; - sprintf(buffer, "%ld", node->howMany); - _fingerprintString(ctx, "howMany"); - _fingerprintString(ctx, buffer); - } - - if (node->ismove) { - _fingerprintString(ctx, "ismove"); - _fingerprintString(ctx, "true"); - } - - // Intentionally ignoring node->portalname for fingerprinting - -} - -static void -_fingerprintIndexStmt(FingerprintContext *ctx, const IndexStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->accessMethod != NULL) { - _fingerprintString(ctx, "accessMethod"); - _fingerprintString(ctx, node->accessMethod); - } - - if (node->concurrent) { - _fingerprintString(ctx, "concurrent"); - _fingerprintString(ctx, "true"); - } - - if (node->deferrable) { - _fingerprintString(ctx, "deferrable"); - _fingerprintString(ctx, "true"); - } - - if (node->excludeOpNames != NULL && node->excludeOpNames->length > 0) { + if (node->joinaliasvars != NULL && node->joinaliasvars->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "excludeOpNames"); + _fingerprintString(ctx, "joinaliasvars"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->excludeOpNames, node, "excludeOpNames", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->excludeOpNames) == 1 && linitial(node->excludeOpNames) == NIL)) { + _fingerprintNode(ctx, node->joinaliasvars, node, "joinaliasvars", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->joinaliasvars) == 1 && linitial(node->joinaliasvars) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->idxcomment != NULL) { - _fingerprintString(ctx, "idxcomment"); - _fingerprintString(ctx, node->idxcomment); - } - - if (node->idxname != NULL) { - _fingerprintString(ctx, "idxname"); - _fingerprintString(ctx, node->idxname); - } - - if (node->if_not_exists) { - _fingerprintString(ctx, "if_not_exists"); - _fingerprintString(ctx, "true"); - } - - if (node->indexIncludingParams != NULL && node->indexIncludingParams->length > 0) { + if (node->joinleftcols != NULL && node->joinleftcols->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "indexIncludingParams"); + _fingerprintString(ctx, "joinleftcols"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->indexIncludingParams, node, "indexIncludingParams", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indexIncludingParams) == 1 && linitial(node->indexIncludingParams) == NIL)) { + _fingerprintNode(ctx, node->joinleftcols, node, "joinleftcols", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->joinleftcols) == 1 && linitial(node->joinleftcols) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->indexOid != 0) { + if (node->joinmergedcols != 0) { char buffer[50]; - sprintf(buffer, "%d", node->indexOid); - _fingerprintString(ctx, "indexOid"); + sprintf(buffer, "%d", node->joinmergedcols); + _fingerprintString(ctx, "joinmergedcols"); _fingerprintString(ctx, buffer); } - if (node->indexParams != NULL && node->indexParams->length > 0) { + if (node->joinrightcols != NULL && node->joinrightcols->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "indexParams"); + _fingerprintString(ctx, "joinrightcols"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->indexParams, node, "indexParams", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indexParams) == 1 && linitial(node->indexParams) == NIL)) { + _fingerprintNode(ctx, node->joinrightcols, node, "joinrightcols", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->joinrightcols) == 1 && linitial(node->joinrightcols) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->initdeferred) { - _fingerprintString(ctx, "initdeferred"); - _fingerprintString(ctx, "true"); + if (true) { + _fingerprintString(ctx, "jointype"); + _fingerprintString(ctx, _enumToStringJoinType(node->jointype)); } - if (node->isconstraint) { - _fingerprintString(ctx, "isconstraint"); + if (node->lateral) { + _fingerprintString(ctx, "lateral"); _fingerprintString(ctx, "true"); } - if (node->nulls_not_distinct) { - _fingerprintString(ctx, "nulls_not_distinct"); - _fingerprintString(ctx, "true"); + if (node->perminfoindex != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->perminfoindex); + _fingerprintString(ctx, "perminfoindex"); + _fingerprintString(ctx, buffer); } - if (node->oldCreateSubid != 0) { + if (node->relid != 0) { char buffer[50]; - sprintf(buffer, "%d", node->oldCreateSubid); - _fingerprintString(ctx, "oldCreateSubid"); + sprintf(buffer, "%d", node->relid); + _fingerprintString(ctx, "relid"); _fingerprintString(ctx, buffer); } - if (node->oldFirstRelfilenodeSubid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->oldFirstRelfilenodeSubid); - _fingerprintString(ctx, "oldFirstRelfilenodeSubid"); + if (node->relkind != 0) { + char buffer[2] = {node->relkind, '\0'}; + _fingerprintString(ctx, "relkind"); _fingerprintString(ctx, buffer); } - if (node->oldNode != 0) { + if (node->rellockmode != 0) { char buffer[50]; - sprintf(buffer, "%d", node->oldNode); - _fingerprintString(ctx, "oldNode"); + sprintf(buffer, "%d", node->rellockmode); + _fingerprintString(ctx, "rellockmode"); _fingerprintString(ctx, buffer); } - if (node->options != NULL && node->options->length > 0) { + if (true) { + _fingerprintString(ctx, "rtekind"); + _fingerprintString(ctx, _enumToStringRTEKind(node->rtekind)); + } + + if (node->securityQuals != NULL && node->securityQuals->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "securityQuals"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->securityQuals, node, "securityQuals", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->securityQuals) == 1 && linitial(node->securityQuals) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->primary) { - _fingerprintString(ctx, "primary"); + if (node->security_barrier) { + _fingerprintString(ctx, "security_barrier"); _fingerprintString(ctx, "true"); } - if (node->relation != NULL) { + if (node->self_reference) { + _fingerprintString(ctx, "self_reference"); + _fingerprintString(ctx, "true"); + } + + if (node->subquery != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "subquery"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintQuery(ctx, node->subquery, node, "subquery", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5549,35 +5803,15 @@ _fingerprintIndexStmt(FingerprintContext *ctx, const IndexStmt *node, const void XXH3_freeState(prev); } - if (node->reset_default_tblspc) { - _fingerprintString(ctx, "reset_default_tblspc"); - _fingerprintString(ctx, "true"); - } - - if (node->tableSpace != NULL) { - _fingerprintString(ctx, "tableSpace"); - _fingerprintString(ctx, node->tableSpace); - } - - if (node->transformed) { - _fingerprintString(ctx, "transformed"); - _fingerprintString(ctx, "true"); - } - - if (node->unique) { - _fingerprintString(ctx, "unique"); - _fingerprintString(ctx, "true"); - } - - if (node->whereClause != NULL) { + if (node->tablefunc != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whereClause"); + _fingerprintString(ctx, "tablefunc"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + _fingerprintTableFunc(ctx, node->tablefunc, node, "tablefunc", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5586,185 +5820,200 @@ _fingerprintIndexStmt(FingerprintContext *ctx, const IndexStmt *node, const void XXH3_freeState(prev); } -} - -static void -_fingerprintCreateFunctionStmt(FingerprintContext *ctx, const CreateFunctionStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->funcname != NULL && node->funcname->length > 0) { + if (node->tablesample != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funcname"); + _fingerprintString(ctx, "tablesample"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->funcname, node, "funcname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funcname) == 1 && linitial(node->funcname) == NIL)) { + _fingerprintTableSampleClause(ctx, node->tablesample, node, "tablesample", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->is_procedure) { - _fingerprintString(ctx, "is_procedure"); - _fingerprintString(ctx, "true"); - } - // Intentionally ignoring node->options for fingerprinting - - if (node->parameters != NULL && node->parameters->length > 0) { + if (node->values_lists != NULL && node->values_lists->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "parameters"); + _fingerprintString(ctx, "values_lists"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->parameters, node, "parameters", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->parameters) == 1 && linitial(node->parameters) == NIL)) { + _fingerprintNode(ctx, node->values_lists, node, "values_lists", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->values_lists) == 1 && linitial(node->values_lists) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->replace) { - _fingerprintString(ctx, "replace"); +} + +static void +_fingerprintRTEPermissionInfo(FingerprintContext *ctx, const RTEPermissionInfo *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->checkAsUser != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->checkAsUser); + _fingerprintString(ctx, "checkAsUser"); + _fingerprintString(ctx, buffer); + } + + if (node->inh) { + _fingerprintString(ctx, "inh"); _fingerprintString(ctx, "true"); } - if (node->returnType != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; + if (true) { + int x = -1; + Bitmapset *bms = bms_copy(node->insertedCols); - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "returnType"); + _fingerprintString(ctx, "insertedCols"); - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->returnType, node, "returnType", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); + while ((x = bms_next_member(bms, x)) >= 0) { + char buffer[50]; + sprintf(buffer, "%d", x); + _fingerprintString(ctx, buffer); } - XXH3_freeState(prev); + + bms_free(bms); } - if (node->sql_body != NULL) { + if (node->relid != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->relid); + _fingerprintString(ctx, "relid"); + _fingerprintString(ctx, buffer); + } + + if (node->requiredPerms != 0) { + char buffer[50]; + sprintf(buffer, "%ld", node->requiredPerms); + _fingerprintString(ctx, "requiredPerms"); + _fingerprintString(ctx, buffer); + } + + if (true) { + int x = -1; + Bitmapset *bms = bms_copy(node->selectedCols); + + _fingerprintString(ctx, "selectedCols"); + + while ((x = bms_next_member(bms, x)) >= 0) { + char buffer[50]; + sprintf(buffer, "%d", x); + _fingerprintString(ctx, buffer); + } + + bms_free(bms); + } + + if (true) { + int x = -1; + Bitmapset *bms = bms_copy(node->updatedCols); + + _fingerprintString(ctx, "updatedCols"); + + while ((x = bms_next_member(bms, x)) >= 0) { + char buffer[50]; + sprintf(buffer, "%d", x); + _fingerprintString(ctx, buffer); + } + + bms_free(bms); + } + +} + +static void +_fingerprintRangeTblFunction(FingerprintContext *ctx, const RangeTblFunction *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->funccolcollations != NULL && node->funccolcollations->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "sql_body"); + _fingerprintString(ctx, "funccolcollations"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->sql_body, node, "sql_body", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->funccolcollations, node, "funccolcollations", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funccolcollations) == 1 && linitial(node->funccolcollations) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->funccolcount != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->funccolcount); + _fingerprintString(ctx, "funccolcount"); + _fingerprintString(ctx, buffer); + } -} - -static void -_fingerprintAlterFunctionStmt(FingerprintContext *ctx, const AlterFunctionStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->actions != NULL && node->actions->length > 0) { + if (node->funccolnames != NULL && node->funccolnames->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "actions"); + _fingerprintString(ctx, "funccolnames"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->actions, node, "actions", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->actions) == 1 && linitial(node->actions) == NIL)) { + _fingerprintNode(ctx, node->funccolnames, node, "funccolnames", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funccolnames) == 1 && linitial(node->funccolnames) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->func != NULL) { + if (node->funccoltypes != NULL && node->funccoltypes->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "func"); + _fingerprintString(ctx, "funccoltypes"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintObjectWithArgs(ctx, node->func, node, "func", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->funccoltypes, node, "funccoltypes", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funccoltypes) == 1 && linitial(node->funccoltypes) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (true) { - _fingerprintString(ctx, "objtype"); - _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); - } - -} - -static void -_fingerprintDoStmt(FingerprintContext *ctx, const DoStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - // Intentionally ignoring node->args for fingerprinting - -} - -static void -_fingerprintRenameStmt(FingerprintContext *ctx, const RenameStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (true) { - _fingerprintString(ctx, "behavior"); - _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); - } - - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); - _fingerprintString(ctx, "true"); - } - - if (node->newname != NULL) { - _fingerprintString(ctx, "newname"); - _fingerprintString(ctx, node->newname); - } - - if (node->object != NULL) { + if (node->funccoltypmods != NULL && node->funccoltypmods->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "object"); + _fingerprintString(ctx, "funccoltypmods"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->object, node, "object", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->funccoltypmods, node, "funccoltypmods", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funccoltypmods) == 1 && linitial(node->funccoltypmods) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->relation != NULL) { + if (node->funcexpr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "funcexpr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintNode(ctx, node->funcexpr, node, "funcexpr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5774,60 +6023,50 @@ _fingerprintRenameStmt(FingerprintContext *ctx, const RenameStmt *node, const vo } if (true) { - _fingerprintString(ctx, "relationType"); - _fingerprintString(ctx, _enumToStringObjectType(node->relationType)); - } + int x = -1; + Bitmapset *bms = bms_copy(node->funcparams); - if (true) { - _fingerprintString(ctx, "renameType"); - _fingerprintString(ctx, _enumToStringObjectType(node->renameType)); - } + _fingerprintString(ctx, "funcparams"); - if (node->subname != NULL) { - _fingerprintString(ctx, "subname"); - _fingerprintString(ctx, node->subname); + while ((x = bms_next_member(bms, x)) >= 0) { + char buffer[50]; + sprintf(buffer, "%d", x); + _fingerprintString(ctx, buffer); + } + + bms_free(bms); } } static void -_fingerprintRuleStmt(FingerprintContext *ctx, const RuleStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintTableSampleClause(FingerprintContext *ctx, const TableSampleClause *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->actions != NULL && node->actions->length > 0) { + if (node->args != NULL && node->args->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "actions"); + _fingerprintString(ctx, "args"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->actions, node, "actions", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->actions) == 1 && linitial(node->actions) == NIL)) { + _fingerprintNode(ctx, node->args, node, "args", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "event"); - _fingerprintString(ctx, _enumToStringCmdType(node->event)); - } - - if (node->instead) { - _fingerprintString(ctx, "instead"); - _fingerprintString(ctx, "true"); - } - - if (node->relation != NULL) { + if (node->repeatable != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "repeatable"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintNode(ctx, node->repeatable, node, "repeatable", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5836,25 +6075,42 @@ _fingerprintRuleStmt(FingerprintContext *ctx, const RuleStmt *node, const void * XXH3_freeState(prev); } - if (node->replace) { - _fingerprintString(ctx, "replace"); + if (node->tsmhandler != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->tsmhandler); + _fingerprintString(ctx, "tsmhandler"); + _fingerprintString(ctx, buffer); + } + +} + +static void +_fingerprintWithCheckOption(FingerprintContext *ctx, const WithCheckOption *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->cascaded) { + _fingerprintString(ctx, "cascaded"); _fingerprintString(ctx, "true"); } - if (node->rulename != NULL) { - _fingerprintString(ctx, "rulename"); - _fingerprintString(ctx, node->rulename); + if (true) { + _fingerprintString(ctx, "kind"); + _fingerprintString(ctx, _enumToStringWCOKind(node->kind)); } - if (node->whereClause != NULL) { + if (node->polname != NULL) { + _fingerprintString(ctx, "polname"); + _fingerprintString(ctx, node->polname); + } + + if (node->qual != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whereClause"); + _fingerprintString(ctx, "qual"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + _fingerprintNode(ctx, node->qual, node, "qual", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5863,121 +6119,207 @@ _fingerprintRuleStmt(FingerprintContext *ctx, const RuleStmt *node, const void * XXH3_freeState(prev); } + if (node->relname != NULL) { + _fingerprintString(ctx, "relname"); + _fingerprintString(ctx, node->relname); + } + } static void -_fingerprintNotifyStmt(FingerprintContext *ctx, const NotifyStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintSortGroupClause(FingerprintContext *ctx, const SortGroupClause *node, const void *parent, const char *field_name, unsigned int depth) { - // Intentionally ignoring node->conditionname for fingerprinting + if (node->eqop != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->eqop); + _fingerprintString(ctx, "eqop"); + _fingerprintString(ctx, buffer); + } - if (node->payload != NULL) { - _fingerprintString(ctx, "payload"); - _fingerprintString(ctx, node->payload); + if (node->hashable) { + _fingerprintString(ctx, "hashable"); + _fingerprintString(ctx, "true"); } -} + if (node->nulls_first) { + _fingerprintString(ctx, "nulls_first"); + _fingerprintString(ctx, "true"); + } -static void -_fingerprintListenStmt(FingerprintContext *ctx, const ListenStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - // Intentionally ignoring node->conditionname for fingerprinting + if (node->sortop != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->sortop); + _fingerprintString(ctx, "sortop"); + _fingerprintString(ctx, buffer); + } + + if (node->tleSortGroupRef != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->tleSortGroupRef); + _fingerprintString(ctx, "tleSortGroupRef"); + _fingerprintString(ctx, buffer); + } } static void -_fingerprintUnlistenStmt(FingerprintContext *ctx, const UnlistenStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintGroupingSet(FingerprintContext *ctx, const GroupingSet *node, const void *parent, const char *field_name, unsigned int depth) { - // Intentionally ignoring node->conditionname for fingerprinting + if (node->content != NULL && node->content->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "content"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->content, node, "content", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->content) == 1 && linitial(node->content) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (true) { + _fingerprintString(ctx, "kind"); + _fingerprintString(ctx, _enumToStringGroupingSetKind(node->kind)); + } + + // Intentionally ignoring node->location for fingerprinting } static void -_fingerprintTransactionStmt(FingerprintContext *ctx, const TransactionStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintWindowClause(FingerprintContext *ctx, const WindowClause *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->chain) { - _fingerprintString(ctx, "chain"); + if (node->copiedOrder) { + _fingerprintString(ctx, "copiedOrder"); _fingerprintString(ctx, "true"); } - // Intentionally ignoring node->gid for fingerprinting + if (node->endInRangeFunc != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->endInRangeFunc); + _fingerprintString(ctx, "endInRangeFunc"); + _fingerprintString(ctx, buffer); + } - if (true) { - _fingerprintString(ctx, "kind"); - _fingerprintString(ctx, _enumToStringTransactionStmtKind(node->kind)); + if (node->endOffset != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "endOffset"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->endOffset, node, "endOffset", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); } - // Intentionally ignoring node->options for fingerprinting + if (node->frameOptions != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->frameOptions); + _fingerprintString(ctx, "frameOptions"); + _fingerprintString(ctx, buffer); + } - // Intentionally ignoring node->savepoint_name for fingerprinting + if (node->inRangeAsc) { + _fingerprintString(ctx, "inRangeAsc"); + _fingerprintString(ctx, "true"); + } -} + if (node->inRangeColl != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->inRangeColl); + _fingerprintString(ctx, "inRangeColl"); + _fingerprintString(ctx, buffer); + } -static void -_fingerprintViewStmt(FingerprintContext *ctx, const ViewStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->aliases != NULL && node->aliases->length > 0) { + if (node->inRangeNullsFirst) { + _fingerprintString(ctx, "inRangeNullsFirst"); + _fingerprintString(ctx, "true"); + } + + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); + } + + if (node->orderClause != NULL && node->orderClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "aliases"); + _fingerprintString(ctx, "orderClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->aliases, node, "aliases", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->aliases) == 1 && linitial(node->aliases) == NIL)) { + _fingerprintNode(ctx, node->orderClause, node, "orderClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->orderClause) == 1 && linitial(node->orderClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->options != NULL && node->options->length > 0) { + if (node->partitionClause != NULL && node->partitionClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "partitionClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->partitionClause, node, "partitionClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->partitionClause) == 1 && linitial(node->partitionClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->query != NULL) { + if (node->refname != NULL) { + _fingerprintString(ctx, "refname"); + _fingerprintString(ctx, node->refname); + } + + if (node->runCondition != NULL && node->runCondition->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "query"); + _fingerprintString(ctx, "runCondition"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->query, node, "query", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->runCondition, node, "runCondition", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->runCondition) == 1 && linitial(node->runCondition) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->replace) { - _fingerprintString(ctx, "replace"); - _fingerprintString(ctx, "true"); + if (node->startInRangeFunc != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->startInRangeFunc); + _fingerprintString(ctx, "startInRangeFunc"); + _fingerprintString(ctx, buffer); } - if (node->view != NULL) { + if (node->startOffset != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "view"); + _fingerprintString(ctx, "startOffset"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->view, node, "view", depth + 1); + _fingerprintNode(ctx, node->startOffset, node, "startOffset", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -5986,84 +6328,105 @@ _fingerprintViewStmt(FingerprintContext *ctx, const ViewStmt *node, const void * XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "withCheckOption"); - _fingerprintString(ctx, _enumToStringViewCheckOption(node->withCheckOption)); + if (node->winref != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->winref); + _fingerprintString(ctx, "winref"); + _fingerprintString(ctx, buffer); } } static void -_fingerprintLoadStmt(FingerprintContext *ctx, const LoadStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintRowMarkClause(FingerprintContext *ctx, const RowMarkClause *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->filename != NULL) { - _fingerprintString(ctx, "filename"); - _fingerprintString(ctx, node->filename); + if (node->pushedDown) { + _fingerprintString(ctx, "pushedDown"); + _fingerprintString(ctx, "true"); + } + + if (node->rti != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->rti); + _fingerprintString(ctx, "rti"); + _fingerprintString(ctx, buffer); + } + + if (true) { + _fingerprintString(ctx, "strength"); + _fingerprintString(ctx, _enumToStringLockClauseStrength(node->strength)); + } + + if (true) { + _fingerprintString(ctx, "waitPolicy"); + _fingerprintString(ctx, _enumToStringLockWaitPolicy(node->waitPolicy)); } } static void -_fingerprintCreateDomainStmt(FingerprintContext *ctx, const CreateDomainStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintWithClause(FingerprintContext *ctx, const WithClause *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->collClause != NULL) { + if (node->ctes != NULL && node->ctes->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "collClause"); + _fingerprintString(ctx, "ctes"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintCollateClause(ctx, node->collClause, node, "collClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->ctes, node, "ctes", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->ctes) == 1 && linitial(node->ctes) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + // Intentionally ignoring node->location for fingerprinting - if (node->constraints != NULL && node->constraints->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; + if (node->recursive) { + _fingerprintString(ctx, "recursive"); + _fingerprintString(ctx, "true"); + } - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "constraints"); +} - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->constraints, node, "constraints", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->constraints) == 1 && linitial(node->constraints) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); +static void +_fingerprintInferClause(FingerprintContext *ctx, const InferClause *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->conname != NULL) { + _fingerprintString(ctx, "conname"); + _fingerprintString(ctx, node->conname); } - if (node->domainname != NULL && node->domainname->length > 0) { + + if (node->indexElems != NULL && node->indexElems->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "domainname"); + _fingerprintString(ctx, "indexElems"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->domainname, node, "domainname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->domainname) == 1 && linitial(node->domainname) == NIL)) { + _fingerprintNode(ctx, node->indexElems, node, "indexElems", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indexElems) == 1 && linitial(node->indexElems) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->typeName != NULL) { + // Intentionally ignoring node->location for fingerprinting + + if (node->whereClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typeName"); + _fingerprintString(ctx, "whereClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); + _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -6075,132 +6438,140 @@ _fingerprintCreateDomainStmt(FingerprintContext *ctx, const CreateDomainStmt *no } static void -_fingerprintCreatedbStmt(FingerprintContext *ctx, const CreatedbStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintOnConflictClause(FingerprintContext *ctx, const OnConflictClause *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->dbname != NULL) { - _fingerprintString(ctx, "dbname"); - _fingerprintString(ctx, node->dbname); + if (true) { + _fingerprintString(ctx, "action"); + _fingerprintString(ctx, _enumToStringOnConflictAction(node->action)); } - if (node->options != NULL && node->options->length > 0) { + if (node->infer != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "infer"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintInferClause(ctx, node->infer, node, "infer", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintDropdbStmt(FingerprintContext *ctx, const DropdbStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->dbname != NULL) { - _fingerprintString(ctx, "dbname"); - _fingerprintString(ctx, node->dbname); - } - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); - _fingerprintString(ctx, "true"); - } + // Intentionally ignoring node->location for fingerprinting - if (node->options != NULL && node->options->length > 0) { + if (node->targetList != NULL && node->targetList->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "targetList"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintVacuumStmt(FingerprintContext *ctx, const VacuumStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->is_vacuumcmd) { - _fingerprintString(ctx, "is_vacuumcmd"); - _fingerprintString(ctx, "true"); - } - - if (node->options != NULL && node->options->length > 0) { + if (node->whereClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "whereClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->rels != NULL && node->rels->length > 0) { + +} + +static void +_fingerprintCTESearchClause(FingerprintContext *ctx, const CTESearchClause *node, const void *parent, const char *field_name, unsigned int depth) +{ + // Intentionally ignoring node->location for fingerprinting + + if (node->search_breadth_first) { + _fingerprintString(ctx, "search_breadth_first"); + _fingerprintString(ctx, "true"); + } + + if (node->search_col_list != NULL && node->search_col_list->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "rels"); + _fingerprintString(ctx, "search_col_list"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->rels, node, "rels", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->rels) == 1 && linitial(node->rels) == NIL)) { + _fingerprintNode(ctx, node->search_col_list, node, "search_col_list", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->search_col_list) == 1 && linitial(node->search_col_list) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->search_seq_column != NULL) { + _fingerprintString(ctx, "search_seq_column"); + _fingerprintString(ctx, node->search_seq_column); + } + } static void -_fingerprintExplainStmt(FingerprintContext *ctx, const ExplainStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCTECycleClause(FingerprintContext *ctx, const CTECycleClause *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->options != NULL && node->options->length > 0) { + if (node->cycle_col_list != NULL && node->cycle_col_list->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "cycle_col_list"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->cycle_col_list, node, "cycle_col_list", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cycle_col_list) == 1 && linitial(node->cycle_col_list) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->query != NULL) { + if (node->cycle_mark_collation != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->cycle_mark_collation); + _fingerprintString(ctx, "cycle_mark_collation"); + _fingerprintString(ctx, buffer); + } + + if (node->cycle_mark_column != NULL) { + _fingerprintString(ctx, "cycle_mark_column"); + _fingerprintString(ctx, node->cycle_mark_column); + } + + if (node->cycle_mark_default != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "query"); + _fingerprintString(ctx, "cycle_mark_default"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->query, node, "query", depth + 1); + _fingerprintNode(ctx, node->cycle_mark_default, node, "cycle_mark_default", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -6209,25 +6580,36 @@ _fingerprintExplainStmt(FingerprintContext *ctx, const ExplainStmt *node, const XXH3_freeState(prev); } -} + if (node->cycle_mark_neop != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->cycle_mark_neop); + _fingerprintString(ctx, "cycle_mark_neop"); + _fingerprintString(ctx, buffer); + } -static void -_fingerprintCreateTableAsStmt(FingerprintContext *ctx, const CreateTableAsStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->if_not_exists) { - _fingerprintString(ctx, "if_not_exists"); - _fingerprintString(ctx, "true"); + if (node->cycle_mark_type != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->cycle_mark_type); + _fingerprintString(ctx, "cycle_mark_type"); + _fingerprintString(ctx, buffer); } - if (node->into != NULL) { + if (node->cycle_mark_typmod != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->cycle_mark_typmod); + _fingerprintString(ctx, "cycle_mark_typmod"); + _fingerprintString(ctx, buffer); + } + + if (node->cycle_mark_value != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "into"); + _fingerprintString(ctx, "cycle_mark_value"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintIntoClause(ctx, node->into, node, "into", depth + 1); + _fingerprintNode(ctx, node->cycle_mark_value, node, "cycle_mark_value", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -6236,348 +6618,362 @@ _fingerprintCreateTableAsStmt(FingerprintContext *ctx, const CreateTableAsStmt * XXH3_freeState(prev); } - if (node->is_select_into) { - _fingerprintString(ctx, "is_select_into"); - _fingerprintString(ctx, "true"); + if (node->cycle_path_column != NULL) { + _fingerprintString(ctx, "cycle_path_column"); + _fingerprintString(ctx, node->cycle_path_column); } - if (true) { - _fingerprintString(ctx, "objtype"); - _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); - } + // Intentionally ignoring node->location for fingerprinting - if (node->query != NULL) { +} + +static void +_fingerprintCommonTableExpr(FingerprintContext *ctx, const CommonTableExpr *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->aliascolnames != NULL && node->aliascolnames->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "query"); + _fingerprintString(ctx, "aliascolnames"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->query, node, "query", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->aliascolnames, node, "aliascolnames", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->aliascolnames) == 1 && linitial(node->aliascolnames) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - -} - -static void -_fingerprintCreateSeqStmt(FingerprintContext *ctx, const CreateSeqStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->for_identity) { - _fingerprintString(ctx, "for_identity"); - _fingerprintString(ctx, "true"); - } - - if (node->if_not_exists) { - _fingerprintString(ctx, "if_not_exists"); - _fingerprintString(ctx, "true"); - } - - if (node->options != NULL && node->options->length > 0) { + if (node->ctecolcollations != NULL && node->ctecolcollations->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "ctecolcollations"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->ctecolcollations, node, "ctecolcollations", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->ctecolcollations) == 1 && linitial(node->ctecolcollations) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->ownerId != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->ownerId); - _fingerprintString(ctx, "ownerId"); - _fingerprintString(ctx, buffer); - } - - if (node->sequence != NULL) { + if (node->ctecolnames != NULL && node->ctecolnames->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "sequence"); + _fingerprintString(ctx, "ctecolnames"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->sequence, node, "sequence", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->ctecolnames, node, "ctecolnames", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->ctecolnames) == 1 && linitial(node->ctecolnames) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - -} - -static void -_fingerprintAlterSeqStmt(FingerprintContext *ctx, const AlterSeqStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->for_identity) { - _fingerprintString(ctx, "for_identity"); - _fingerprintString(ctx, "true"); - } - - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); - _fingerprintString(ctx, "true"); - } - - if (node->options != NULL && node->options->length > 0) { + if (node->ctecoltypes != NULL && node->ctecoltypes->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "ctecoltypes"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->ctecoltypes, node, "ctecoltypes", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->ctecoltypes) == 1 && linitial(node->ctecoltypes) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->sequence != NULL) { + if (node->ctecoltypmods != NULL && node->ctecoltypmods->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "sequence"); + _fingerprintString(ctx, "ctecoltypmods"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->sequence, node, "sequence", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->ctecoltypmods, node, "ctecoltypmods", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->ctecoltypmods) == 1 && linitial(node->ctecoltypmods) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (true) { + _fingerprintString(ctx, "ctematerialized"); + _fingerprintString(ctx, _enumToStringCTEMaterialize(node->ctematerialized)); + } -} + if (node->ctename != NULL) { + _fingerprintString(ctx, "ctename"); + _fingerprintString(ctx, node->ctename); + } -static void -_fingerprintVariableSetStmt(FingerprintContext *ctx, const VariableSetStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->args != NULL && node->args->length > 0) { + if (node->ctequery != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "args"); + _fingerprintString(ctx, "ctequery"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->args, node, "args", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { + _fingerprintNode(ctx, node->ctequery, node, "ctequery", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->is_local) { - _fingerprintString(ctx, "is_local"); - _fingerprintString(ctx, "true"); - } - if (true) { - _fingerprintString(ctx, "kind"); - _fingerprintString(ctx, _enumToStringVariableSetKind(node->kind)); + if (node->cterecursive) { + _fingerprintString(ctx, "cterecursive"); + _fingerprintString(ctx, "true"); } - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); + if (node->cterefcount != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->cterefcount); + _fingerprintString(ctx, "cterefcount"); + _fingerprintString(ctx, buffer); } -} + if (node->cycle_clause != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; -static void -_fingerprintVariableShowStmt(FingerprintContext *ctx, const VariableShowStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "cycle_clause"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintCTECycleClause(ctx, node->cycle_clause, node, "cycle_clause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); } -} + // Intentionally ignoring node->location for fingerprinting -static void -_fingerprintDiscardStmt(FingerprintContext *ctx, const DiscardStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (true) { - _fingerprintString(ctx, "target"); - _fingerprintString(ctx, _enumToStringDiscardMode(node->target)); + if (node->search_clause != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "search_clause"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintCTESearchClause(ctx, node->search_clause, node, "search_clause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); } } static void -_fingerprintCreateTrigStmt(FingerprintContext *ctx, const CreateTrigStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintMergeWhenClause(FingerprintContext *ctx, const MergeWhenClause *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->args != NULL && node->args->length > 0) { + if (true) { + _fingerprintString(ctx, "commandType"); + _fingerprintString(ctx, _enumToStringCmdType(node->commandType)); + } + + if (node->condition != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "args"); + _fingerprintString(ctx, "condition"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->args, node, "args", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { + _fingerprintNode(ctx, node->condition, node, "condition", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->columns != NULL && node->columns->length > 0) { + + if (node->matched) { + _fingerprintString(ctx, "matched"); + _fingerprintString(ctx, "true"); + } + + if (true) { + _fingerprintString(ctx, "override"); + _fingerprintString(ctx, _enumToStringOverridingKind(node->override)); + } + + if (node->targetList != NULL && node->targetList->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "columns"); + _fingerprintString(ctx, "targetList"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->columns, node, "columns", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->columns) == 1 && linitial(node->columns) == NIL)) { + _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->constrrel != NULL) { + if (node->values != NULL && node->values->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "constrrel"); + _fingerprintString(ctx, "values"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->constrrel, node, "constrrel", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->values, node, "values", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->values) == 1 && linitial(node->values) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->deferrable) { - _fingerprintString(ctx, "deferrable"); +static void +_fingerprintMergeAction(FingerprintContext *ctx, const MergeAction *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (true) { + _fingerprintString(ctx, "commandType"); + _fingerprintString(ctx, _enumToStringCmdType(node->commandType)); + } + + if (node->matched) { + _fingerprintString(ctx, "matched"); _fingerprintString(ctx, "true"); } - if (node->events != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->events); - _fingerprintString(ctx, "events"); - _fingerprintString(ctx, buffer); + if (true) { + _fingerprintString(ctx, "override"); + _fingerprintString(ctx, _enumToStringOverridingKind(node->override)); } - if (node->funcname != NULL && node->funcname->length > 0) { + if (node->qual != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funcname"); + _fingerprintString(ctx, "qual"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->funcname, node, "funcname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funcname) == 1 && linitial(node->funcname) == NIL)) { + _fingerprintNode(ctx, node->qual, node, "qual", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->initdeferred) { - _fingerprintString(ctx, "initdeferred"); - _fingerprintString(ctx, "true"); - } - if (node->isconstraint) { - _fingerprintString(ctx, "isconstraint"); - _fingerprintString(ctx, "true"); - } + if (node->targetList != NULL && node->targetList->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; - if (node->relation != NULL) { + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "targetList"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->updateColnos != NULL && node->updateColnos->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "updateColnos"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->updateColnos, node, "updateColnos", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->updateColnos) == 1 && linitial(node->updateColnos) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->replace) { - _fingerprintString(ctx, "replace"); +static void +_fingerprintTriggerTransition(FingerprintContext *ctx, const TriggerTransition *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->isNew) { + _fingerprintString(ctx, "isNew"); _fingerprintString(ctx, "true"); } - if (node->row) { - _fingerprintString(ctx, "row"); + if (node->isTable) { + _fingerprintString(ctx, "isTable"); _fingerprintString(ctx, "true"); } - if (node->timing != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->timing); - _fingerprintString(ctx, "timing"); - _fingerprintString(ctx, buffer); + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); } - if (node->transitionRels != NULL && node->transitionRels->length > 0) { +} + +static void +_fingerprintJsonOutput(FingerprintContext *ctx, const JsonOutput *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->returning != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "transitionRels"); + _fingerprintString(ctx, "returning"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->transitionRels, node, "transitionRels", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->transitionRels) == 1 && linitial(node->transitionRels) == NIL)) { + _fingerprintJsonReturning(ctx, node->returning, node, "returning", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->trigname != NULL) { - _fingerprintString(ctx, "trigname"); - _fingerprintString(ctx, node->trigname); - } - if (node->whenClause != NULL) { + if (node->typeName != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whenClause"); + _fingerprintString(ctx, "typeName"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whenClause, node, "whenClause", depth + 1); + _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -6589,139 +6985,129 @@ _fingerprintCreateTrigStmt(FingerprintContext *ctx, const CreateTrigStmt *node, } static void -_fingerprintCreatePLangStmt(FingerprintContext *ctx, const CreatePLangStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintJsonKeyValue(FingerprintContext *ctx, const JsonKeyValue *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->plhandler != NULL && node->plhandler->length > 0) { + if (node->key != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "plhandler"); + _fingerprintString(ctx, "key"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->plhandler, node, "plhandler", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->plhandler) == 1 && linitial(node->plhandler) == NIL)) { + _fingerprintNode(ctx, node->key, node, "key", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->plinline != NULL && node->plinline->length > 0) { + + if (node->value != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "plinline"); + _fingerprintString(ctx, "value"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->plinline, node, "plinline", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->plinline) == 1 && linitial(node->plinline) == NIL)) { + _fingerprintJsonValueExpr(ctx, node->value, node, "value", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->plname != NULL) { - _fingerprintString(ctx, "plname"); - _fingerprintString(ctx, node->plname); - } - if (node->pltrusted) { - _fingerprintString(ctx, "pltrusted"); +} + +static void +_fingerprintJsonObjectConstructor(FingerprintContext *ctx, const JsonObjectConstructor *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->absent_on_null) { + _fingerprintString(ctx, "absent_on_null"); _fingerprintString(ctx, "true"); } - if (node->plvalidator != NULL && node->plvalidator->length > 0) { + if (node->exprs != NULL && node->exprs->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "plvalidator"); + _fingerprintString(ctx, "exprs"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->plvalidator, node, "plvalidator", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->plvalidator) == 1 && linitial(node->plvalidator) == NIL)) { + _fingerprintNode(ctx, node->exprs, node, "exprs", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->exprs) == 1 && linitial(node->exprs) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->replace) { - _fingerprintString(ctx, "replace"); - _fingerprintString(ctx, "true"); - } - -} + // Intentionally ignoring node->location for fingerprinting -static void -_fingerprintCreateRoleStmt(FingerprintContext *ctx, const CreateRoleStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->options != NULL && node->options->length > 0) { + if (node->output != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "output"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintJsonOutput(ctx, node->output, node, "output", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->role != NULL) { - _fingerprintString(ctx, "role"); - _fingerprintString(ctx, node->role); - } - if (true) { - _fingerprintString(ctx, "stmt_type"); - _fingerprintString(ctx, _enumToStringRoleStmtType(node->stmt_type)); + if (node->unique) { + _fingerprintString(ctx, "unique"); + _fingerprintString(ctx, "true"); } } static void -_fingerprintAlterRoleStmt(FingerprintContext *ctx, const AlterRoleStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintJsonArrayConstructor(FingerprintContext *ctx, const JsonArrayConstructor *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->action != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->action); - _fingerprintString(ctx, "action"); - _fingerprintString(ctx, buffer); + if (node->absent_on_null) { + _fingerprintString(ctx, "absent_on_null"); + _fingerprintString(ctx, "true"); } - if (node->options != NULL && node->options->length > 0) { + if (node->exprs != NULL && node->exprs->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "exprs"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->exprs, node, "exprs", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->exprs) == 1 && linitial(node->exprs) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->role != NULL) { + // Intentionally ignoring node->location for fingerprinting + + if (node->output != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "role"); + _fingerprintString(ctx, "output"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->role, node, "role", depth + 1); + _fingerprintJsonOutput(ctx, node->output, node, "output", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -6733,155 +7119,115 @@ _fingerprintAlterRoleStmt(FingerprintContext *ctx, const AlterRoleStmt *node, co } static void -_fingerprintDropRoleStmt(FingerprintContext *ctx, const DropRoleStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintJsonArrayQueryConstructor(FingerprintContext *ctx, const JsonArrayQueryConstructor *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); + if (node->absent_on_null) { + _fingerprintString(ctx, "absent_on_null"); _fingerprintString(ctx, "true"); } - if (node->roles != NULL && node->roles->length > 0) { + if (node->format != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "roles"); + _fingerprintString(ctx, "format"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { + _fingerprintJsonFormat(ctx, node->format, node, "format", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintLockStmt(FingerprintContext *ctx, const LockStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->mode != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->mode); - _fingerprintString(ctx, "mode"); - _fingerprintString(ctx, buffer); - } - if (node->nowait) { - _fingerprintString(ctx, "nowait"); - _fingerprintString(ctx, "true"); - } + // Intentionally ignoring node->location for fingerprinting - if (node->relations != NULL && node->relations->length > 0) { + if (node->output != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relations"); + _fingerprintString(ctx, "output"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->relations, node, "relations", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->relations) == 1 && linitial(node->relations) == NIL)) { + _fingerprintJsonOutput(ctx, node->output, node, "output", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} -static void -_fingerprintConstraintsSetStmt(FingerprintContext *ctx, const ConstraintsSetStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->constraints != NULL && node->constraints->length > 0) { + if (node->query != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "constraints"); + _fingerprintString(ctx, "query"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->constraints, node, "constraints", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->constraints) == 1 && linitial(node->constraints) == NIL)) { + _fingerprintNode(ctx, node->query, node, "query", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->deferred) { - _fingerprintString(ctx, "deferred"); - _fingerprintString(ctx, "true"); - } } static void -_fingerprintReindexStmt(FingerprintContext *ctx, const ReindexStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintJsonAggConstructor(FingerprintContext *ctx, const JsonAggConstructor *node, const void *parent, const char *field_name, unsigned int depth) { - if (true) { - _fingerprintString(ctx, "kind"); - _fingerprintString(ctx, _enumToStringReindexObjectType(node->kind)); - } - - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); - } - - if (node->params != NULL && node->params->length > 0) { + if (node->agg_filter != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "params"); + _fingerprintString(ctx, "agg_filter"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->params, node, "params", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->params) == 1 && linitial(node->params) == NIL)) { + _fingerprintNode(ctx, node->agg_filter, node, "agg_filter", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->relation != NULL) { + + if (node->agg_order != NULL && node->agg_order->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "agg_order"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->agg_order, node, "agg_order", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->agg_order) == 1 && linitial(node->agg_order) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + // Intentionally ignoring node->location for fingerprinting -} - -static void -_fingerprintCheckPointStmt(FingerprintContext *ctx, const CheckPointStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ -} - -static void -_fingerprintCreateSchemaStmt(FingerprintContext *ctx, const CreateSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->authrole != NULL) { + if (node->output != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "authrole"); + _fingerprintString(ctx, "output"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->authrole, node, "authrole", depth + 1); + _fingerprintJsonOutput(ctx, node->output, node, "output", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -6890,87 +7236,59 @@ _fingerprintCreateSchemaStmt(FingerprintContext *ctx, const CreateSchemaStmt *no XXH3_freeState(prev); } - if (node->if_not_exists) { - _fingerprintString(ctx, "if_not_exists"); - _fingerprintString(ctx, "true"); - } - - if (node->schemaElts != NULL && node->schemaElts->length > 0) { + if (node->over != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "schemaElts"); + _fingerprintString(ctx, "over"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->schemaElts, node, "schemaElts", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->schemaElts) == 1 && linitial(node->schemaElts) == NIL)) { + _fingerprintWindowDef(ctx, node->over, node, "over", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->schemaname != NULL) { - _fingerprintString(ctx, "schemaname"); - _fingerprintString(ctx, node->schemaname); - } } static void -_fingerprintAlterDatabaseStmt(FingerprintContext *ctx, const AlterDatabaseStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintJsonObjectAgg(FingerprintContext *ctx, const JsonObjectAgg *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->dbname != NULL) { - _fingerprintString(ctx, "dbname"); - _fingerprintString(ctx, node->dbname); + if (node->absent_on_null) { + _fingerprintString(ctx, "absent_on_null"); + _fingerprintString(ctx, "true"); } - if (node->options != NULL && node->options->length > 0) { + if (node->arg != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "arg"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintJsonKeyValue(ctx, node->arg, node, "arg", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintAlterDatabaseRefreshCollStmt(FingerprintContext *ctx, const AlterDatabaseRefreshCollStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->dbname != NULL) { - _fingerprintString(ctx, "dbname"); - _fingerprintString(ctx, node->dbname); - } - -} - -static void -_fingerprintAlterDatabaseSetStmt(FingerprintContext *ctx, const AlterDatabaseSetStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->dbname != NULL) { - _fingerprintString(ctx, "dbname"); - _fingerprintString(ctx, node->dbname); - } - if (node->setstmt != NULL) { + if (node->constructor != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "setstmt"); + _fingerprintString(ctx, "constructor"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintVariableSetStmt(ctx, node->setstmt, node, "setstmt", depth + 1); + _fingerprintJsonAggConstructor(ctx, node->constructor, node, "constructor", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -6979,25 +7297,30 @@ _fingerprintAlterDatabaseSetStmt(FingerprintContext *ctx, const AlterDatabaseSet XXH3_freeState(prev); } + if (node->unique) { + _fingerprintString(ctx, "unique"); + _fingerprintString(ctx, "true"); + } + } static void -_fingerprintAlterRoleSetStmt(FingerprintContext *ctx, const AlterRoleSetStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintJsonArrayAgg(FingerprintContext *ctx, const JsonArrayAgg *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->database != NULL) { - _fingerprintString(ctx, "database"); - _fingerprintString(ctx, node->database); + if (node->absent_on_null) { + _fingerprintString(ctx, "absent_on_null"); + _fingerprintString(ctx, "true"); } - if (node->role != NULL) { + if (node->arg != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "role"); + _fingerprintString(ctx, "arg"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->role, node, "role", depth + 1); + _fingerprintJsonValueExpr(ctx, node->arg, node, "arg", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7006,15 +7329,15 @@ _fingerprintAlterRoleSetStmt(FingerprintContext *ctx, const AlterRoleSetStmt *no XXH3_freeState(prev); } - if (node->setstmt != NULL) { + if (node->constructor != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "setstmt"); + _fingerprintString(ctx, "constructor"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintVariableSetStmt(ctx, node->setstmt, node, "setstmt", depth + 1); + _fingerprintJsonAggConstructor(ctx, node->constructor, node, "constructor", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7026,74 +7349,59 @@ _fingerprintAlterRoleSetStmt(FingerprintContext *ctx, const AlterRoleSetStmt *no } static void -_fingerprintCreateConversionStmt(FingerprintContext *ctx, const CreateConversionStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintRawStmt(FingerprintContext *ctx, const RawStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->conversion_name != NULL && node->conversion_name->length > 0) { + if (node->stmt != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "conversion_name"); + _fingerprintString(ctx, "stmt"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->conversion_name, node, "conversion_name", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->conversion_name) == 1 && linitial(node->conversion_name) == NIL)) { + _fingerprintNode(ctx, node->stmt, node, "stmt", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->def) { - _fingerprintString(ctx, "def"); - _fingerprintString(ctx, "true"); - } - if (node->for_encoding_name != NULL) { - _fingerprintString(ctx, "for_encoding_name"); - _fingerprintString(ctx, node->for_encoding_name); - } + // Intentionally ignoring node->stmt_len for fingerprinting - if (node->func_name != NULL && node->func_name->length > 0) { + // Intentionally ignoring node->stmt_location for fingerprinting + +} + +static void +_fingerprintInsertStmt(FingerprintContext *ctx, const InsertStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->cols != NULL && node->cols->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "func_name"); + _fingerprintString(ctx, "cols"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->func_name, node, "func_name", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->func_name) == 1 && linitial(node->func_name) == NIL)) { + _fingerprintNode(ctx, node->cols, node, "cols", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cols) == 1 && linitial(node->cols) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->to_encoding_name != NULL) { - _fingerprintString(ctx, "to_encoding_name"); - _fingerprintString(ctx, node->to_encoding_name); - } - -} - -static void -_fingerprintCreateCastStmt(FingerprintContext *ctx, const CreateCastStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (true) { - _fingerprintString(ctx, "context"); - _fingerprintString(ctx, _enumToStringCoercionContext(node->context)); - } - - if (node->func != NULL) { + if (node->onConflictClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "func"); + _fingerprintString(ctx, "onConflictClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintObjectWithArgs(ctx, node->func, node, "func", depth + 1); + _fingerprintOnConflictClause(ctx, node->onConflictClause, node, "onConflictClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7102,20 +7410,20 @@ _fingerprintCreateCastStmt(FingerprintContext *ctx, const CreateCastStmt *node, XXH3_freeState(prev); } - if (node->inout) { - _fingerprintString(ctx, "inout"); - _fingerprintString(ctx, "true"); + if (true) { + _fingerprintString(ctx, "override"); + _fingerprintString(ctx, _enumToStringOverridingKind(node->override)); } - if (node->sourcetype != NULL) { + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "sourcetype"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->sourcetype, node, "sourcetype", depth + 1); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7124,42 +7432,48 @@ _fingerprintCreateCastStmt(FingerprintContext *ctx, const CreateCastStmt *node, XXH3_freeState(prev); } - if (node->targettype != NULL) { + if (node->returningList != NULL && node->returningList->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "targettype"); + _fingerprintString(ctx, "returningList"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->targettype, node, "targettype", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->returningList, node, "returningList", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->returningList) == 1 && linitial(node->returningList) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->selectStmt != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; -} - -static void -_fingerprintCreateOpClassStmt(FingerprintContext *ctx, const CreateOpClassStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->amname != NULL) { - _fingerprintString(ctx, "amname"); - _fingerprintString(ctx, node->amname); + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "selectStmt"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->selectStmt, node, "selectStmt", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); } - if (node->datatype != NULL) { + if (node->withClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "datatype"); + _fingerprintString(ctx, "withClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->datatype, node, "datatype", depth + 1); + _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7168,225 +7482,212 @@ _fingerprintCreateOpClassStmt(FingerprintContext *ctx, const CreateOpClassStmt * XXH3_freeState(prev); } - if (node->isDefault) { - _fingerprintString(ctx, "isDefault"); - _fingerprintString(ctx, "true"); - } +} - if (node->items != NULL && node->items->length > 0) { +static void +_fingerprintDeleteStmt(FingerprintContext *ctx, const DeleteStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "items"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->items, node, "items", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->items) == 1 && linitial(node->items) == NIL)) { + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->opclassname != NULL && node->opclassname->length > 0) { + + if (node->returningList != NULL && node->returningList->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "opclassname"); + _fingerprintString(ctx, "returningList"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->opclassname, node, "opclassname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opclassname) == 1 && linitial(node->opclassname) == NIL)) { + _fingerprintNode(ctx, node->returningList, node, "returningList", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->returningList) == 1 && linitial(node->returningList) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->opfamilyname != NULL && node->opfamilyname->length > 0) { + if (node->usingClause != NULL && node->usingClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "opfamilyname"); + _fingerprintString(ctx, "usingClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->opfamilyname, node, "opfamilyname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opfamilyname) == 1 && linitial(node->opfamilyname) == NIL)) { + _fingerprintNode(ctx, node->usingClause, node, "usingClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->usingClause) == 1 && linitial(node->usingClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} + if (node->whereClause != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; -static void -_fingerprintCreateOpFamilyStmt(FingerprintContext *ctx, const CreateOpFamilyStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->amname != NULL) { - _fingerprintString(ctx, "amname"); - _fingerprintString(ctx, node->amname); + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "whereClause"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); } - if (node->opfamilyname != NULL && node->opfamilyname->length > 0) { + if (node->withClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "opfamilyname"); + _fingerprintString(ctx, "withClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->opfamilyname, node, "opfamilyname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opfamilyname) == 1 && linitial(node->opfamilyname) == NIL)) { + _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + } static void -_fingerprintAlterOpFamilyStmt(FingerprintContext *ctx, const AlterOpFamilyStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintUpdateStmt(FingerprintContext *ctx, const UpdateStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->amname != NULL) { - _fingerprintString(ctx, "amname"); - _fingerprintString(ctx, node->amname); - } - - if (node->isDrop) { - _fingerprintString(ctx, "isDrop"); - _fingerprintString(ctx, "true"); - } - - if (node->items != NULL && node->items->length > 0) { + if (node->fromClause != NULL && node->fromClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "items"); + _fingerprintString(ctx, "fromClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->items, node, "items", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->items) == 1 && linitial(node->items) == NIL)) { + _fingerprintNode(ctx, node->fromClause, node, "fromClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fromClause) == 1 && linitial(node->fromClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->opfamilyname != NULL && node->opfamilyname->length > 0) { + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "opfamilyname"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->opfamilyname, node, "opfamilyname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opfamilyname) == 1 && linitial(node->opfamilyname) == NIL)) { + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} -static void -_fingerprintPrepareStmt(FingerprintContext *ctx, const PrepareStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->argtypes != NULL && node->argtypes->length > 0) { + if (node->returningList != NULL && node->returningList->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "argtypes"); + _fingerprintString(ctx, "returningList"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->argtypes, node, "argtypes", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->argtypes) == 1 && linitial(node->argtypes) == NIL)) { + _fingerprintNode(ctx, node->returningList, node, "returningList", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->returningList) == 1 && linitial(node->returningList) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->name for fingerprinting - - if (node->query != NULL) { + if (node->targetList != NULL && node->targetList->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "query"); + _fingerprintString(ctx, "targetList"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->query, node, "query", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->whereClause != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; -} + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "whereClause"); -static void -_fingerprintExecuteStmt(FingerprintContext *ctx, const ExecuteStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - // Intentionally ignoring node->name for fingerprinting + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } - if (node->params != NULL && node->params->length > 0) { + if (node->withClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "params"); + _fingerprintString(ctx, "withClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->params, node, "params", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->params) == 1 && linitial(node->params) == NIL)) { + _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintDeallocateStmt(FingerprintContext *ctx, const DeallocateStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - // Intentionally ignoring node->name for fingerprinting } static void -_fingerprintDeclareCursorStmt(FingerprintContext *ctx, const DeclareCursorStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintMergeStmt(FingerprintContext *ctx, const MergeStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->options != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->options); - _fingerprintString(ctx, "options"); - _fingerprintString(ctx, buffer); - } - - // Intentionally ignoring node->portalname for fingerprinting - - if (node->query != NULL) { + if (node->joinCondition != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "query"); + _fingerprintString(ctx, "joinCondition"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->query, node, "query", depth + 1); + _fingerprintNode(ctx, node->joinCondition, node, "joinCondition", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7395,38 +7696,31 @@ _fingerprintDeclareCursorStmt(FingerprintContext *ctx, const DeclareCursorStmt * XXH3_freeState(prev); } -} - -static void -_fingerprintCreateTableSpaceStmt(FingerprintContext *ctx, const CreateTableSpaceStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - // Intentionally ignoring node->location for fingerprinting - - if (node->options != NULL && node->options->length > 0) { + if (node->mergeWhenClauses != NULL && node->mergeWhenClauses->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "mergeWhenClauses"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->mergeWhenClauses, node, "mergeWhenClauses", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->mergeWhenClauses) == 1 && linitial(node->mergeWhenClauses) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->owner != NULL) { + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "owner"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->owner, node, "owner", depth + 1); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7435,45 +7729,15 @@ _fingerprintCreateTableSpaceStmt(FingerprintContext *ctx, const CreateTableSpace XXH3_freeState(prev); } - if (node->tablespacename != NULL) { - _fingerprintString(ctx, "tablespacename"); - _fingerprintString(ctx, node->tablespacename); - } - -} - -static void -_fingerprintDropTableSpaceStmt(FingerprintContext *ctx, const DropTableSpaceStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); - _fingerprintString(ctx, "true"); - } - - if (node->tablespacename != NULL) { - _fingerprintString(ctx, "tablespacename"); - _fingerprintString(ctx, node->tablespacename); - } - -} - -static void -_fingerprintAlterObjectDependsStmt(FingerprintContext *ctx, const AlterObjectDependsStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (strlen(node->extname->sval) > 0) { - _fingerprintString(ctx, "extname"); - _fingerprintString(ctx, node->extname->sval); - } - - if (node->object != NULL) { + if (node->sourceRelation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "object"); + _fingerprintString(ctx, "sourceRelation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->object, node, "object", depth + 1); + _fingerprintNode(ctx, node->sourceRelation, node, "sourceRelation", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7482,20 +7746,15 @@ _fingerprintAlterObjectDependsStmt(FingerprintContext *ctx, const AlterObjectDep XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "objectType"); - _fingerprintString(ctx, _enumToStringObjectType(node->objectType)); - } - - if (node->relation != NULL) { + if (node->withClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "withClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7504,96 +7763,78 @@ _fingerprintAlterObjectDependsStmt(FingerprintContext *ctx, const AlterObjectDep XXH3_freeState(prev); } - if (node->remove) { - _fingerprintString(ctx, "remove"); - _fingerprintString(ctx, "true"); - } - } static void -_fingerprintAlterObjectSchemaStmt(FingerprintContext *ctx, const AlterObjectSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintSelectStmt(FingerprintContext *ctx, const SelectStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); + if (node->all) { + _fingerprintString(ctx, "all"); _fingerprintString(ctx, "true"); } - if (node->newschema != NULL) { - _fingerprintString(ctx, "newschema"); - _fingerprintString(ctx, node->newschema); - } - - if (node->object != NULL) { + if (node->distinctClause != NULL && node->distinctClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "object"); + _fingerprintString(ctx, "distinctClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->object, node, "object", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->distinctClause, node, "distinctClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->distinctClause) == 1 && linitial(node->distinctClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (true) { - _fingerprintString(ctx, "objectType"); - _fingerprintString(ctx, _enumToStringObjectType(node->objectType)); - } - - if (node->relation != NULL) { + if (node->fromClause != NULL && node->fromClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "fromClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->fromClause, node, "fromClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fromClause) == 1 && linitial(node->fromClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - -} - -static void -_fingerprintAlterOwnerStmt(FingerprintContext *ctx, const AlterOwnerStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->newowner != NULL) { + if (node->groupClause != NULL && node->groupClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "newowner"); + _fingerprintString(ctx, "groupClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->newowner, node, "newowner", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->groupClause, node, "groupClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->groupClause) == 1 && linitial(node->groupClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->groupDistinct) { + _fingerprintString(ctx, "groupDistinct"); + _fingerprintString(ctx, "true"); + } - if (node->object != NULL) { + if (node->havingClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "object"); + _fingerprintString(ctx, "havingClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->object, node, "object", depth + 1); + _fingerprintNode(ctx, node->havingClause, node, "havingClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7602,20 +7843,15 @@ _fingerprintAlterOwnerStmt(FingerprintContext *ctx, const AlterOwnerStmt *node, XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "objectType"); - _fingerprintString(ctx, _enumToStringObjectType(node->objectType)); - } - - if (node->relation != NULL) { + if (node->intoClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "intoClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintIntoClause(ctx, node->intoClause, node, "intoClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7624,20 +7860,15 @@ _fingerprintAlterOwnerStmt(FingerprintContext *ctx, const AlterOwnerStmt *node, XXH3_freeState(prev); } -} - -static void -_fingerprintAlterOperatorStmt(FingerprintContext *ctx, const AlterOperatorStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->opername != NULL) { + if (node->larg != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "opername"); + _fingerprintString(ctx, "larg"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintObjectWithArgs(ctx, node->opername, node, "opername", depth + 1); + _fingerprintSelectStmt(ctx, node->larg, node, "larg", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7646,153 +7877,140 @@ _fingerprintAlterOperatorStmt(FingerprintContext *ctx, const AlterOperatorStmt * XXH3_freeState(prev); } - if (node->options != NULL && node->options->length > 0) { + if (node->limitCount != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "limitCount"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->limitCount, node, "limitCount", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} -static void -_fingerprintAlterTypeStmt(FingerprintContext *ctx, const AlterTypeStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->options != NULL && node->options->length > 0) { + if (node->limitOffset != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "limitOffset"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->limitOffset, node, "limitOffset", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->typeName != NULL && node->typeName->length > 0) { + + if (true) { + _fingerprintString(ctx, "limitOption"); + _fingerprintString(ctx, _enumToStringLimitOption(node->limitOption)); + } + + if (node->lockingClause != NULL && node->lockingClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typeName"); + _fingerprintString(ctx, "lockingClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->typeName, node, "typeName", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typeName) == 1 && linitial(node->typeName) == NIL)) { + _fingerprintNode(ctx, node->lockingClause, node, "lockingClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->lockingClause) == 1 && linitial(node->lockingClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintDropOwnedStmt(FingerprintContext *ctx, const DropOwnedStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ if (true) { - _fingerprintString(ctx, "behavior"); - _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); + _fingerprintString(ctx, "op"); + _fingerprintString(ctx, _enumToStringSetOperation(node->op)); } - if (node->roles != NULL && node->roles->length > 0) { + if (node->rarg != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "roles"); + _fingerprintString(ctx, "rarg"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { + _fingerprintSelectStmt(ctx, node->rarg, node, "rarg", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} -static void -_fingerprintReassignOwnedStmt(FingerprintContext *ctx, const ReassignOwnedStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->newrole != NULL) { + if (node->sortClause != NULL && node->sortClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "newrole"); + _fingerprintString(ctx, "sortClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->newrole, node, "newrole", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->sortClause, node, "sortClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->sortClause) == 1 && linitial(node->sortClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->roles != NULL && node->roles->length > 0) { + if (node->targetList != NULL && node->targetList->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "roles"); + _fingerprintString(ctx, "targetList"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { + _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintCompositeTypeStmt(FingerprintContext *ctx, const CompositeTypeStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->coldeflist != NULL && node->coldeflist->length > 0) { + if (node->valuesLists != NULL && node->valuesLists->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "coldeflist"); + _fingerprintString(ctx, "valuesLists"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->coldeflist, node, "coldeflist", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->coldeflist) == 1 && linitial(node->coldeflist) == NIL)) { + _fingerprintNode(ctx, node->valuesLists, node, "valuesLists", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->valuesLists) == 1 && linitial(node->valuesLists) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->typevar != NULL) { + if (node->whereClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typevar"); + _fingerprintString(ctx, "whereClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->typevar, node, "typevar", depth + 1); + _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -7801,485 +8019,449 @@ _fingerprintCompositeTypeStmt(FingerprintContext *ctx, const CompositeTypeStmt * XXH3_freeState(prev); } -} - -static void -_fingerprintCreateEnumStmt(FingerprintContext *ctx, const CreateEnumStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->typeName != NULL && node->typeName->length > 0) { + if (node->windowClause != NULL && node->windowClause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typeName"); + _fingerprintString(ctx, "windowClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->typeName, node, "typeName", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typeName) == 1 && linitial(node->typeName) == NIL)) { + _fingerprintNode(ctx, node->windowClause, node, "windowClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->windowClause) == 1 && linitial(node->windowClause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->vals != NULL && node->vals->length > 0) { + if (node->withClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "vals"); + _fingerprintString(ctx, "withClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->vals, node, "vals", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->vals) == 1 && linitial(node->vals) == NIL)) { + _fingerprintWithClause(ctx, node->withClause, node, "withClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + } static void -_fingerprintCreateRangeStmt(FingerprintContext *ctx, const CreateRangeStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintSetOperationStmt(FingerprintContext *ctx, const SetOperationStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->params != NULL && node->params->length > 0) { + if (node->all) { + _fingerprintString(ctx, "all"); + _fingerprintString(ctx, "true"); + } + + if (node->colCollations != NULL && node->colCollations->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "params"); + _fingerprintString(ctx, "colCollations"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->params, node, "params", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->params) == 1 && linitial(node->params) == NIL)) { + _fingerprintNode(ctx, node->colCollations, node, "colCollations", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->colCollations) == 1 && linitial(node->colCollations) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->typeName != NULL && node->typeName->length > 0) { + if (node->colTypes != NULL && node->colTypes->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typeName"); + _fingerprintString(ctx, "colTypes"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->typeName, node, "typeName", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typeName) == 1 && linitial(node->typeName) == NIL)) { + _fingerprintNode(ctx, node->colTypes, node, "colTypes", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->colTypes) == 1 && linitial(node->colTypes) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintAlterEnumStmt(FingerprintContext *ctx, const AlterEnumStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->newVal != NULL) { - _fingerprintString(ctx, "newVal"); - _fingerprintString(ctx, node->newVal); - } - - if (node->newValIsAfter) { - _fingerprintString(ctx, "newValIsAfter"); - _fingerprintString(ctx, "true"); - } - - if (node->newValNeighbor != NULL) { - _fingerprintString(ctx, "newValNeighbor"); - _fingerprintString(ctx, node->newValNeighbor); - } - - if (node->oldVal != NULL) { - _fingerprintString(ctx, "oldVal"); - _fingerprintString(ctx, node->oldVal); - } - - if (node->skipIfNewValExists) { - _fingerprintString(ctx, "skipIfNewValExists"); - _fingerprintString(ctx, "true"); - } - - if (node->typeName != NULL && node->typeName->length > 0) { + if (node->colTypmods != NULL && node->colTypmods->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typeName"); + _fingerprintString(ctx, "colTypmods"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->typeName, node, "typeName", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typeName) == 1 && linitial(node->typeName) == NIL)) { + _fingerprintNode(ctx, node->colTypmods, node, "colTypmods", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->colTypmods) == 1 && linitial(node->colTypmods) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintAlterTSDictionaryStmt(FingerprintContext *ctx, const AlterTSDictionaryStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->dictname != NULL && node->dictname->length > 0) { + if (node->groupClauses != NULL && node->groupClauses->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "dictname"); + _fingerprintString(ctx, "groupClauses"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->dictname, node, "dictname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->dictname) == 1 && linitial(node->dictname) == NIL)) { + _fingerprintNode(ctx, node->groupClauses, node, "groupClauses", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->groupClauses) == 1 && linitial(node->groupClauses) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->options != NULL && node->options->length > 0) { + if (node->larg != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "larg"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->larg, node, "larg", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} -static void -_fingerprintAlterTSConfigurationStmt(FingerprintContext *ctx, const AlterTSConfigurationStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->cfgname != NULL && node->cfgname->length > 0) { + if (true) { + _fingerprintString(ctx, "op"); + _fingerprintString(ctx, _enumToStringSetOperation(node->op)); + } + + if (node->rarg != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "cfgname"); + _fingerprintString(ctx, "rarg"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->cfgname, node, "cfgname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cfgname) == 1 && linitial(node->cfgname) == NIL)) { + _fingerprintNode(ctx, node->rarg, node, "rarg", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->dicts != NULL && node->dicts->length > 0) { + +} + +static void +_fingerprintReturnStmt(FingerprintContext *ctx, const ReturnStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->returnval != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "dicts"); + _fingerprintString(ctx, "returnval"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->dicts, node, "dicts", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->dicts) == 1 && linitial(node->dicts) == NIL)) { + _fingerprintNode(ctx, node->returnval, node, "returnval", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "kind"); - _fingerprintString(ctx, _enumToStringAlterTSConfigType(node->kind)); - } - - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); - _fingerprintString(ctx, "true"); - } - - if (node->override) { - _fingerprintString(ctx, "override"); - _fingerprintString(ctx, "true"); - } - if (node->replace) { - _fingerprintString(ctx, "replace"); - _fingerprintString(ctx, "true"); - } +} - if (node->tokentype != NULL && node->tokentype->length > 0) { +static void +_fingerprintPLAssignStmt(FingerprintContext *ctx, const PLAssignStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->indirection != NULL && node->indirection->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "tokentype"); + _fingerprintString(ctx, "indirection"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->tokentype, node, "tokentype", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->tokentype) == 1 && linitial(node->tokentype) == NIL)) { + _fingerprintNode(ctx, node->indirection, node, "indirection", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indirection) == 1 && linitial(node->indirection) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} + // Intentionally ignoring node->location for fingerprinting -static void -_fingerprintCreateFdwStmt(FingerprintContext *ctx, const CreateFdwStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->fdwname != NULL) { - _fingerprintString(ctx, "fdwname"); - _fingerprintString(ctx, node->fdwname); + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); } - if (node->func_options != NULL && node->func_options->length > 0) { + if (node->nnames != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->nnames); + _fingerprintString(ctx, "nnames"); + _fingerprintString(ctx, buffer); + } + + if (node->val != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "func_options"); + _fingerprintString(ctx, "val"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->func_options, node, "func_options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->func_options) == 1 && linitial(node->func_options) == NIL)) { + _fingerprintSelectStmt(ctx, node->val, node, "val", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->options != NULL && node->options->length > 0) { + +} + +static void +_fingerprintCreateSchemaStmt(FingerprintContext *ctx, const CreateSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->authrole != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "authrole"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintRoleSpec(ctx, node->authrole, node, "authrole", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} -static void -_fingerprintAlterFdwStmt(FingerprintContext *ctx, const AlterFdwStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->fdwname != NULL) { - _fingerprintString(ctx, "fdwname"); - _fingerprintString(ctx, node->fdwname); + if (node->if_not_exists) { + _fingerprintString(ctx, "if_not_exists"); + _fingerprintString(ctx, "true"); } - if (node->func_options != NULL && node->func_options->length > 0) { + if (node->schemaElts != NULL && node->schemaElts->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "func_options"); + _fingerprintString(ctx, "schemaElts"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->func_options, node, "func_options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->func_options) == 1 && linitial(node->func_options) == NIL)) { + _fingerprintNode(ctx, node->schemaElts, node, "schemaElts", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->schemaElts) == 1 && linitial(node->schemaElts) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->options != NULL && node->options->length > 0) { + if (node->schemaname != NULL) { + _fingerprintString(ctx, "schemaname"); + _fingerprintString(ctx, node->schemaname); + } + +} + +static void +_fingerprintAlterTableStmt(FingerprintContext *ctx, const AlterTableStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->cmds != NULL && node->cmds->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "cmds"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->cmds, node, "cmds", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cmds) == 1 && linitial(node->cmds) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintCreateForeignServerStmt(FingerprintContext *ctx, const CreateForeignServerStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->fdwname != NULL) { - _fingerprintString(ctx, "fdwname"); - _fingerprintString(ctx, node->fdwname); + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); + _fingerprintString(ctx, "true"); } - if (node->if_not_exists) { - _fingerprintString(ctx, "if_not_exists"); - _fingerprintString(ctx, "true"); + if (true) { + _fingerprintString(ctx, "objtype"); + _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); } - if (node->options != NULL && node->options->length > 0) { + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->servername != NULL) { - _fingerprintString(ctx, "servername"); - _fingerprintString(ctx, node->servername); - } - if (node->servertype != NULL) { - _fingerprintString(ctx, "servertype"); - _fingerprintString(ctx, node->servertype); +} + +static void +_fingerprintReplicaIdentityStmt(FingerprintContext *ctx, const ReplicaIdentityStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->identity_type != 0) { + char buffer[2] = {node->identity_type, '\0'}; + _fingerprintString(ctx, "identity_type"); + _fingerprintString(ctx, buffer); } - if (node->version != NULL) { - _fingerprintString(ctx, "version"); - _fingerprintString(ctx, node->version); + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); } } static void -_fingerprintAlterForeignServerStmt(FingerprintContext *ctx, const AlterForeignServerStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterTableCmd(FingerprintContext *ctx, const AlterTableCmd *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->has_version) { - _fingerprintString(ctx, "has_version"); - _fingerprintString(ctx, "true"); + if (true) { + _fingerprintString(ctx, "behavior"); + _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); } - if (node->options != NULL && node->options->length > 0) { + if (node->def != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "def"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->def, node, "def", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->servername != NULL) { - _fingerprintString(ctx, "servername"); - _fingerprintString(ctx, node->servername); - } - if (node->version != NULL) { - _fingerprintString(ctx, "version"); - _fingerprintString(ctx, node->version); + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); + _fingerprintString(ctx, "true"); } -} - -static void -_fingerprintCreateUserMappingStmt(FingerprintContext *ctx, const CreateUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->if_not_exists) { - _fingerprintString(ctx, "if_not_exists"); - _fingerprintString(ctx, "true"); + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); } - if (node->options != NULL && node->options->length > 0) { + if (node->newowner != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "newowner"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintRoleSpec(ctx, node->newowner, node, "newowner", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->servername != NULL) { - _fingerprintString(ctx, "servername"); - _fingerprintString(ctx, node->servername); - } - if (node->user != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; + if (node->num != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->num); + _fingerprintString(ctx, "num"); + _fingerprintString(ctx, buffer); + } - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "user"); + if (node->recurse) { + _fingerprintString(ctx, "recurse"); + _fingerprintString(ctx, "true"); + } - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->user, node, "user", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); + if (true) { + _fingerprintString(ctx, "subtype"); + _fingerprintString(ctx, _enumToStringAlterTableType(node->subtype)); } } static void -_fingerprintAlterUserMappingStmt(FingerprintContext *ctx, const AlterUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterCollationStmt(FingerprintContext *ctx, const AlterCollationStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->options != NULL && node->options->length > 0) { + if (node->collname != NULL && node->collname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "collname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->collname, node, "collname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->collname) == 1 && linitial(node->collname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->servername != NULL) { - _fingerprintString(ctx, "servername"); - _fingerprintString(ctx, node->servername); +} + +static void +_fingerprintAlterDomainStmt(FingerprintContext *ctx, const AlterDomainStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (true) { + _fingerprintString(ctx, "behavior"); + _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); } - if (node->user != NULL) { + if (node->def != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "user"); + _fingerprintString(ctx, "def"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->user, node, "user", depth + 1); + _fingerprintNode(ctx, node->def, node, "def", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -8288,257 +8470,185 @@ _fingerprintAlterUserMappingStmt(FingerprintContext *ctx, const AlterUserMapping XXH3_freeState(prev); } -} - -static void -_fingerprintDropUserMappingStmt(FingerprintContext *ctx, const DropUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ if (node->missing_ok) { _fingerprintString(ctx, "missing_ok"); _fingerprintString(ctx, "true"); } - if (node->servername != NULL) { - _fingerprintString(ctx, "servername"); - _fingerprintString(ctx, node->servername); + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); } - if (node->user != NULL) { + if (node->subtype != 0) { + char buffer[2] = {node->subtype, '\0'}; + _fingerprintString(ctx, "subtype"); + _fingerprintString(ctx, buffer); + } + + if (node->typeName != NULL && node->typeName->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "user"); + _fingerprintString(ctx, "typeName"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRoleSpec(ctx, node->user, node, "user", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->typeName, node, "typeName", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typeName) == 1 && linitial(node->typeName) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - } static void -_fingerprintAlterTableSpaceOptionsStmt(FingerprintContext *ctx, const AlterTableSpaceOptionsStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintGrantStmt(FingerprintContext *ctx, const GrantStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->isReset) { - _fingerprintString(ctx, "isReset"); + if (true) { + _fingerprintString(ctx, "behavior"); + _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); + } + + if (node->grant_option) { + _fingerprintString(ctx, "grant_option"); _fingerprintString(ctx, "true"); } - if (node->options != NULL && node->options->length > 0) { + if (node->grantees != NULL && node->grantees->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "grantees"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->grantees, node, "grantees", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->grantees) == 1 && linitial(node->grantees) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->tablespacename != NULL) { - _fingerprintString(ctx, "tablespacename"); - _fingerprintString(ctx, node->tablespacename); - } - -} - -static void -_fingerprintAlterTableMoveAllStmt(FingerprintContext *ctx, const AlterTableMoveAllStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->new_tablespacename != NULL) { - _fingerprintString(ctx, "new_tablespacename"); - _fingerprintString(ctx, node->new_tablespacename); - } - - if (node->nowait) { - _fingerprintString(ctx, "nowait"); - _fingerprintString(ctx, "true"); - } - - if (true) { - _fingerprintString(ctx, "objtype"); - _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); - } - - if (node->orig_tablespacename != NULL) { - _fingerprintString(ctx, "orig_tablespacename"); - _fingerprintString(ctx, node->orig_tablespacename); - } - - if (node->roles != NULL && node->roles->length > 0) { + if (node->grantor != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "roles"); + _fingerprintString(ctx, "grantor"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { + _fingerprintRoleSpec(ctx, node->grantor, node, "grantor", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} -static void -_fingerprintSecLabelStmt(FingerprintContext *ctx, const SecLabelStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->label != NULL) { - _fingerprintString(ctx, "label"); - _fingerprintString(ctx, node->label); + if (node->is_grant) { + _fingerprintString(ctx, "is_grant"); + _fingerprintString(ctx, "true"); } - if (node->object != NULL) { + if (node->objects != NULL && node->objects->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "object"); + _fingerprintString(ctx, "objects"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->object, node, "object", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->objects, node, "objects", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objects) == 1 && linitial(node->objects) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { _fingerprintString(ctx, "objtype"); _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); } - if (node->provider != NULL) { - _fingerprintString(ctx, "provider"); - _fingerprintString(ctx, node->provider); - } - -} - -static void -_fingerprintCreateForeignTableStmt(FingerprintContext *ctx, const CreateForeignTableStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - _fingerprintString(ctx, "base"); - _fingerprintCreateStmt(ctx, (const CreateStmt*) &node->base, node, "base", depth); - if (node->options != NULL && node->options->length > 0) { + if (node->privileges != NULL && node->privileges->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "privileges"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->privileges, node, "privileges", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->privileges) == 1 && linitial(node->privileges) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->servername != NULL) { - _fingerprintString(ctx, "servername"); - _fingerprintString(ctx, node->servername); + if (true) { + _fingerprintString(ctx, "targtype"); + _fingerprintString(ctx, _enumToStringGrantTargetType(node->targtype)); } } static void -_fingerprintImportForeignSchemaStmt(FingerprintContext *ctx, const ImportForeignSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintObjectWithArgs(FingerprintContext *ctx, const ObjectWithArgs *node, const void *parent, const char *field_name, unsigned int depth) { - if (true) { - _fingerprintString(ctx, "list_type"); - _fingerprintString(ctx, _enumToStringImportForeignSchemaType(node->list_type)); - } - - if (node->local_schema != NULL) { - _fingerprintString(ctx, "local_schema"); - _fingerprintString(ctx, node->local_schema); + if (node->args_unspecified) { + _fingerprintString(ctx, "args_unspecified"); + _fingerprintString(ctx, "true"); } - if (node->options != NULL && node->options->length > 0) { + if (node->objargs != NULL && node->objargs->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "objargs"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->objargs, node, "objargs", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objargs) == 1 && linitial(node->objargs) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->remote_schema != NULL) { - _fingerprintString(ctx, "remote_schema"); - _fingerprintString(ctx, node->remote_schema); - } - - if (node->server_name != NULL) { - _fingerprintString(ctx, "server_name"); - _fingerprintString(ctx, node->server_name); - } - - if (node->table_list != NULL && node->table_list->length > 0) { + if (node->objfuncargs != NULL && node->objfuncargs->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "table_list"); + _fingerprintString(ctx, "objfuncargs"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->table_list, node, "table_list", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->table_list) == 1 && linitial(node->table_list) == NIL)) { + _fingerprintNode(ctx, node->objfuncargs, node, "objfuncargs", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objfuncargs) == 1 && linitial(node->objfuncargs) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintCreateExtensionStmt(FingerprintContext *ctx, const CreateExtensionStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->extname != NULL) { - _fingerprintString(ctx, "extname"); - _fingerprintString(ctx, node->extname); - } - - if (node->if_not_exists) { - _fingerprintString(ctx, "if_not_exists"); - _fingerprintString(ctx, "true"); - } - - if (node->options != NULL && node->options->length > 0) { + if (node->objname != NULL && node->objname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "objname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->objname, node, "objname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objname) == 1 && linitial(node->objname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); @@ -8548,150 +8658,80 @@ _fingerprintCreateExtensionStmt(FingerprintContext *ctx, const CreateExtensionSt } static void -_fingerprintAlterExtensionStmt(FingerprintContext *ctx, const AlterExtensionStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAccessPriv(FingerprintContext *ctx, const AccessPriv *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->extname != NULL) { - _fingerprintString(ctx, "extname"); - _fingerprintString(ctx, node->extname); - } - - if (node->options != NULL && node->options->length > 0) { + if (node->cols != NULL && node->cols->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "cols"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->cols, node, "cols", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cols) == 1 && linitial(node->cols) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintAlterExtensionContentsStmt(FingerprintContext *ctx, const AlterExtensionContentsStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->action != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->action); - _fingerprintString(ctx, "action"); - _fingerprintString(ctx, buffer); - } - - if (node->extname != NULL) { - _fingerprintString(ctx, "extname"); - _fingerprintString(ctx, node->extname); - } - - if (node->object != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "object"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->object, node, "object", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - - if (true) { - _fingerprintString(ctx, "objtype"); - _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); + if (node->priv_name != NULL) { + _fingerprintString(ctx, "priv_name"); + _fingerprintString(ctx, node->priv_name); } } static void -_fingerprintCreateEventTrigStmt(FingerprintContext *ctx, const CreateEventTrigStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintGrantRoleStmt(FingerprintContext *ctx, const GrantRoleStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->eventname != NULL) { - _fingerprintString(ctx, "eventname"); - _fingerprintString(ctx, node->eventname); + if (true) { + _fingerprintString(ctx, "behavior"); + _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); } - if (node->funcname != NULL && node->funcname->length > 0) { + if (node->granted_roles != NULL && node->granted_roles->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funcname"); + _fingerprintString(ctx, "granted_roles"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->funcname, node, "funcname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funcname) == 1 && linitial(node->funcname) == NIL)) { + _fingerprintNode(ctx, node->granted_roles, node, "granted_roles", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->granted_roles) == 1 && linitial(node->granted_roles) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->trigname != NULL) { - _fingerprintString(ctx, "trigname"); - _fingerprintString(ctx, node->trigname); - } - - if (node->whenclause != NULL && node->whenclause->length > 0) { + if (node->grantee_roles != NULL && node->grantee_roles->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whenclause"); + _fingerprintString(ctx, "grantee_roles"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whenclause, node, "whenclause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->whenclause) == 1 && linitial(node->whenclause) == NIL)) { + _fingerprintNode(ctx, node->grantee_roles, node, "grantee_roles", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->grantee_roles) == 1 && linitial(node->grantee_roles) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintAlterEventTrigStmt(FingerprintContext *ctx, const AlterEventTrigStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->tgenabled != 0) { - char buffer[2] = {node->tgenabled, '\0'}; - _fingerprintString(ctx, "tgenabled"); - _fingerprintString(ctx, buffer); - } - - if (node->trigname != NULL) { - _fingerprintString(ctx, "trigname"); - _fingerprintString(ctx, node->trigname); - } - -} - -static void -_fingerprintRefreshMatViewStmt(FingerprintContext *ctx, const RefreshMatViewStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->concurrent) { - _fingerprintString(ctx, "concurrent"); - _fingerprintString(ctx, "true"); - } - - if (node->relation != NULL) { + if (node->grantor != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "grantor"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + _fingerprintRoleSpec(ctx, node->grantor, node, "grantor", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -8700,78 +8740,41 @@ _fingerprintRefreshMatViewStmt(FingerprintContext *ctx, const RefreshMatViewStmt XXH3_freeState(prev); } - if (node->skipData) { - _fingerprintString(ctx, "skipData"); + if (node->is_grant) { + _fingerprintString(ctx, "is_grant"); _fingerprintString(ctx, "true"); } -} - -static void -_fingerprintReplicaIdentityStmt(FingerprintContext *ctx, const ReplicaIdentityStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->identity_type != 0) { - char buffer[2] = {node->identity_type, '\0'}; - _fingerprintString(ctx, "identity_type"); - _fingerprintString(ctx, buffer); - } - - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); - } - -} - -static void -_fingerprintAlterSystemStmt(FingerprintContext *ctx, const AlterSystemStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->setstmt != NULL) { + if (node->opt != NULL && node->opt->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "setstmt"); + _fingerprintString(ctx, "opt"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintVariableSetStmt(ctx, node->setstmt, node, "setstmt", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->opt, node, "opt", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opt) == 1 && linitial(node->opt) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - } static void -_fingerprintCreatePolicyStmt(FingerprintContext *ctx, const CreatePolicyStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterDefaultPrivilegesStmt(FingerprintContext *ctx, const AlterDefaultPrivilegesStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->cmd_name != NULL) { - _fingerprintString(ctx, "cmd_name"); - _fingerprintString(ctx, node->cmd_name); - } - - if (node->permissive) { - _fingerprintString(ctx, "permissive"); - _fingerprintString(ctx, "true"); - } - - if (node->policy_name != NULL) { - _fingerprintString(ctx, "policy_name"); - _fingerprintString(ctx, node->policy_name); - } - - if (node->qual != NULL) { + if (node->action != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "qual"); + _fingerprintString(ctx, "action"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->qual, node, "qual", depth + 1); + _fingerprintGrantStmt(ctx, node->action, node, "action", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -8780,108 +8783,100 @@ _fingerprintCreatePolicyStmt(FingerprintContext *ctx, const CreatePolicyStmt *no XXH3_freeState(prev); } - if (node->roles != NULL && node->roles->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "roles"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - if (node->table != NULL) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "table"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->table, node, "table", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->with_check != NULL) { +static void +_fingerprintCopyStmt(FingerprintContext *ctx, const CopyStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->attlist != NULL && node->attlist->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "with_check"); + _fingerprintString(ctx, "attlist"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->with_check, node, "with_check", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->attlist, node, "attlist", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->attlist) == 1 && linitial(node->attlist) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->filename != NULL) { + _fingerprintString(ctx, "filename"); + _fingerprintString(ctx, node->filename); + } -} + if (node->is_from) { + _fingerprintString(ctx, "is_from"); + _fingerprintString(ctx, "true"); + } -static void -_fingerprintAlterPolicyStmt(FingerprintContext *ctx, const AlterPolicyStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->policy_name != NULL) { - _fingerprintString(ctx, "policy_name"); - _fingerprintString(ctx, node->policy_name); + if (node->is_program) { + _fingerprintString(ctx, "is_program"); + _fingerprintString(ctx, "true"); } - if (node->qual != NULL) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "qual"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->qual, node, "qual", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->roles != NULL && node->roles->length > 0) { + if (node->query != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "roles"); + _fingerprintString(ctx, "query"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { + _fingerprintNode(ctx, node->query, node, "query", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->table != NULL) { + + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "table"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->table, node, "table", depth + 1); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -8890,15 +8885,15 @@ _fingerprintAlterPolicyStmt(FingerprintContext *ctx, const AlterPolicyStmt *node XXH3_freeState(prev); } - if (node->with_check != NULL) { + if (node->whereClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "with_check"); + _fingerprintString(ctx, "whereClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->with_check, node, "with_check", depth + 1); + _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -8910,161 +8905,116 @@ _fingerprintAlterPolicyStmt(FingerprintContext *ctx, const AlterPolicyStmt *node } static void -_fingerprintCreateTransformStmt(FingerprintContext *ctx, const CreateTransformStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintVariableSetStmt(FingerprintContext *ctx, const VariableSetStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->fromsql != NULL) { + if (node->args != NULL && node->args->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "fromsql"); + _fingerprintString(ctx, "args"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintObjectWithArgs(ctx, node->fromsql, node, "fromsql", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->args, node, "args", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->lang != NULL) { - _fingerprintString(ctx, "lang"); - _fingerprintString(ctx, node->lang); + if (node->is_local) { + _fingerprintString(ctx, "is_local"); + _fingerprintString(ctx, "true"); } - if (node->replace) { - _fingerprintString(ctx, "replace"); - _fingerprintString(ctx, "true"); + if (true) { + _fingerprintString(ctx, "kind"); + _fingerprintString(ctx, _enumToStringVariableSetKind(node->kind)); } - if (node->tosql != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "tosql"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintObjectWithArgs(ctx, node->tosql, node, "tosql", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); } - if (node->type_name != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "type_name"); +} - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->type_name, node, "type_name", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); +static void +_fingerprintVariableShowStmt(FingerprintContext *ctx, const VariableShowStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); } } static void -_fingerprintCreateAmStmt(FingerprintContext *ctx, const CreateAmStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreateStmt(FingerprintContext *ctx, const CreateStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->amname != NULL) { - _fingerprintString(ctx, "amname"); - _fingerprintString(ctx, node->amname); - } - - if (node->amtype != 0) { - char buffer[2] = {node->amtype, '\0'}; - _fingerprintString(ctx, "amtype"); - _fingerprintString(ctx, buffer); + if (node->accessMethod != NULL) { + _fingerprintString(ctx, "accessMethod"); + _fingerprintString(ctx, node->accessMethod); } - if (node->handler_name != NULL && node->handler_name->length > 0) { + if (node->constraints != NULL && node->constraints->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "handler_name"); + _fingerprintString(ctx, "constraints"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->handler_name, node, "handler_name", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->handler_name) == 1 && linitial(node->handler_name) == NIL)) { + _fingerprintNode(ctx, node->constraints, node, "constraints", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->constraints) == 1 && linitial(node->constraints) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintCreatePublicationStmt(FingerprintContext *ctx, const CreatePublicationStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->for_all_tables) { - _fingerprintString(ctx, "for_all_tables"); + if (node->if_not_exists) { + _fingerprintString(ctx, "if_not_exists"); _fingerprintString(ctx, "true"); } - if (node->options != NULL && node->options->length > 0) { + if (node->inhRelations != NULL && node->inhRelations->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "inhRelations"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintNode(ctx, node->inhRelations, node, "inhRelations", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->inhRelations) == 1 && linitial(node->inhRelations) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->pubname != NULL) { - _fingerprintString(ctx, "pubname"); - _fingerprintString(ctx, node->pubname); - } - - if (node->pubobjects != NULL && node->pubobjects->length > 0) { + if (node->ofTypename != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "pubobjects"); + _fingerprintString(ctx, "ofTypename"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->pubobjects, node, "pubobjects", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->pubobjects) == 1 && linitial(node->pubobjects) == NIL)) { + _fingerprintTypeName(ctx, node->ofTypename, node, "ofTypename", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} -static void -_fingerprintAlterPublicationStmt(FingerprintContext *ctx, const AlterPublicationStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ if (true) { - _fingerprintString(ctx, "action"); - _fingerprintString(ctx, _enumToStringAlterPublicationAction(node->action)); - } - - if (node->for_all_tables) { - _fingerprintString(ctx, "for_all_tables"); - _fingerprintString(ctx, "true"); + _fingerprintString(ctx, "oncommit"); + _fingerprintString(ctx, _enumToStringOnCommitAction(node->oncommit)); } if (node->options != NULL && node->options->length > 0) { @@ -9083,361 +9033,352 @@ _fingerprintAlterPublicationStmt(FingerprintContext *ctx, const AlterPublication } XXH3_freeState(prev); } - if (node->pubname != NULL) { - _fingerprintString(ctx, "pubname"); - _fingerprintString(ctx, node->pubname); - } - - if (node->pubobjects != NULL && node->pubobjects->length > 0) { + if (node->partbound != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "pubobjects"); + _fingerprintString(ctx, "partbound"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->pubobjects, node, "pubobjects", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->pubobjects) == 1 && linitial(node->pubobjects) == NIL)) { + _fingerprintPartitionBoundSpec(ctx, node->partbound, node, "partbound", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintCreateSubscriptionStmt(FingerprintContext *ctx, const CreateSubscriptionStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->conninfo != NULL) { - _fingerprintString(ctx, "conninfo"); - _fingerprintString(ctx, node->conninfo); - } - - if (node->options != NULL && node->options->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - if (node->publication != NULL && node->publication->length > 0) { + if (node->partspec != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "publication"); + _fingerprintString(ctx, "partspec"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->publication, node, "publication", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->publication) == 1 && linitial(node->publication) == NIL)) { + _fingerprintPartitionSpec(ctx, node->partspec, node, "partspec", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->subname != NULL) { - _fingerprintString(ctx, "subname"); - _fingerprintString(ctx, node->subname); - } - -} - -static void -_fingerprintAlterSubscriptionStmt(FingerprintContext *ctx, const AlterSubscriptionStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->conninfo != NULL) { - _fingerprintString(ctx, "conninfo"); - _fingerprintString(ctx, node->conninfo); - } - - if (true) { - _fingerprintString(ctx, "kind"); - _fingerprintString(ctx, _enumToStringAlterSubscriptionType(node->kind)); - } - if (node->options != NULL && node->options->length > 0) { + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->publication != NULL && node->publication->length > 0) { + + if (node->tableElts != NULL && node->tableElts->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "publication"); + _fingerprintString(ctx, "tableElts"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->publication, node, "publication", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->publication) == 1 && linitial(node->publication) == NIL)) { + _fingerprintNode(ctx, node->tableElts, node, "tableElts", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->tableElts) == 1 && linitial(node->tableElts) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->subname != NULL) { - _fingerprintString(ctx, "subname"); - _fingerprintString(ctx, node->subname); + if (node->tablespacename != NULL) { + _fingerprintString(ctx, "tablespacename"); + _fingerprintString(ctx, node->tablespacename); } } static void -_fingerprintDropSubscriptionStmt(FingerprintContext *ctx, const DropSubscriptionStmt *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintConstraint(FingerprintContext *ctx, const Constraint *node, const void *parent, const char *field_name, unsigned int depth) { - if (true) { - _fingerprintString(ctx, "behavior"); - _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); + if (node->access_method != NULL) { + _fingerprintString(ctx, "access_method"); + _fingerprintString(ctx, node->access_method); } - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); - _fingerprintString(ctx, "true"); + if (node->conname != NULL) { + _fingerprintString(ctx, "conname"); + _fingerprintString(ctx, node->conname); } - if (node->subname != NULL) { - _fingerprintString(ctx, "subname"); - _fingerprintString(ctx, node->subname); + if (true) { + _fingerprintString(ctx, "contype"); + _fingerprintString(ctx, _enumToStringConstrType(node->contype)); } -} + if (node->cooked_expr != NULL) { + _fingerprintString(ctx, "cooked_expr"); + _fingerprintString(ctx, node->cooked_expr); + } -static void -_fingerprintCreateStatsStmt(FingerprintContext *ctx, const CreateStatsStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->defnames != NULL && node->defnames->length > 0) { + if (node->deferrable) { + _fingerprintString(ctx, "deferrable"); + _fingerprintString(ctx, "true"); + } + + if (node->exclusions != NULL && node->exclusions->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "defnames"); + _fingerprintString(ctx, "exclusions"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->defnames, node, "defnames", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->defnames) == 1 && linitial(node->defnames) == NIL)) { + _fingerprintNode(ctx, node->exclusions, node, "exclusions", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->exclusions) == 1 && linitial(node->exclusions) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->exprs != NULL && node->exprs->length > 0) { + if (node->fk_attrs != NULL && node->fk_attrs->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "exprs"); + _fingerprintString(ctx, "fk_attrs"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->exprs, node, "exprs", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->exprs) == 1 && linitial(node->exprs) == NIL)) { + _fingerprintNode(ctx, node->fk_attrs, node, "fk_attrs", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fk_attrs) == 1 && linitial(node->fk_attrs) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->if_not_exists) { - _fingerprintString(ctx, "if_not_exists"); - _fingerprintString(ctx, "true"); + if (node->fk_del_action != 0) { + char buffer[2] = {node->fk_del_action, '\0'}; + _fingerprintString(ctx, "fk_del_action"); + _fingerprintString(ctx, buffer); } - if (node->relations != NULL && node->relations->length > 0) { + if (node->fk_del_set_cols != NULL && node->fk_del_set_cols->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relations"); + _fingerprintString(ctx, "fk_del_set_cols"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->relations, node, "relations", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->relations) == 1 && linitial(node->relations) == NIL)) { + _fingerprintNode(ctx, node->fk_del_set_cols, node, "fk_del_set_cols", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fk_del_set_cols) == 1 && linitial(node->fk_del_set_cols) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->stat_types != NULL && node->stat_types->length > 0) { + if (node->fk_matchtype != 0) { + char buffer[2] = {node->fk_matchtype, '\0'}; + _fingerprintString(ctx, "fk_matchtype"); + _fingerprintString(ctx, buffer); + } + + if (node->fk_upd_action != 0) { + char buffer[2] = {node->fk_upd_action, '\0'}; + _fingerprintString(ctx, "fk_upd_action"); + _fingerprintString(ctx, buffer); + } + + if (node->generated_when != 0) { + char buffer[2] = {node->generated_when, '\0'}; + _fingerprintString(ctx, "generated_when"); + _fingerprintString(ctx, buffer); + } + + if (node->including != NULL && node->including->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "stat_types"); + _fingerprintString(ctx, "including"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->stat_types, node, "stat_types", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->stat_types) == 1 && linitial(node->stat_types) == NIL)) { + _fingerprintNode(ctx, node->including, node, "including", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->including) == 1 && linitial(node->including) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->stxcomment != NULL) { - _fingerprintString(ctx, "stxcomment"); - _fingerprintString(ctx, node->stxcomment); + if (node->indexname != NULL) { + _fingerprintString(ctx, "indexname"); + _fingerprintString(ctx, node->indexname); } - if (node->transformed) { - _fingerprintString(ctx, "transformed"); + if (node->indexspace != NULL) { + _fingerprintString(ctx, "indexspace"); + _fingerprintString(ctx, node->indexspace); + } + + if (node->initdeferred) { + _fingerprintString(ctx, "initdeferred"); _fingerprintString(ctx, "true"); } -} + if (node->initially_valid) { + _fingerprintString(ctx, "initially_valid"); + _fingerprintString(ctx, "true"); + } -static void -_fingerprintAlterCollationStmt(FingerprintContext *ctx, const AlterCollationStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->collname != NULL && node->collname->length > 0) { + if (node->is_no_inherit) { + _fingerprintString(ctx, "is_no_inherit"); + _fingerprintString(ctx, "true"); + } + + if (node->keys != NULL && node->keys->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "collname"); + _fingerprintString(ctx, "keys"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->collname, node, "collname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->collname) == 1 && linitial(node->collname) == NIL)) { + _fingerprintNode(ctx, node->keys, node, "keys", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->keys) == 1 && linitial(node->keys) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} + // Intentionally ignoring node->location for fingerprinting -static void -_fingerprintCallStmt(FingerprintContext *ctx, const CallStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->funccall != NULL) { + if (node->nulls_not_distinct) { + _fingerprintString(ctx, "nulls_not_distinct"); + _fingerprintString(ctx, "true"); + } + + if (node->old_conpfeqop != NULL && node->old_conpfeqop->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funccall"); + _fingerprintString(ctx, "old_conpfeqop"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintFuncCall(ctx, node->funccall, node, "funccall", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->old_conpfeqop, node, "old_conpfeqop", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->old_conpfeqop) == 1 && linitial(node->old_conpfeqop) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->old_pktable_oid != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->old_pktable_oid); + _fingerprintString(ctx, "old_pktable_oid"); + _fingerprintString(ctx, buffer); + } - if (node->funcexpr != NULL) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funcexpr"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintFuncExpr(ctx, node->funcexpr, node, "funcexpr", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->pk_attrs != NULL && node->pk_attrs->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; - if (node->outargs != NULL && node->outargs->length > 0) { + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "pk_attrs"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->pk_attrs, node, "pk_attrs", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->pk_attrs) == 1 && linitial(node->pk_attrs) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->pktable != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "outargs"); + _fingerprintString(ctx, "pktable"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->outargs, node, "outargs", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->outargs) == 1 && linitial(node->outargs) == NIL)) { + _fingerprintRangeVar(ctx, node->pktable, node, "pktable", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} -static void -_fingerprintAlterStatsStmt(FingerprintContext *ctx, const AlterStatsStmt *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->defnames != NULL && node->defnames->length > 0) { + if (node->raw_expr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "defnames"); + _fingerprintString(ctx, "raw_expr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->defnames, node, "defnames", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->defnames) == 1 && linitial(node->defnames) == NIL)) { + _fingerprintNode(ctx, node->raw_expr, node, "raw_expr", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->missing_ok) { - _fingerprintString(ctx, "missing_ok"); - _fingerprintString(ctx, "true"); - } - if (node->stxstattarget != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->stxstattarget); - _fingerprintString(ctx, "stxstattarget"); - _fingerprintString(ctx, buffer); + if (node->reset_default_tblspc) { + _fingerprintString(ctx, "reset_default_tblspc"); + _fingerprintString(ctx, "true"); } -} - -static void -_fingerprintA_Expr(FingerprintContext *ctx, const A_Expr *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (true) { - _fingerprintString(ctx, "kind"); - if (node->kind == AEXPR_OP_ANY || node->kind == AEXPR_IN) - _fingerprintString(ctx, "AEXPR_OP"); - else - _fingerprintString(ctx, _enumToStringA_Expr_Kind(node->kind)); + if (node->skip_validation) { + _fingerprintString(ctx, "skip_validation"); + _fingerprintString(ctx, "true"); } - if (node->lexpr != NULL) { + if (node->where_clause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "lexpr"); + _fingerprintString(ctx, "where_clause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->lexpr, node, "lexpr", depth + 1); + _fingerprintNode(ctx, node->where_clause, node, "where_clause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -9446,33 +9387,38 @@ _fingerprintA_Expr(FingerprintContext *ctx, const A_Expr *node, const void *pare XXH3_freeState(prev); } +} + +static void +_fingerprintCreateTableSpaceStmt(FingerprintContext *ctx, const CreateTableSpaceStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ // Intentionally ignoring node->location for fingerprinting - if (node->name != NULL && node->name->length > 0) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "name"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->name, node, "name", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->name) == 1 && linitial(node->name) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->rexpr != NULL) { + if (node->owner != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "rexpr"); + _fingerprintString(ctx, "owner"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->rexpr, node, "rexpr", depth + 1); + _fingerprintRoleSpec(ctx, node->owner, node, "owner", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -9481,141 +9427,181 @@ _fingerprintA_Expr(FingerprintContext *ctx, const A_Expr *node, const void *pare XXH3_freeState(prev); } + if (node->tablespacename != NULL) { + _fingerprintString(ctx, "tablespacename"); + _fingerprintString(ctx, node->tablespacename); + } + } static void -_fingerprintColumnRef(FingerprintContext *ctx, const ColumnRef *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintDropTableSpaceStmt(FingerprintContext *ctx, const DropTableSpaceStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->fields != NULL && node->fields->length > 0) { + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); + _fingerprintString(ctx, "true"); + } + + if (node->tablespacename != NULL) { + _fingerprintString(ctx, "tablespacename"); + _fingerprintString(ctx, node->tablespacename); + } + +} + +static void +_fingerprintAlterTableSpaceOptionsStmt(FingerprintContext *ctx, const AlterTableSpaceOptionsStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->isReset) { + _fingerprintString(ctx, "isReset"); + _fingerprintString(ctx, "true"); + } + + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "fields"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->fields, node, "fields", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fields) == 1 && linitial(node->fields) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting + if (node->tablespacename != NULL) { + _fingerprintString(ctx, "tablespacename"); + _fingerprintString(ctx, node->tablespacename); + } } static void -_fingerprintParamRef(FingerprintContext *ctx, const ParamRef *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterTableMoveAllStmt(FingerprintContext *ctx, const AlterTableMoveAllStmt *node, const void *parent, const char *field_name, unsigned int depth) { - // Intentionally ignoring all fields for fingerprinting -} + if (node->new_tablespacename != NULL) { + _fingerprintString(ctx, "new_tablespacename"); + _fingerprintString(ctx, node->new_tablespacename); + } -static void -_fingerprintFuncCall(FingerprintContext *ctx, const FuncCall *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->agg_distinct) { - _fingerprintString(ctx, "agg_distinct"); + if (node->nowait) { + _fingerprintString(ctx, "nowait"); _fingerprintString(ctx, "true"); } - if (node->agg_filter != NULL) { + if (true) { + _fingerprintString(ctx, "objtype"); + _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); + } + + if (node->orig_tablespacename != NULL) { + _fingerprintString(ctx, "orig_tablespacename"); + _fingerprintString(ctx, node->orig_tablespacename); + } + + if (node->roles != NULL && node->roles->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "agg_filter"); + _fingerprintString(ctx, "roles"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->agg_filter, node, "agg_filter", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->agg_order != NULL && node->agg_order->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "agg_order"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->agg_order, node, "agg_order", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->agg_order) == 1 && linitial(node->agg_order) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - if (node->agg_star) { - _fingerprintString(ctx, "agg_star"); - _fingerprintString(ctx, "true"); +static void +_fingerprintCreateExtensionStmt(FingerprintContext *ctx, const CreateExtensionStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->extname != NULL) { + _fingerprintString(ctx, "extname"); + _fingerprintString(ctx, node->extname); } - if (node->agg_within_group) { - _fingerprintString(ctx, "agg_within_group"); + if (node->if_not_exists) { + _fingerprintString(ctx, "if_not_exists"); _fingerprintString(ctx, "true"); } - if (node->args != NULL && node->args->length > 0) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "args"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->args, node, "args", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->func_variadic) { - _fingerprintString(ctx, "func_variadic"); - _fingerprintString(ctx, "true"); - } +} - if (true) { - _fingerprintString(ctx, "funcformat"); - _fingerprintString(ctx, _enumToStringCoercionForm(node->funcformat)); +static void +_fingerprintAlterExtensionStmt(FingerprintContext *ctx, const AlterExtensionStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->extname != NULL) { + _fingerprintString(ctx, "extname"); + _fingerprintString(ctx, node->extname); } - if (node->funcname != NULL && node->funcname->length > 0) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funcname"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->funcname, node, "funcname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funcname) == 1 && linitial(node->funcname) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting +} - if (node->over != NULL) { +static void +_fingerprintAlterExtensionContentsStmt(FingerprintContext *ctx, const AlterExtensionContentsStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->action != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->action); + _fingerprintString(ctx, "action"); + _fingerprintString(ctx, buffer); + } + + if (node->extname != NULL) { + _fingerprintString(ctx, "extname"); + _fingerprintString(ctx, node->extname); + } + + if (node->object != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "over"); + _fingerprintString(ctx, "object"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintWindowDef(ctx, node->over, node, "over", depth + 1); + _fingerprintNode(ctx, node->object, node, "object", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -9624,87 +9610,89 @@ _fingerprintFuncCall(FingerprintContext *ctx, const FuncCall *node, const void * XXH3_freeState(prev); } -} + if (true) { + _fingerprintString(ctx, "objtype"); + _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); + } -static void -_fingerprintA_Star(FingerprintContext *ctx, const A_Star *node, const void *parent, const char *field_name, unsigned int depth) -{ } static void -_fingerprintA_Indices(FingerprintContext *ctx, const A_Indices *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreateFdwStmt(FingerprintContext *ctx, const CreateFdwStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->is_slice) { - _fingerprintString(ctx, "is_slice"); - _fingerprintString(ctx, "true"); + if (node->fdwname != NULL) { + _fingerprintString(ctx, "fdwname"); + _fingerprintString(ctx, node->fdwname); } - if (node->lidx != NULL) { + if (node->func_options != NULL && node->func_options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "lidx"); + _fingerprintString(ctx, "func_options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->lidx, node, "lidx", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->func_options, node, "func_options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->func_options) == 1 && linitial(node->func_options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->uidx != NULL) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "uidx"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->uidx, node, "uidx", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - } static void -_fingerprintA_Indirection(FingerprintContext *ctx, const A_Indirection *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterFdwStmt(FingerprintContext *ctx, const AlterFdwStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->arg != NULL) { + if (node->fdwname != NULL) { + _fingerprintString(ctx, "fdwname"); + _fingerprintString(ctx, node->fdwname); + } + + if (node->func_options != NULL && node->func_options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "arg"); + _fingerprintString(ctx, "func_options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->func_options, node, "func_options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->func_options) == 1 && linitial(node->func_options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->indirection != NULL && node->indirection->length > 0) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "indirection"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->indirection, node, "indirection", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indirection) == 1 && linitial(node->indirection) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); @@ -9714,121 +9702,153 @@ _fingerprintA_Indirection(FingerprintContext *ctx, const A_Indirection *node, co } static void -_fingerprintA_ArrayExpr(FingerprintContext *ctx, const A_ArrayExpr *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreateForeignServerStmt(FingerprintContext *ctx, const CreateForeignServerStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->elements != NULL && node->elements->length > 0) { + if (node->fdwname != NULL) { + _fingerprintString(ctx, "fdwname"); + _fingerprintString(ctx, node->fdwname); + } + + if (node->if_not_exists) { + _fingerprintString(ctx, "if_not_exists"); + _fingerprintString(ctx, "true"); + } + + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "elements"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->elements, node, "elements", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->elements) == 1 && linitial(node->elements) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting + if (node->servername != NULL) { + _fingerprintString(ctx, "servername"); + _fingerprintString(ctx, node->servername); + } + + if (node->servertype != NULL) { + _fingerprintString(ctx, "servertype"); + _fingerprintString(ctx, node->servertype); + } + + if (node->version != NULL) { + _fingerprintString(ctx, "version"); + _fingerprintString(ctx, node->version); + } } static void -_fingerprintResTarget(FingerprintContext *ctx, const ResTarget *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterForeignServerStmt(FingerprintContext *ctx, const AlterForeignServerStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->indirection != NULL && node->indirection->length > 0) { + if (node->has_version) { + _fingerprintString(ctx, "has_version"); + _fingerprintString(ctx, "true"); + } + + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "indirection"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->indirection, node, "indirection", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indirection) == 1 && linitial(node->indirection) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting + if (node->servername != NULL) { + _fingerprintString(ctx, "servername"); + _fingerprintString(ctx, node->servername); + } - if (node->name != NULL && (field_name == NULL || parent == NULL || !IsA(parent, SelectStmt) || strcmp(field_name, "targetList") != 0)) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); + if (node->version != NULL) { + _fingerprintString(ctx, "version"); + _fingerprintString(ctx, node->version); } - if (node->val != NULL) { +} + +static void +_fingerprintCreateForeignTableStmt(FingerprintContext *ctx, const CreateForeignTableStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + _fingerprintString(ctx, "base"); + _fingerprintCreateStmt(ctx, (const CreateStmt*) &node->base, node, "base", depth); + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "val"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->val, node, "val", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->servername != NULL) { + _fingerprintString(ctx, "servername"); + _fingerprintString(ctx, node->servername); + } } static void -_fingerprintMultiAssignRef(FingerprintContext *ctx, const MultiAssignRef *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreateUserMappingStmt(FingerprintContext *ctx, const CreateUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->colno != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->colno); - _fingerprintString(ctx, "colno"); - _fingerprintString(ctx, buffer); - } - - if (node->ncolumns != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->ncolumns); - _fingerprintString(ctx, "ncolumns"); - _fingerprintString(ctx, buffer); + if (node->if_not_exists) { + _fingerprintString(ctx, "if_not_exists"); + _fingerprintString(ctx, "true"); } - if (node->source != NULL) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "source"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->source, node, "source", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->servername != NULL) { + _fingerprintString(ctx, "servername"); + _fingerprintString(ctx, node->servername); + } -} - -static void -_fingerprintTypeCast(FingerprintContext *ctx, const TypeCast *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->arg != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; + if (node->user != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "arg"); + _fingerprintString(ctx, "user"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); + _fingerprintRoleSpec(ctx, node->user, node, "user", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -9837,39 +9857,41 @@ _fingerprintTypeCast(FingerprintContext *ctx, const TypeCast *node, const void * XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting +} - if (node->typeName != NULL) { +static void +_fingerprintAlterUserMappingStmt(FingerprintContext *ctx, const AlterUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typeName"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->servername != NULL) { + _fingerprintString(ctx, "servername"); + _fingerprintString(ctx, node->servername); + } -} - -static void -_fingerprintCollateClause(FingerprintContext *ctx, const CollateClause *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->arg != NULL) { + if (node->user != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "arg"); + _fingerprintString(ctx, "user"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); + _fingerprintRoleSpec(ctx, node->user, node, "user", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -9878,68 +9900,89 @@ _fingerprintCollateClause(FingerprintContext *ctx, const CollateClause *node, co XXH3_freeState(prev); } - if (node->collname != NULL && node->collname->length > 0) { +} + +static void +_fingerprintDropUserMappingStmt(FingerprintContext *ctx, const DropUserMappingStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); + _fingerprintString(ctx, "true"); + } + + if (node->servername != NULL) { + _fingerprintString(ctx, "servername"); + _fingerprintString(ctx, node->servername); + } + + if (node->user != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "collname"); + _fingerprintString(ctx, "user"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->collname, node, "collname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->collname) == 1 && linitial(node->collname) == NIL)) { + _fingerprintRoleSpec(ctx, node->user, node, "user", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting } static void -_fingerprintSortBy(FingerprintContext *ctx, const SortBy *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintImportForeignSchemaStmt(FingerprintContext *ctx, const ImportForeignSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth) { - // Intentionally ignoring node->location for fingerprinting + if (true) { + _fingerprintString(ctx, "list_type"); + _fingerprintString(ctx, _enumToStringImportForeignSchemaType(node->list_type)); + } - if (node->node != NULL) { + if (node->local_schema != NULL) { + _fingerprintString(ctx, "local_schema"); + _fingerprintString(ctx, node->local_schema); + } + + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "node"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->node, node, "node", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (true) { - _fingerprintString(ctx, "sortby_dir"); - _fingerprintString(ctx, _enumToStringSortByDir(node->sortby_dir)); + if (node->remote_schema != NULL) { + _fingerprintString(ctx, "remote_schema"); + _fingerprintString(ctx, node->remote_schema); } - if (true) { - _fingerprintString(ctx, "sortby_nulls"); - _fingerprintString(ctx, _enumToStringSortByNulls(node->sortby_nulls)); + if (node->server_name != NULL) { + _fingerprintString(ctx, "server_name"); + _fingerprintString(ctx, node->server_name); } - if (node->useOp != NULL && node->useOp->length > 0) { + if (node->table_list != NULL && node->table_list->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "useOp"); + _fingerprintString(ctx, "table_list"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->useOp, node, "useOp", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->useOp) == 1 && linitial(node->useOp) == NIL)) { + _fingerprintNode(ctx, node->table_list, node, "table_list", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->table_list) == 1 && linitial(node->table_list) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); @@ -9949,17 +9992,32 @@ _fingerprintSortBy(FingerprintContext *ctx, const SortBy *node, const void *pare } static void -_fingerprintWindowDef(FingerprintContext *ctx, const WindowDef *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreatePolicyStmt(FingerprintContext *ctx, const CreatePolicyStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->endOffset != NULL) { + if (node->cmd_name != NULL) { + _fingerprintString(ctx, "cmd_name"); + _fingerprintString(ctx, node->cmd_name); + } + + if (node->permissive) { + _fingerprintString(ctx, "permissive"); + _fingerprintString(ctx, "true"); + } + + if (node->policy_name != NULL) { + _fingerprintString(ctx, "policy_name"); + _fingerprintString(ctx, node->policy_name); + } + + if (node->qual != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "endOffset"); + _fingerprintString(ctx, "qual"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->endOffset, node, "endOffset", depth + 1); + _fingerprintNode(ctx, node->qual, node, "qual", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -9968,66 +10026,48 @@ _fingerprintWindowDef(FingerprintContext *ctx, const WindowDef *node, const void XXH3_freeState(prev); } - if (node->frameOptions != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->frameOptions); - _fingerprintString(ctx, "frameOptions"); - _fingerprintString(ctx, buffer); - } - - // Intentionally ignoring node->location for fingerprinting - - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); - } - - if (node->orderClause != NULL && node->orderClause->length > 0) { + if (node->roles != NULL && node->roles->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "orderClause"); + _fingerprintString(ctx, "roles"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->orderClause, node, "orderClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->orderClause) == 1 && linitial(node->orderClause) == NIL)) { + _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->partitionClause != NULL && node->partitionClause->length > 0) { + if (node->table != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "partitionClause"); + _fingerprintString(ctx, "table"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->partitionClause, node, "partitionClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->partitionClause) == 1 && linitial(node->partitionClause) == NIL)) { + _fingerprintRangeVar(ctx, node->table, node, "table", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->refname != NULL) { - _fingerprintString(ctx, "refname"); - _fingerprintString(ctx, node->refname); - } - if (node->startOffset != NULL) { + if (node->with_check != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "startOffset"); + _fingerprintString(ctx, "with_check"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->startOffset, node, "startOffset", depth + 1); + _fingerprintNode(ctx, node->with_check, node, "with_check", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -10039,17 +10079,22 @@ _fingerprintWindowDef(FingerprintContext *ctx, const WindowDef *node, const void } static void -_fingerprintRangeSubselect(FingerprintContext *ctx, const RangeSubselect *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterPolicyStmt(FingerprintContext *ctx, const AlterPolicyStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->alias != NULL) { + if (node->policy_name != NULL) { + _fingerprintString(ctx, "policy_name"); + _fingerprintString(ctx, node->policy_name); + } + + if (node->qual != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "alias"); + _fingerprintString(ctx, "qual"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintAlias(ctx, node->alias, node, "alias", depth + 1); + _fingerprintNode(ctx, node->qual, node, "qual", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -10058,42 +10103,31 @@ _fingerprintRangeSubselect(FingerprintContext *ctx, const RangeSubselect *node, XXH3_freeState(prev); } - if (node->lateral) { - _fingerprintString(ctx, "lateral"); - _fingerprintString(ctx, "true"); - } - - if (node->subquery != NULL) { + if (node->roles != NULL && node->roles->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "subquery"); + _fingerprintString(ctx, "roles"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->subquery, node, "subquery", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - -} - -static void -_fingerprintRangeFunction(FingerprintContext *ctx, const RangeFunction *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->alias != NULL) { + if (node->table != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "alias"); + _fingerprintString(ctx, "table"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintAlias(ctx, node->alias, node, "alias", depth + 1); + _fingerprintRangeVar(ctx, node->table, node, "table", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -10102,57 +10136,59 @@ _fingerprintRangeFunction(FingerprintContext *ctx, const RangeFunction *node, co XXH3_freeState(prev); } - if (node->coldeflist != NULL && node->coldeflist->length > 0) { + if (node->with_check != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "coldeflist"); + _fingerprintString(ctx, "with_check"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->coldeflist, node, "coldeflist", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->coldeflist) == 1 && linitial(node->coldeflist) == NIL)) { + _fingerprintNode(ctx, node->with_check, node, "with_check", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->functions != NULL && node->functions->length > 0) { + +} + +static void +_fingerprintCreateAmStmt(FingerprintContext *ctx, const CreateAmStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->amname != NULL) { + _fingerprintString(ctx, "amname"); + _fingerprintString(ctx, node->amname); + } + + if (node->amtype != 0) { + char buffer[2] = {node->amtype, '\0'}; + _fingerprintString(ctx, "amtype"); + _fingerprintString(ctx, buffer); + } + + if (node->handler_name != NULL && node->handler_name->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "functions"); + _fingerprintString(ctx, "handler_name"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->functions, node, "functions", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->functions) == 1 && linitial(node->functions) == NIL)) { + _fingerprintNode(ctx, node->handler_name, node, "handler_name", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->handler_name) == 1 && linitial(node->handler_name) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->is_rowsfrom) { - _fingerprintString(ctx, "is_rowsfrom"); - _fingerprintString(ctx, "true"); - } - - if (node->lateral) { - _fingerprintString(ctx, "lateral"); - _fingerprintString(ctx, "true"); - } - - if (node->ordinality) { - _fingerprintString(ctx, "ordinality"); - _fingerprintString(ctx, "true"); - } - } static void -_fingerprintRangeTableSample(FingerprintContext *ctx, const RangeTableSample *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreateTrigStmt(FingerprintContext *ctx, const CreateTrigStmt *node, const void *parent, const char *field_name, unsigned int depth) { if (node->args != NULL && node->args->length > 0) { XXH3_state_t* prev = XXH3_createState(); @@ -10170,33 +10206,31 @@ _fingerprintRangeTableSample(FingerprintContext *ctx, const RangeTableSample *no } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting - - if (node->method != NULL && node->method->length > 0) { + if (node->columns != NULL && node->columns->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "method"); + _fingerprintString(ctx, "columns"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->method, node, "method", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->method) == 1 && linitial(node->method) == NIL)) { + _fingerprintNode(ctx, node->columns, node, "columns", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->columns) == 1 && linitial(node->columns) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->relation != NULL) { + if (node->constrrel != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "constrrel"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->relation, node, "relation", depth + 1); + _fingerprintRangeVar(ctx, node->constrrel, node, "constrrel", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -10205,37 +10239,53 @@ _fingerprintRangeTableSample(FingerprintContext *ctx, const RangeTableSample *no XXH3_freeState(prev); } - if (node->repeatable != NULL) { + if (node->deferrable) { + _fingerprintString(ctx, "deferrable"); + _fingerprintString(ctx, "true"); + } + + if (node->events != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->events); + _fingerprintString(ctx, "events"); + _fingerprintString(ctx, buffer); + } + + if (node->funcname != NULL && node->funcname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "repeatable"); + _fingerprintString(ctx, "funcname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->repeatable, node, "repeatable", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->funcname, node, "funcname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funcname) == 1 && linitial(node->funcname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->initdeferred) { + _fingerprintString(ctx, "initdeferred"); + _fingerprintString(ctx, "true"); + } -} + if (node->isconstraint) { + _fingerprintString(ctx, "isconstraint"); + _fingerprintString(ctx, "true"); + } -static void -_fingerprintRangeTableFunc(FingerprintContext *ctx, const RangeTableFunc *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->alias != NULL) { + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "alias"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintAlias(ctx, node->alias, node, "alias", depth + 1); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -10244,31 +10294,53 @@ _fingerprintRangeTableFunc(FingerprintContext *ctx, const RangeTableFunc *node, XXH3_freeState(prev); } - if (node->columns != NULL && node->columns->length > 0) { + if (node->replace) { + _fingerprintString(ctx, "replace"); + _fingerprintString(ctx, "true"); + } + + if (node->row) { + _fingerprintString(ctx, "row"); + _fingerprintString(ctx, "true"); + } + + if (node->timing != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->timing); + _fingerprintString(ctx, "timing"); + _fingerprintString(ctx, buffer); + } + + if (node->transitionRels != NULL && node->transitionRels->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "columns"); + _fingerprintString(ctx, "transitionRels"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->columns, node, "columns", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->columns) == 1 && linitial(node->columns) == NIL)) { + _fingerprintNode(ctx, node->transitionRels, node, "transitionRels", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->transitionRels) == 1 && linitial(node->transitionRels) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->docexpr != NULL) { + if (node->trigname != NULL) { + _fingerprintString(ctx, "trigname"); + _fingerprintString(ctx, node->trigname); + } + + if (node->whenClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "docexpr"); + _fingerprintString(ctx, "whenClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->docexpr, node, "docexpr", depth + 1); + _fingerprintNode(ctx, node->whenClause, node, "whenClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -10277,212 +10349,205 @@ _fingerprintRangeTableFunc(FingerprintContext *ctx, const RangeTableFunc *node, XXH3_freeState(prev); } - if (node->lateral) { - _fingerprintString(ctx, "lateral"); - _fingerprintString(ctx, "true"); - } +} - // Intentionally ignoring node->location for fingerprinting +static void +_fingerprintCreateEventTrigStmt(FingerprintContext *ctx, const CreateEventTrigStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->eventname != NULL) { + _fingerprintString(ctx, "eventname"); + _fingerprintString(ctx, node->eventname); + } - if (node->namespaces != NULL && node->namespaces->length > 0) { + if (node->funcname != NULL && node->funcname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "namespaces"); + _fingerprintString(ctx, "funcname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->namespaces, node, "namespaces", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->namespaces) == 1 && linitial(node->namespaces) == NIL)) { + _fingerprintNode(ctx, node->funcname, node, "funcname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funcname) == 1 && linitial(node->funcname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->rowexpr != NULL) { + if (node->trigname != NULL) { + _fingerprintString(ctx, "trigname"); + _fingerprintString(ctx, node->trigname); + } + + if (node->whenclause != NULL && node->whenclause->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "rowexpr"); + _fingerprintString(ctx, "whenclause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->rowexpr, node, "rowexpr", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->whenclause, node, "whenclause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->whenclause) == 1 && linitial(node->whenclause) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} + +static void +_fingerprintAlterEventTrigStmt(FingerprintContext *ctx, const AlterEventTrigStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->tgenabled != 0) { + char buffer[2] = {node->tgenabled, '\0'}; + _fingerprintString(ctx, "tgenabled"); + _fingerprintString(ctx, buffer); + } + + if (node->trigname != NULL) { + _fingerprintString(ctx, "trigname"); + _fingerprintString(ctx, node->trigname); + } } static void -_fingerprintRangeTableFuncCol(FingerprintContext *ctx, const RangeTableFuncCol *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreatePLangStmt(FingerprintContext *ctx, const CreatePLangStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->coldefexpr != NULL) { + if (node->plhandler != NULL && node->plhandler->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "coldefexpr"); + _fingerprintString(ctx, "plhandler"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->coldefexpr, node, "coldefexpr", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->plhandler, node, "plhandler", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->plhandler) == 1 && linitial(node->plhandler) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->colexpr != NULL) { + if (node->plinline != NULL && node->plinline->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "colexpr"); + _fingerprintString(ctx, "plinline"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->colexpr, node, "colexpr", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->plinline, node, "plinline", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->plinline) == 1 && linitial(node->plinline) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->colname != NULL) { - _fingerprintString(ctx, "colname"); - _fingerprintString(ctx, node->colname); - } - - if (node->for_ordinality) { - _fingerprintString(ctx, "for_ordinality"); - _fingerprintString(ctx, "true"); + if (node->plname != NULL) { + _fingerprintString(ctx, "plname"); + _fingerprintString(ctx, node->plname); } - if (node->is_not_null) { - _fingerprintString(ctx, "is_not_null"); + if (node->pltrusted) { + _fingerprintString(ctx, "pltrusted"); _fingerprintString(ctx, "true"); } - // Intentionally ignoring node->location for fingerprinting - - if (node->typeName != NULL) { + if (node->plvalidator != NULL && node->plvalidator->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typeName"); + _fingerprintString(ctx, "plvalidator"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->plvalidator, node, "plvalidator", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->plvalidator) == 1 && linitial(node->plvalidator) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->replace) { + _fingerprintString(ctx, "replace"); + _fingerprintString(ctx, "true"); + } } static void -_fingerprintTypeName(FingerprintContext *ctx, const TypeName *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreateRoleStmt(FingerprintContext *ctx, const CreateRoleStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->arrayBounds != NULL && node->arrayBounds->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "arrayBounds"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->arrayBounds, node, "arrayBounds", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->arrayBounds) == 1 && linitial(node->arrayBounds) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - // Intentionally ignoring node->location for fingerprinting - - if (node->names != NULL && node->names->length > 0) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "names"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->names, node, "names", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->names) == 1 && linitial(node->names) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->pct_type) { - _fingerprintString(ctx, "pct_type"); - _fingerprintString(ctx, "true"); + if (node->role != NULL) { + _fingerprintString(ctx, "role"); + _fingerprintString(ctx, node->role); } - if (node->setof) { - _fingerprintString(ctx, "setof"); - _fingerprintString(ctx, "true"); + if (true) { + _fingerprintString(ctx, "stmt_type"); + _fingerprintString(ctx, _enumToStringRoleStmtType(node->stmt_type)); } - if (node->typeOid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->typeOid); - _fingerprintString(ctx, "typeOid"); - _fingerprintString(ctx, buffer); - } +} - if (node->typemod != 0) { +static void +_fingerprintAlterRoleStmt(FingerprintContext *ctx, const AlterRoleStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->action != 0) { char buffer[50]; - sprintf(buffer, "%d", node->typemod); - _fingerprintString(ctx, "typemod"); + sprintf(buffer, "%d", node->action); + _fingerprintString(ctx, "action"); _fingerprintString(ctx, buffer); } - if (node->typmods != NULL && node->typmods->length > 0) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typmods"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->typmods, node, "typmods", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typmods) == 1 && linitial(node->typmods) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} - -static void -_fingerprintColumnDef(FingerprintContext *ctx, const ColumnDef *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->collClause != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; + if (node->role != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "collClause"); + _fingerprintString(ctx, "role"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintCollateClause(ctx, node->collClause, node, "collClause", depth + 1); + _fingerprintRoleSpec(ctx, node->role, node, "role", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -10491,48 +10556,42 @@ _fingerprintColumnDef(FingerprintContext *ctx, const ColumnDef *node, const void XXH3_freeState(prev); } - if (node->collOid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->collOid); - _fingerprintString(ctx, "collOid"); - _fingerprintString(ctx, buffer); - } - - if (node->colname != NULL) { - _fingerprintString(ctx, "colname"); - _fingerprintString(ctx, node->colname); - } +} - if (node->compression != NULL) { - _fingerprintString(ctx, "compression"); - _fingerprintString(ctx, node->compression); +static void +_fingerprintAlterRoleSetStmt(FingerprintContext *ctx, const AlterRoleSetStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->database != NULL) { + _fingerprintString(ctx, "database"); + _fingerprintString(ctx, node->database); } - if (node->constraints != NULL && node->constraints->length > 0) { + if (node->role != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "constraints"); + _fingerprintString(ctx, "role"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->constraints, node, "constraints", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->constraints) == 1 && linitial(node->constraints) == NIL)) { + _fingerprintRoleSpec(ctx, node->role, node, "role", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->cooked_default != NULL) { + + if (node->setstmt != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "cooked_default"); + _fingerprintString(ctx, "setstmt"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->cooked_default, node, "cooked_default", depth + 1); + _fingerprintVariableSetStmt(ctx, node->setstmt, node, "setstmt", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -10541,107 +10600,127 @@ _fingerprintColumnDef(FingerprintContext *ctx, const ColumnDef *node, const void XXH3_freeState(prev); } - if (node->fdwoptions != NULL && node->fdwoptions->length > 0) { +} + +static void +_fingerprintDropRoleStmt(FingerprintContext *ctx, const DropRoleStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); + _fingerprintString(ctx, "true"); + } + + if (node->roles != NULL && node->roles->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "fdwoptions"); + _fingerprintString(ctx, "roles"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->fdwoptions, node, "fdwoptions", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fdwoptions) == 1 && linitial(node->fdwoptions) == NIL)) { + _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->generated != 0) { - char buffer[2] = {node->generated, '\0'}; - _fingerprintString(ctx, "generated"); - _fingerprintString(ctx, buffer); +} + +static void +_fingerprintCreateSeqStmt(FingerprintContext *ctx, const CreateSeqStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->for_identity) { + _fingerprintString(ctx, "for_identity"); + _fingerprintString(ctx, "true"); } - if (node->identity != 0) { - char buffer[2] = {node->identity, '\0'}; - _fingerprintString(ctx, "identity"); - _fingerprintString(ctx, buffer); + if (node->if_not_exists) { + _fingerprintString(ctx, "if_not_exists"); + _fingerprintString(ctx, "true"); } - if (node->identitySequence != NULL) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "identitySequence"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->identitySequence, node, "identitySequence", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->inhcount != 0) { + if (node->ownerId != 0) { char buffer[50]; - sprintf(buffer, "%d", node->inhcount); - _fingerprintString(ctx, "inhcount"); + sprintf(buffer, "%d", node->ownerId); + _fingerprintString(ctx, "ownerId"); _fingerprintString(ctx, buffer); } - if (node->is_from_type) { - _fingerprintString(ctx, "is_from_type"); - _fingerprintString(ctx, "true"); + if (node->sequence != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "sequence"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintRangeVar(ctx, node->sequence, node, "sequence", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); } - if (node->is_local) { - _fingerprintString(ctx, "is_local"); +} + +static void +_fingerprintAlterSeqStmt(FingerprintContext *ctx, const AlterSeqStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->for_identity) { + _fingerprintString(ctx, "for_identity"); _fingerprintString(ctx, "true"); } - if (node->is_not_null) { - _fingerprintString(ctx, "is_not_null"); + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); _fingerprintString(ctx, "true"); } - // Intentionally ignoring node->location for fingerprinting - - if (node->raw_default != NULL) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "raw_default"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->raw_default, node, "raw_default", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->storage != 0) { - char buffer[2] = {node->storage, '\0'}; - _fingerprintString(ctx, "storage"); - _fingerprintString(ctx, buffer); - } - - if (node->typeName != NULL) { + if (node->sequence != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typeName"); + _fingerprintString(ctx, "sequence"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); + _fingerprintRangeVar(ctx, node->sequence, node, "sequence", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -10653,350 +10732,304 @@ _fingerprintColumnDef(FingerprintContext *ctx, const ColumnDef *node, const void } static void -_fingerprintIndexElem(FingerprintContext *ctx, const IndexElem *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintDefineStmt(FingerprintContext *ctx, const DefineStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->collation != NULL && node->collation->length > 0) { + if (node->args != NULL && node->args->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "collation"); + _fingerprintString(ctx, "args"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->collation, node, "collation", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->collation) == 1 && linitial(node->collation) == NIL)) { + _fingerprintNode(ctx, node->args, node, "args", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->expr != NULL) { + if (node->definition != NULL && node->definition->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "expr"); + _fingerprintString(ctx, "definition"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->expr, node, "expr", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->definition, node, "definition", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->definition) == 1 && linitial(node->definition) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->defnames != NULL && node->defnames->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; - if (node->indexcolname != NULL) { - _fingerprintString(ctx, "indexcolname"); - _fingerprintString(ctx, node->indexcolname); - } + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "defnames"); - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->defnames, node, "defnames", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->defnames) == 1 && linitial(node->defnames) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->if_not_exists) { + _fingerprintString(ctx, "if_not_exists"); + _fingerprintString(ctx, "true"); } if (true) { - _fingerprintString(ctx, "nulls_ordering"); - _fingerprintString(ctx, _enumToStringSortByNulls(node->nulls_ordering)); + _fingerprintString(ctx, "kind"); + _fingerprintString(ctx, _enumToStringObjectType(node->kind)); } - if (node->opclass != NULL && node->opclass->length > 0) { + if (node->oldstyle) { + _fingerprintString(ctx, "oldstyle"); + _fingerprintString(ctx, "true"); + } + + if (node->replace) { + _fingerprintString(ctx, "replace"); + _fingerprintString(ctx, "true"); + } + +} + +static void +_fingerprintCreateDomainStmt(FingerprintContext *ctx, const CreateDomainStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->collClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "opclass"); + _fingerprintString(ctx, "collClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->opclass, node, "opclass", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opclass) == 1 && linitial(node->opclass) == NIL)) { + _fingerprintCollateClause(ctx, node->collClause, node, "collClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->opclassopts != NULL && node->opclassopts->length > 0) { + + if (node->constraints != NULL && node->constraints->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "opclassopts"); + _fingerprintString(ctx, "constraints"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->opclassopts, node, "opclassopts", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opclassopts) == 1 && linitial(node->opclassopts) == NIL)) { + _fingerprintNode(ctx, node->constraints, node, "constraints", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->constraints) == 1 && linitial(node->constraints) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "ordering"); - _fingerprintString(ctx, _enumToStringSortByDir(node->ordering)); - } - -} - -static void -_fingerprintStatsElem(FingerprintContext *ctx, const StatsElem *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->expr != NULL) { + if (node->domainname != NULL && node->domainname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "expr"); + _fingerprintString(ctx, "domainname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->expr, node, "expr", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->domainname, node, "domainname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->domainname) == 1 && linitial(node->domainname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); - } - -} - -static void -_fingerprintConstraint(FingerprintContext *ctx, const Constraint *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->access_method != NULL) { - _fingerprintString(ctx, "access_method"); - _fingerprintString(ctx, node->access_method); - } - - if (node->conname != NULL) { - _fingerprintString(ctx, "conname"); - _fingerprintString(ctx, node->conname); - } - - if (true) { - _fingerprintString(ctx, "contype"); - _fingerprintString(ctx, _enumToStringConstrType(node->contype)); - } - - if (node->cooked_expr != NULL) { - _fingerprintString(ctx, "cooked_expr"); - _fingerprintString(ctx, node->cooked_expr); - } - - if (node->deferrable) { - _fingerprintString(ctx, "deferrable"); - _fingerprintString(ctx, "true"); - } - - if (node->exclusions != NULL && node->exclusions->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; + if (node->typeName != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "exclusions"); + _fingerprintString(ctx, "typeName"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->exclusions, node, "exclusions", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->exclusions) == 1 && linitial(node->exclusions) == NIL)) { + _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->fk_attrs != NULL && node->fk_attrs->length > 0) { + +} + +static void +_fingerprintCreateOpClassStmt(FingerprintContext *ctx, const CreateOpClassStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->amname != NULL) { + _fingerprintString(ctx, "amname"); + _fingerprintString(ctx, node->amname); + } + + if (node->datatype != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "fk_attrs"); + _fingerprintString(ctx, "datatype"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->fk_attrs, node, "fk_attrs", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fk_attrs) == 1 && linitial(node->fk_attrs) == NIL)) { + _fingerprintTypeName(ctx, node->datatype, node, "datatype", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->fk_del_action != 0) { - char buffer[2] = {node->fk_del_action, '\0'}; - _fingerprintString(ctx, "fk_del_action"); - _fingerprintString(ctx, buffer); + + if (node->isDefault) { + _fingerprintString(ctx, "isDefault"); + _fingerprintString(ctx, "true"); } - if (node->fk_del_set_cols != NULL && node->fk_del_set_cols->length > 0) { + if (node->items != NULL && node->items->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "fk_del_set_cols"); + _fingerprintString(ctx, "items"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->fk_del_set_cols, node, "fk_del_set_cols", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->fk_del_set_cols) == 1 && linitial(node->fk_del_set_cols) == NIL)) { + _fingerprintNode(ctx, node->items, node, "items", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->items) == 1 && linitial(node->items) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->fk_matchtype != 0) { - char buffer[2] = {node->fk_matchtype, '\0'}; - _fingerprintString(ctx, "fk_matchtype"); - _fingerprintString(ctx, buffer); - } - - if (node->fk_upd_action != 0) { - char buffer[2] = {node->fk_upd_action, '\0'}; - _fingerprintString(ctx, "fk_upd_action"); - _fingerprintString(ctx, buffer); - } - - if (node->generated_when != 0) { - char buffer[2] = {node->generated_when, '\0'}; - _fingerprintString(ctx, "generated_when"); - _fingerprintString(ctx, buffer); - } - - if (node->including != NULL && node->including->length > 0) { + if (node->opclassname != NULL && node->opclassname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "including"); + _fingerprintString(ctx, "opclassname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->including, node, "including", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->including) == 1 && linitial(node->including) == NIL)) { + _fingerprintNode(ctx, node->opclassname, node, "opclassname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opclassname) == 1 && linitial(node->opclassname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->indexname != NULL) { - _fingerprintString(ctx, "indexname"); - _fingerprintString(ctx, node->indexname); - } - - if (node->indexspace != NULL) { - _fingerprintString(ctx, "indexspace"); - _fingerprintString(ctx, node->indexspace); - } - - if (node->initdeferred) { - _fingerprintString(ctx, "initdeferred"); - _fingerprintString(ctx, "true"); - } - - if (node->initially_valid) { - _fingerprintString(ctx, "initially_valid"); - _fingerprintString(ctx, "true"); - } - - if (node->is_no_inherit) { - _fingerprintString(ctx, "is_no_inherit"); - _fingerprintString(ctx, "true"); - } - - if (node->keys != NULL && node->keys->length > 0) { + if (node->opfamilyname != NULL && node->opfamilyname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "keys"); + _fingerprintString(ctx, "opfamilyname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->keys, node, "keys", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->keys) == 1 && linitial(node->keys) == NIL)) { + _fingerprintNode(ctx, node->opfamilyname, node, "opfamilyname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opfamilyname) == 1 && linitial(node->opfamilyname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting - - if (node->nulls_not_distinct) { - _fingerprintString(ctx, "nulls_not_distinct"); - _fingerprintString(ctx, "true"); - } +} - if (node->old_conpfeqop != NULL && node->old_conpfeqop->length > 0) { +static void +_fingerprintCreateOpClassItem(FingerprintContext *ctx, const CreateOpClassItem *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->class_args != NULL && node->class_args->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "old_conpfeqop"); + _fingerprintString(ctx, "class_args"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->old_conpfeqop, node, "old_conpfeqop", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->old_conpfeqop) == 1 && linitial(node->old_conpfeqop) == NIL)) { + _fingerprintNode(ctx, node->class_args, node, "class_args", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->class_args) == 1 && linitial(node->class_args) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->old_pktable_oid != 0) { + if (node->itemtype != 0) { char buffer[50]; - sprintf(buffer, "%d", node->old_pktable_oid); - _fingerprintString(ctx, "old_pktable_oid"); + sprintf(buffer, "%d", node->itemtype); + _fingerprintString(ctx, "itemtype"); _fingerprintString(ctx, buffer); } - if (node->options != NULL && node->options->length > 0) { + if (node->name != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "options"); + _fingerprintString(ctx, "name"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->options, node, "options", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + _fingerprintObjectWithArgs(ctx, node->name, node, "name", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->pk_attrs != NULL && node->pk_attrs->length > 0) { + + if (node->number != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->number); + _fingerprintString(ctx, "number"); + _fingerprintString(ctx, buffer); + } + + if (node->order_family != NULL && node->order_family->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "pk_attrs"); + _fingerprintString(ctx, "order_family"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->pk_attrs, node, "pk_attrs", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->pk_attrs) == 1 && linitial(node->pk_attrs) == NIL)) { + _fingerprintNode(ctx, node->order_family, node, "order_family", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->order_family) == 1 && linitial(node->order_family) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->pktable != NULL) { + if (node->storedtype != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "pktable"); + _fingerprintString(ctx, "storedtype"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->pktable, node, "pktable", depth + 1); + _fingerprintTypeName(ctx, node->storedtype, node, "storedtype", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -11005,199 +11038,202 @@ _fingerprintConstraint(FingerprintContext *ctx, const Constraint *node, const vo XXH3_freeState(prev); } - if (node->raw_expr != NULL) { +} + +static void +_fingerprintCreateOpFamilyStmt(FingerprintContext *ctx, const CreateOpFamilyStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->amname != NULL) { + _fingerprintString(ctx, "amname"); + _fingerprintString(ctx, node->amname); + } + + if (node->opfamilyname != NULL && node->opfamilyname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "raw_expr"); + _fingerprintString(ctx, "opfamilyname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->raw_expr, node, "raw_expr", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->opfamilyname, node, "opfamilyname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opfamilyname) == 1 && linitial(node->opfamilyname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->reset_default_tblspc) { - _fingerprintString(ctx, "reset_default_tblspc"); - _fingerprintString(ctx, "true"); +static void +_fingerprintAlterOpFamilyStmt(FingerprintContext *ctx, const AlterOpFamilyStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->amname != NULL) { + _fingerprintString(ctx, "amname"); + _fingerprintString(ctx, node->amname); } - if (node->skip_validation) { - _fingerprintString(ctx, "skip_validation"); + if (node->isDrop) { + _fingerprintString(ctx, "isDrop"); _fingerprintString(ctx, "true"); } - if (node->where_clause != NULL) { + if (node->items != NULL && node->items->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "where_clause"); + _fingerprintString(ctx, "items"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->where_clause, node, "where_clause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->items, node, "items", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->items) == 1 && linitial(node->items) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - -} - -static void -_fingerprintDefElem(FingerprintContext *ctx, const DefElem *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->arg != NULL) { + if (node->opfamilyname != NULL && node->opfamilyname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "arg"); + _fingerprintString(ctx, "opfamilyname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->arg, node, "arg", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->opfamilyname, node, "opfamilyname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opfamilyname) == 1 && linitial(node->opfamilyname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} +static void +_fingerprintDropStmt(FingerprintContext *ctx, const DropStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ if (true) { - _fingerprintString(ctx, "defaction"); - _fingerprintString(ctx, _enumToStringDefElemAction(node->defaction)); + _fingerprintString(ctx, "behavior"); + _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); } - if (node->defname != NULL) { - _fingerprintString(ctx, "defname"); - _fingerprintString(ctx, node->defname); + if (node->concurrent) { + _fingerprintString(ctx, "concurrent"); + _fingerprintString(ctx, "true"); } - if (node->defnamespace != NULL) { - _fingerprintString(ctx, "defnamespace"); - _fingerprintString(ctx, node->defnamespace); + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); + _fingerprintString(ctx, "true"); } - // Intentionally ignoring node->location for fingerprinting - -} - -static void -_fingerprintRangeTblEntry(FingerprintContext *ctx, const RangeTblEntry *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->alias != NULL) { + if (node->objects != NULL && node->objects->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "alias"); + _fingerprintString(ctx, "objects"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintAlias(ctx, node->alias, node, "alias", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->objects, node, "objects", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objects) == 1 && linitial(node->objects) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (true) { + _fingerprintString(ctx, "removeType"); + _fingerprintString(ctx, _enumToStringObjectType(node->removeType)); + } - if (node->checkAsUser != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->checkAsUser); - _fingerprintString(ctx, "checkAsUser"); - _fingerprintString(ctx, buffer); +} + +static void +_fingerprintTruncateStmt(FingerprintContext *ctx, const TruncateStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (true) { + _fingerprintString(ctx, "behavior"); + _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); } - if (node->colcollations != NULL && node->colcollations->length > 0) { + if (node->relations != NULL && node->relations->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "colcollations"); + _fingerprintString(ctx, "relations"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->colcollations, node, "colcollations", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->colcollations) == 1 && linitial(node->colcollations) == NIL)) { + _fingerprintNode(ctx, node->relations, node, "relations", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->relations) == 1 && linitial(node->relations) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->coltypes != NULL && node->coltypes->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; + if (node->restart_seqs) { + _fingerprintString(ctx, "restart_seqs"); + _fingerprintString(ctx, "true"); + } - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "coltypes"); +} - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->coltypes, node, "coltypes", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->coltypes) == 1 && linitial(node->coltypes) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); +static void +_fingerprintCommentStmt(FingerprintContext *ctx, const CommentStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->comment != NULL) { + _fingerprintString(ctx, "comment"); + _fingerprintString(ctx, node->comment); } - if (node->coltypmods != NULL && node->coltypmods->length > 0) { + + if (node->object != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "coltypmods"); + _fingerprintString(ctx, "object"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->coltypmods, node, "coltypmods", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->coltypmods) == 1 && linitial(node->coltypmods) == NIL)) { + _fingerprintNode(ctx, node->object, node, "object", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->ctelevelsup != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->ctelevelsup); - _fingerprintString(ctx, "ctelevelsup"); - _fingerprintString(ctx, buffer); - } - if (node->ctename != NULL) { - _fingerprintString(ctx, "ctename"); - _fingerprintString(ctx, node->ctename); + if (true) { + _fingerprintString(ctx, "objtype"); + _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); } - if (node->enrname != NULL) { - _fingerprintString(ctx, "enrname"); - _fingerprintString(ctx, node->enrname); - } +} - if (node->enrtuples != 0) { - char buffer[50]; - sprintf(buffer, "%f", node->enrtuples); - _fingerprintString(ctx, "enrtuples"); - _fingerprintString(ctx, buffer); +static void +_fingerprintSecLabelStmt(FingerprintContext *ctx, const SecLabelStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->label != NULL) { + _fingerprintString(ctx, "label"); + _fingerprintString(ctx, node->label); } - if (node->eref != NULL) { + if (node->object != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "eref"); + _fingerprintString(ctx, "object"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintAlias(ctx, node->eref, node, "eref", depth + 1); + _fingerprintNode(ctx, node->object, node, "object", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -11207,230 +11243,270 @@ _fingerprintRangeTblEntry(FingerprintContext *ctx, const RangeTblEntry *node, co } if (true) { - int x; - Bitmapset *bms = bms_copy(node->extraUpdatedCols); + _fingerprintString(ctx, "objtype"); + _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); + } - _fingerprintString(ctx, "extraUpdatedCols"); + if (node->provider != NULL) { + _fingerprintString(ctx, "provider"); + _fingerprintString(ctx, node->provider); + } - while ((x = bms_first_member(bms)) >= 0) { - char buffer[50]; - sprintf(buffer, "%d", x); - _fingerprintString(ctx, buffer); - } +} - bms_free(bms); +static void +_fingerprintDeclareCursorStmt(FingerprintContext *ctx, const DeclareCursorStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->options != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->options); + _fingerprintString(ctx, "options"); + _fingerprintString(ctx, buffer); } - if (node->funcordinality) { - _fingerprintString(ctx, "funcordinality"); - _fingerprintString(ctx, "true"); - } + // Intentionally ignoring node->portalname for fingerprinting - if (node->functions != NULL && node->functions->length > 0) { + if (node->query != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "functions"); + _fingerprintString(ctx, "query"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->functions, node, "functions", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->functions) == 1 && linitial(node->functions) == NIL)) { + _fingerprintNode(ctx, node->query, node, "query", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->inFromCl) { - _fingerprintString(ctx, "inFromCl"); - _fingerprintString(ctx, "true"); + +} + +static void +_fingerprintClosePortalStmt(FingerprintContext *ctx, const ClosePortalStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + // Intentionally ignoring node->portalname for fingerprinting + +} + +static void +_fingerprintFetchStmt(FingerprintContext *ctx, const FetchStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (true) { + _fingerprintString(ctx, "direction"); + _fingerprintString(ctx, _enumToStringFetchDirection(node->direction)); } - if (node->inh) { - _fingerprintString(ctx, "inh"); + if (node->howMany != 0) { + char buffer[50]; + sprintf(buffer, "%ld", node->howMany); + _fingerprintString(ctx, "howMany"); + _fingerprintString(ctx, buffer); + } + + if (node->ismove) { + _fingerprintString(ctx, "ismove"); _fingerprintString(ctx, "true"); } - if (true) { - int x; - Bitmapset *bms = bms_copy(node->insertedCols); + // Intentionally ignoring node->portalname for fingerprinting - _fingerprintString(ctx, "insertedCols"); +} - while ((x = bms_first_member(bms)) >= 0) { - char buffer[50]; - sprintf(buffer, "%d", x); - _fingerprintString(ctx, buffer); - } +static void +_fingerprintIndexStmt(FingerprintContext *ctx, const IndexStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->accessMethod != NULL) { + _fingerprintString(ctx, "accessMethod"); + _fingerprintString(ctx, node->accessMethod); + } - bms_free(bms); + if (node->concurrent) { + _fingerprintString(ctx, "concurrent"); + _fingerprintString(ctx, "true"); } - if (node->join_using_alias != NULL) { + if (node->deferrable) { + _fingerprintString(ctx, "deferrable"); + _fingerprintString(ctx, "true"); + } + + if (node->excludeOpNames != NULL && node->excludeOpNames->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "join_using_alias"); + _fingerprintString(ctx, "excludeOpNames"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintAlias(ctx, node->join_using_alias, node, "join_using_alias", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->excludeOpNames, node, "excludeOpNames", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->excludeOpNames) == 1 && linitial(node->excludeOpNames) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->idxcomment != NULL) { + _fingerprintString(ctx, "idxcomment"); + _fingerprintString(ctx, node->idxcomment); + } - if (node->joinaliasvars != NULL && node->joinaliasvars->length > 0) { + if (node->idxname != NULL) { + _fingerprintString(ctx, "idxname"); + _fingerprintString(ctx, node->idxname); + } + + if (node->if_not_exists) { + _fingerprintString(ctx, "if_not_exists"); + _fingerprintString(ctx, "true"); + } + + if (node->indexIncludingParams != NULL && node->indexIncludingParams->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "joinaliasvars"); + _fingerprintString(ctx, "indexIncludingParams"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->joinaliasvars, node, "joinaliasvars", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->joinaliasvars) == 1 && linitial(node->joinaliasvars) == NIL)) { + _fingerprintNode(ctx, node->indexIncludingParams, node, "indexIncludingParams", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indexIncludingParams) == 1 && linitial(node->indexIncludingParams) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->joinleftcols != NULL && node->joinleftcols->length > 0) { + if (node->indexOid != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->indexOid); + _fingerprintString(ctx, "indexOid"); + _fingerprintString(ctx, buffer); + } + + if (node->indexParams != NULL && node->indexParams->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "joinleftcols"); + _fingerprintString(ctx, "indexParams"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->joinleftcols, node, "joinleftcols", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->joinleftcols) == 1 && linitial(node->joinleftcols) == NIL)) { + _fingerprintNode(ctx, node->indexParams, node, "indexParams", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indexParams) == 1 && linitial(node->indexParams) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->joinmergedcols != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->joinmergedcols); - _fingerprintString(ctx, "joinmergedcols"); - _fingerprintString(ctx, buffer); + if (node->initdeferred) { + _fingerprintString(ctx, "initdeferred"); + _fingerprintString(ctx, "true"); } - if (node->joinrightcols != NULL && node->joinrightcols->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "joinrightcols"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->joinrightcols, node, "joinrightcols", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->joinrightcols) == 1 && linitial(node->joinrightcols) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - if (true) { - _fingerprintString(ctx, "jointype"); - _fingerprintString(ctx, _enumToStringJoinType(node->jointype)); + if (node->isconstraint) { + _fingerprintString(ctx, "isconstraint"); + _fingerprintString(ctx, "true"); } - if (node->lateral) { - _fingerprintString(ctx, "lateral"); + if (node->nulls_not_distinct) { + _fingerprintString(ctx, "nulls_not_distinct"); _fingerprintString(ctx, "true"); } - if (node->relid != 0) { + if (node->oldCreateSubid != 0) { char buffer[50]; - sprintf(buffer, "%d", node->relid); - _fingerprintString(ctx, "relid"); - _fingerprintString(ctx, buffer); - } - - if (node->relkind != 0) { - char buffer[2] = {node->relkind, '\0'}; - _fingerprintString(ctx, "relkind"); + sprintf(buffer, "%d", node->oldCreateSubid); + _fingerprintString(ctx, "oldCreateSubid"); _fingerprintString(ctx, buffer); } - if (node->rellockmode != 0) { + if (node->oldFirstRelfilelocatorSubid != 0) { char buffer[50]; - sprintf(buffer, "%d", node->rellockmode); - _fingerprintString(ctx, "rellockmode"); + sprintf(buffer, "%d", node->oldFirstRelfilelocatorSubid); + _fingerprintString(ctx, "oldFirstRelfilelocatorSubid"); _fingerprintString(ctx, buffer); } - if (node->requiredPerms != 0) { + if (node->oldNumber != 0) { char buffer[50]; - sprintf(buffer, "%d", node->requiredPerms); - _fingerprintString(ctx, "requiredPerms"); + sprintf(buffer, "%d", node->oldNumber); + _fingerprintString(ctx, "oldNumber"); _fingerprintString(ctx, buffer); } - if (true) { - _fingerprintString(ctx, "rtekind"); - _fingerprintString(ctx, _enumToStringRTEKind(node->rtekind)); - } - - if (node->securityQuals != NULL && node->securityQuals->length > 0) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "securityQuals"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->securityQuals, node, "securityQuals", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->securityQuals) == 1 && linitial(node->securityQuals) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->security_barrier) { - _fingerprintString(ctx, "security_barrier"); + if (node->primary) { + _fingerprintString(ctx, "primary"); _fingerprintString(ctx, "true"); } - if (true) { - int x; - Bitmapset *bms = bms_copy(node->selectedCols); + if (node->relation != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; - _fingerprintString(ctx, "selectedCols"); + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "relation"); - while ((x = bms_first_member(bms)) >= 0) { - char buffer[50]; - sprintf(buffer, "%d", x); - _fingerprintString(ctx, buffer); + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); } + XXH3_freeState(prev); + } - bms_free(bms); + if (node->reset_default_tblspc) { + _fingerprintString(ctx, "reset_default_tblspc"); + _fingerprintString(ctx, "true"); } - if (node->self_reference) { - _fingerprintString(ctx, "self_reference"); + if (node->tableSpace != NULL) { + _fingerprintString(ctx, "tableSpace"); + _fingerprintString(ctx, node->tableSpace); + } + + if (node->transformed) { + _fingerprintString(ctx, "transformed"); _fingerprintString(ctx, "true"); } - if (node->subquery != NULL) { + if (node->unique) { + _fingerprintString(ctx, "unique"); + _fingerprintString(ctx, "true"); + } + + if (node->whereClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "subquery"); + _fingerprintString(ctx, "whereClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintQuery(ctx, node->subquery, node, "subquery", depth + 1); + _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -11439,156 +11515,208 @@ _fingerprintRangeTblEntry(FingerprintContext *ctx, const RangeTblEntry *node, co XXH3_freeState(prev); } - if (node->tablefunc != NULL) { +} + +static void +_fingerprintCreateStatsStmt(FingerprintContext *ctx, const CreateStatsStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->defnames != NULL && node->defnames->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "tablefunc"); + _fingerprintString(ctx, "defnames"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTableFunc(ctx, node->tablefunc, node, "tablefunc", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->defnames, node, "defnames", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->defnames) == 1 && linitial(node->defnames) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->tablesample != NULL) { + if (node->exprs != NULL && node->exprs->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "tablesample"); + _fingerprintString(ctx, "exprs"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTableSampleClause(ctx, node->tablesample, node, "tablesample", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->exprs, node, "exprs", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->exprs) == 1 && linitial(node->exprs) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->if_not_exists) { + _fingerprintString(ctx, "if_not_exists"); + _fingerprintString(ctx, "true"); + } - if (true) { - int x; - Bitmapset *bms = bms_copy(node->updatedCols); + if (node->relations != NULL && node->relations->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; - _fingerprintString(ctx, "updatedCols"); + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "relations"); - while ((x = bms_first_member(bms)) >= 0) { - char buffer[50]; - sprintf(buffer, "%d", x); - _fingerprintString(ctx, buffer); + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->relations, node, "relations", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->relations) == 1 && linitial(node->relations) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); } - - bms_free(bms); + XXH3_freeState(prev); } - - if (node->values_lists != NULL && node->values_lists->length > 0) { + if (node->stat_types != NULL && node->stat_types->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "values_lists"); + _fingerprintString(ctx, "stat_types"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->values_lists, node, "values_lists", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->values_lists) == 1 && linitial(node->values_lists) == NIL)) { + _fingerprintNode(ctx, node->stat_types, node, "stat_types", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->stat_types) == 1 && linitial(node->stat_types) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->stxcomment != NULL) { + _fingerprintString(ctx, "stxcomment"); + _fingerprintString(ctx, node->stxcomment); + } + + if (node->transformed) { + _fingerprintString(ctx, "transformed"); + _fingerprintString(ctx, "true"); + } + } static void -_fingerprintRangeTblFunction(FingerprintContext *ctx, const RangeTblFunction *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintStatsElem(FingerprintContext *ctx, const StatsElem *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->funccolcollations != NULL && node->funccolcollations->length > 0) { + if (node->expr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funccolcollations"); + _fingerprintString(ctx, "expr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->funccolcollations, node, "funccolcollations", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funccolcollations) == 1 && linitial(node->funccolcollations) == NIL)) { + _fingerprintNode(ctx, node->expr, node, "expr", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->funccolcount != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->funccolcount); - _fingerprintString(ctx, "funccolcount"); - _fingerprintString(ctx, buffer); + + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); } - if (node->funccolnames != NULL && node->funccolnames->length > 0) { +} + +static void +_fingerprintAlterStatsStmt(FingerprintContext *ctx, const AlterStatsStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->defnames != NULL && node->defnames->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funccolnames"); + _fingerprintString(ctx, "defnames"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->funccolnames, node, "funccolnames", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funccolnames) == 1 && linitial(node->funccolnames) == NIL)) { + _fingerprintNode(ctx, node->defnames, node, "defnames", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->defnames) == 1 && linitial(node->defnames) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->funccoltypes != NULL && node->funccoltypes->length > 0) { + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); + _fingerprintString(ctx, "true"); + } + + if (node->stxstattarget != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->stxstattarget); + _fingerprintString(ctx, "stxstattarget"); + _fingerprintString(ctx, buffer); + } + +} + +static void +_fingerprintCreateFunctionStmt(FingerprintContext *ctx, const CreateFunctionStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->funcname != NULL && node->funcname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funccoltypes"); + _fingerprintString(ctx, "funcname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->funccoltypes, node, "funccoltypes", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funccoltypes) == 1 && linitial(node->funccoltypes) == NIL)) { + _fingerprintNode(ctx, node->funcname, node, "funcname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funcname) == 1 && linitial(node->funcname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->funccoltypmods != NULL && node->funccoltypmods->length > 0) { + if (node->is_procedure) { + _fingerprintString(ctx, "is_procedure"); + _fingerprintString(ctx, "true"); + } + + // Intentionally ignoring node->options for fingerprinting + + if (node->parameters != NULL && node->parameters->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funccoltypmods"); + _fingerprintString(ctx, "parameters"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->funccoltypmods, node, "funccoltypmods", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->funccoltypmods) == 1 && linitial(node->funccoltypmods) == NIL)) { + _fingerprintNode(ctx, node->parameters, node, "parameters", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->parameters) == 1 && linitial(node->parameters) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->funcexpr != NULL) { + if (node->replace) { + _fingerprintString(ctx, "replace"); + _fingerprintString(ctx, "true"); + } + + if (node->returnType != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "funcexpr"); + _fingerprintString(ctx, "returnType"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->funcexpr, node, "funcexpr", depth + 1); + _fingerprintTypeName(ctx, node->returnType, node, "returnType", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -11597,51 +11725,54 @@ _fingerprintRangeTblFunction(FingerprintContext *ctx, const RangeTblFunction *no XXH3_freeState(prev); } - if (true) { - int x; - Bitmapset *bms = bms_copy(node->funcparams); + if (node->sql_body != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; - _fingerprintString(ctx, "funcparams"); + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "sql_body"); - while ((x = bms_first_member(bms)) >= 0) { - char buffer[50]; - sprintf(buffer, "%d", x); - _fingerprintString(ctx, buffer); + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->sql_body, node, "sql_body", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); } - - bms_free(bms); + XXH3_freeState(prev); } } static void -_fingerprintTableSampleClause(FingerprintContext *ctx, const TableSampleClause *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintFunctionParameter(FingerprintContext *ctx, const FunctionParameter *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->args != NULL && node->args->length > 0) { + if (node->argType != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "args"); + _fingerprintString(ctx, "argType"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->args, node, "args", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->args) == 1 && linitial(node->args) == NIL)) { + _fingerprintTypeName(ctx, node->argType, node, "argType", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->repeatable != NULL) { + + if (node->defexpr != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "repeatable"); + _fingerprintString(ctx, "defexpr"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->repeatable, node, "repeatable", depth + 1); + _fingerprintNode(ctx, node->defexpr, node, "defexpr", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -11650,42 +11781,43 @@ _fingerprintTableSampleClause(FingerprintContext *ctx, const TableSampleClause * XXH3_freeState(prev); } - if (node->tsmhandler != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->tsmhandler); - _fingerprintString(ctx, "tsmhandler"); - _fingerprintString(ctx, buffer); + if (true) { + _fingerprintString(ctx, "mode"); + _fingerprintString(ctx, _enumToStringFunctionParameterMode(node->mode)); } + // Intentionally ignoring node->name for fingerprinting + } static void -_fingerprintWithCheckOption(FingerprintContext *ctx, const WithCheckOption *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterFunctionStmt(FingerprintContext *ctx, const AlterFunctionStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->cascaded) { - _fingerprintString(ctx, "cascaded"); - _fingerprintString(ctx, "true"); - } + if (node->actions != NULL && node->actions->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; - if (true) { - _fingerprintString(ctx, "kind"); - _fingerprintString(ctx, _enumToStringWCOKind(node->kind)); - } + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "actions"); - if (node->polname != NULL) { - _fingerprintString(ctx, "polname"); - _fingerprintString(ctx, node->polname); + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->actions, node, "actions", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->actions) == 1 && linitial(node->actions) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); } - - if (node->qual != NULL) { + if (node->func != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "qual"); + _fingerprintString(ctx, "func"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->qual, node, "qual", depth + 1); + _fingerprintObjectWithArgs(ctx, node->func, node, "func", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -11694,274 +11826,908 @@ _fingerprintWithCheckOption(FingerprintContext *ctx, const WithCheckOption *node XXH3_freeState(prev); } - if (node->relname != NULL) { - _fingerprintString(ctx, "relname"); - _fingerprintString(ctx, node->relname); + if (true) { + _fingerprintString(ctx, "objtype"); + _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); } } static void -_fingerprintSortGroupClause(FingerprintContext *ctx, const SortGroupClause *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintDoStmt(FingerprintContext *ctx, const DoStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->eqop != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->eqop); - _fingerprintString(ctx, "eqop"); - _fingerprintString(ctx, buffer); - } + // Intentionally ignoring node->args for fingerprinting - if (node->hashable) { - _fingerprintString(ctx, "hashable"); +} + +static void +_fingerprintInlineCodeBlock(FingerprintContext *ctx, const InlineCodeBlock *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->atomic) { + _fingerprintString(ctx, "atomic"); _fingerprintString(ctx, "true"); } - if (node->nulls_first) { - _fingerprintString(ctx, "nulls_first"); + if (node->langIsTrusted) { + _fingerprintString(ctx, "langIsTrusted"); _fingerprintString(ctx, "true"); } - if (node->sortop != 0) { + if (node->langOid != 0) { char buffer[50]; - sprintf(buffer, "%d", node->sortop); - _fingerprintString(ctx, "sortop"); + sprintf(buffer, "%d", node->langOid); + _fingerprintString(ctx, "langOid"); _fingerprintString(ctx, buffer); } - if (node->tleSortGroupRef != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->tleSortGroupRef); - _fingerprintString(ctx, "tleSortGroupRef"); - _fingerprintString(ctx, buffer); + if (node->source_text != NULL) { + _fingerprintString(ctx, "source_text"); + _fingerprintString(ctx, node->source_text); } } static void -_fingerprintGroupingSet(FingerprintContext *ctx, const GroupingSet *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCallStmt(FingerprintContext *ctx, const CallStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->content != NULL && node->content->length > 0) { + if (node->funccall != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "content"); + _fingerprintString(ctx, "funccall"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->content, node, "content", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->content) == 1 && linitial(node->content) == NIL)) { + _fingerprintFuncCall(ctx, node->funccall, node, "funccall", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "kind"); - _fingerprintString(ctx, _enumToStringGroupingSetKind(node->kind)); - } - - // Intentionally ignoring node->location for fingerprinting -} + if (node->funcexpr != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; -static void -_fingerprintWindowClause(FingerprintContext *ctx, const WindowClause *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->copiedOrder) { - _fingerprintString(ctx, "copiedOrder"); - _fingerprintString(ctx, "true"); - } + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "funcexpr"); - if (node->endInRangeFunc != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->endInRangeFunc); - _fingerprintString(ctx, "endInRangeFunc"); - _fingerprintString(ctx, buffer); + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintFuncExpr(ctx, node->funcexpr, node, "funcexpr", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); } - if (node->endOffset != NULL) { + if (node->outargs != NULL && node->outargs->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "endOffset"); + _fingerprintString(ctx, "outargs"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->endOffset, node, "endOffset", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->outargs, node, "outargs", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->outargs) == 1 && linitial(node->outargs) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->frameOptions != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->frameOptions); - _fingerprintString(ctx, "frameOptions"); - _fingerprintString(ctx, buffer); - } - - if (node->inRangeAsc) { - _fingerprintString(ctx, "inRangeAsc"); +static void +_fingerprintCallContext(FingerprintContext *ctx, const CallContext *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->atomic) { + _fingerprintString(ctx, "atomic"); _fingerprintString(ctx, "true"); } - if (node->inRangeColl != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->inRangeColl); - _fingerprintString(ctx, "inRangeColl"); - _fingerprintString(ctx, buffer); +} + +static void +_fingerprintRenameStmt(FingerprintContext *ctx, const RenameStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (true) { + _fingerprintString(ctx, "behavior"); + _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); } - if (node->inRangeNullsFirst) { - _fingerprintString(ctx, "inRangeNullsFirst"); + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); _fingerprintString(ctx, "true"); } - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); + if (node->newname != NULL) { + _fingerprintString(ctx, "newname"); + _fingerprintString(ctx, node->newname); } - if (node->orderClause != NULL && node->orderClause->length > 0) { + if (node->object != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "orderClause"); + _fingerprintString(ctx, "object"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->orderClause, node, "orderClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->orderClause) == 1 && linitial(node->orderClause) == NIL)) { + _fingerprintNode(ctx, node->object, node, "object", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->partitionClause != NULL && node->partitionClause->length > 0) { + + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "partitionClause"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->partitionClause, node, "partitionClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->partitionClause) == 1 && linitial(node->partitionClause) == NIL)) { + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->refname != NULL) { - _fingerprintString(ctx, "refname"); - _fingerprintString(ctx, node->refname); + + if (true) { + _fingerprintString(ctx, "relationType"); + _fingerprintString(ctx, _enumToStringObjectType(node->relationType)); } - if (node->runCondition != NULL && node->runCondition->length > 0) { + if (true) { + _fingerprintString(ctx, "renameType"); + _fingerprintString(ctx, _enumToStringObjectType(node->renameType)); + } + + if (node->subname != NULL) { + _fingerprintString(ctx, "subname"); + _fingerprintString(ctx, node->subname); + } + +} + +static void +_fingerprintAlterObjectDependsStmt(FingerprintContext *ctx, const AlterObjectDependsStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (strlen(node->extname->sval) > 0) { + _fingerprintString(ctx, "extname"); + _fingerprintString(ctx, node->extname->sval); + } + + if (node->object != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "runCondition"); + _fingerprintString(ctx, "object"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->runCondition, node, "runCondition", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->runCondition) == 1 && linitial(node->runCondition) == NIL)) { + _fingerprintNode(ctx, node->object, node, "object", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->startInRangeFunc != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->startInRangeFunc); - _fingerprintString(ctx, "startInRangeFunc"); - _fingerprintString(ctx, buffer); + + if (true) { + _fingerprintString(ctx, "objectType"); + _fingerprintString(ctx, _enumToStringObjectType(node->objectType)); + } + + if (node->relation != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "relation"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (node->remove) { + _fingerprintString(ctx, "remove"); + _fingerprintString(ctx, "true"); + } + +} + +static void +_fingerprintAlterObjectSchemaStmt(FingerprintContext *ctx, const AlterObjectSchemaStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); + _fingerprintString(ctx, "true"); + } + + if (node->newschema != NULL) { + _fingerprintString(ctx, "newschema"); + _fingerprintString(ctx, node->newschema); + } + + if (node->object != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "object"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->object, node, "object", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (true) { + _fingerprintString(ctx, "objectType"); + _fingerprintString(ctx, _enumToStringObjectType(node->objectType)); + } + + if (node->relation != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "relation"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + +} + +static void +_fingerprintAlterOwnerStmt(FingerprintContext *ctx, const AlterOwnerStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->newowner != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "newowner"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintRoleSpec(ctx, node->newowner, node, "newowner", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (node->object != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "object"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->object, node, "object", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (true) { + _fingerprintString(ctx, "objectType"); + _fingerprintString(ctx, _enumToStringObjectType(node->objectType)); + } + + if (node->relation != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "relation"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + +} + +static void +_fingerprintAlterOperatorStmt(FingerprintContext *ctx, const AlterOperatorStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->opername != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "opername"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintObjectWithArgs(ctx, node->opername, node, "opername", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (node->options != NULL && node->options->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "options"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } +} + +static void +_fingerprintAlterTypeStmt(FingerprintContext *ctx, const AlterTypeStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->options != NULL && node->options->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "options"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->typeName != NULL && node->typeName->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "typeName"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->typeName, node, "typeName", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typeName) == 1 && linitial(node->typeName) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } +} + +static void +_fingerprintRuleStmt(FingerprintContext *ctx, const RuleStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->actions != NULL && node->actions->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "actions"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->actions, node, "actions", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->actions) == 1 && linitial(node->actions) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (true) { + _fingerprintString(ctx, "event"); + _fingerprintString(ctx, _enumToStringCmdType(node->event)); + } + + if (node->instead) { + _fingerprintString(ctx, "instead"); + _fingerprintString(ctx, "true"); + } + + if (node->relation != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "relation"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (node->replace) { + _fingerprintString(ctx, "replace"); + _fingerprintString(ctx, "true"); + } + + if (node->rulename != NULL) { + _fingerprintString(ctx, "rulename"); + _fingerprintString(ctx, node->rulename); + } + + if (node->whereClause != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "whereClause"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + +} + +static void +_fingerprintNotifyStmt(FingerprintContext *ctx, const NotifyStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + // Intentionally ignoring node->conditionname for fingerprinting + + if (node->payload != NULL) { + _fingerprintString(ctx, "payload"); + _fingerprintString(ctx, node->payload); + } + +} + +static void +_fingerprintListenStmt(FingerprintContext *ctx, const ListenStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + // Intentionally ignoring node->conditionname for fingerprinting + +} + +static void +_fingerprintUnlistenStmt(FingerprintContext *ctx, const UnlistenStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + // Intentionally ignoring node->conditionname for fingerprinting + +} + +static void +_fingerprintTransactionStmt(FingerprintContext *ctx, const TransactionStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->chain) { + _fingerprintString(ctx, "chain"); + _fingerprintString(ctx, "true"); + } + + // Intentionally ignoring node->gid for fingerprinting + + if (true) { + _fingerprintString(ctx, "kind"); + _fingerprintString(ctx, _enumToStringTransactionStmtKind(node->kind)); + } + + // Intentionally ignoring node->options for fingerprinting + + // Intentionally ignoring node->savepoint_name for fingerprinting + +} + +static void +_fingerprintCompositeTypeStmt(FingerprintContext *ctx, const CompositeTypeStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->coldeflist != NULL && node->coldeflist->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "coldeflist"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->coldeflist, node, "coldeflist", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->coldeflist) == 1 && linitial(node->coldeflist) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->typevar != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "typevar"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintRangeVar(ctx, node->typevar, node, "typevar", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); } - if (node->startOffset != NULL) { +} + +static void +_fingerprintCreateEnumStmt(FingerprintContext *ctx, const CreateEnumStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->typeName != NULL && node->typeName->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "typeName"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->typeName, node, "typeName", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typeName) == 1 && linitial(node->typeName) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->vals != NULL && node->vals->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "vals"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->vals, node, "vals", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->vals) == 1 && linitial(node->vals) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } +} + +static void +_fingerprintCreateRangeStmt(FingerprintContext *ctx, const CreateRangeStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->params != NULL && node->params->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "params"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->params, node, "params", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->params) == 1 && linitial(node->params) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->typeName != NULL && node->typeName->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "typeName"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->typeName, node, "typeName", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typeName) == 1 && linitial(node->typeName) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } +} + +static void +_fingerprintAlterEnumStmt(FingerprintContext *ctx, const AlterEnumStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->newVal != NULL) { + _fingerprintString(ctx, "newVal"); + _fingerprintString(ctx, node->newVal); + } + + if (node->newValIsAfter) { + _fingerprintString(ctx, "newValIsAfter"); + _fingerprintString(ctx, "true"); + } + + if (node->newValNeighbor != NULL) { + _fingerprintString(ctx, "newValNeighbor"); + _fingerprintString(ctx, node->newValNeighbor); + } + + if (node->oldVal != NULL) { + _fingerprintString(ctx, "oldVal"); + _fingerprintString(ctx, node->oldVal); + } + + if (node->skipIfNewValExists) { + _fingerprintString(ctx, "skipIfNewValExists"); + _fingerprintString(ctx, "true"); + } + + if (node->typeName != NULL && node->typeName->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "typeName"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->typeName, node, "typeName", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->typeName) == 1 && linitial(node->typeName) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } +} + +static void +_fingerprintViewStmt(FingerprintContext *ctx, const ViewStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->aliases != NULL && node->aliases->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "aliases"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->aliases, node, "aliases", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->aliases) == 1 && linitial(node->aliases) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->options != NULL && node->options->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "options"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->query != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "query"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->query, node, "query", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (node->replace) { + _fingerprintString(ctx, "replace"); + _fingerprintString(ctx, "true"); + } + + if (node->view != NULL) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "view"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintRangeVar(ctx, node->view, node, "view", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + + if (true) { + _fingerprintString(ctx, "withCheckOption"); + _fingerprintString(ctx, _enumToStringViewCheckOption(node->withCheckOption)); + } + +} + +static void +_fingerprintLoadStmt(FingerprintContext *ctx, const LoadStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->filename != NULL) { + _fingerprintString(ctx, "filename"); + _fingerprintString(ctx, node->filename); + } + +} + +static void +_fingerprintCreatedbStmt(FingerprintContext *ctx, const CreatedbStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->dbname != NULL) { + _fingerprintString(ctx, "dbname"); + _fingerprintString(ctx, node->dbname); + } + + if (node->options != NULL && node->options->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; + + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "options"); + + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } +} + +static void +_fingerprintAlterDatabaseStmt(FingerprintContext *ctx, const AlterDatabaseStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->dbname != NULL) { + _fingerprintString(ctx, "dbname"); + _fingerprintString(ctx, node->dbname); + } + + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "startOffset"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->startOffset, node, "startOffset", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->winref != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->winref); - _fingerprintString(ctx, "winref"); - _fingerprintString(ctx, buffer); +static void +_fingerprintAlterDatabaseRefreshCollStmt(FingerprintContext *ctx, const AlterDatabaseRefreshCollStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->dbname != NULL) { + _fingerprintString(ctx, "dbname"); + _fingerprintString(ctx, node->dbname); } } static void -_fingerprintObjectWithArgs(FingerprintContext *ctx, const ObjectWithArgs *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterDatabaseSetStmt(FingerprintContext *ctx, const AlterDatabaseSetStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->args_unspecified) { - _fingerprintString(ctx, "args_unspecified"); - _fingerprintString(ctx, "true"); + if (node->dbname != NULL) { + _fingerprintString(ctx, "dbname"); + _fingerprintString(ctx, node->dbname); } - if (node->objargs != NULL && node->objargs->length > 0) { + if (node->setstmt != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "objargs"); + _fingerprintString(ctx, "setstmt"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->objargs, node, "objargs", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objargs) == 1 && linitial(node->objargs) == NIL)) { + _fingerprintVariableSetStmt(ctx, node->setstmt, node, "setstmt", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->objfuncargs != NULL && node->objfuncargs->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "objfuncargs"); +} - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->objfuncargs, node, "objfuncargs", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objfuncargs) == 1 && linitial(node->objfuncargs) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); +static void +_fingerprintDropdbStmt(FingerprintContext *ctx, const DropdbStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->dbname != NULL) { + _fingerprintString(ctx, "dbname"); + _fingerprintString(ctx, node->dbname); } - if (node->objname != NULL && node->objname->length > 0) { + + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); + _fingerprintString(ctx, "true"); + } + + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "objname"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->objname, node, "objname", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->objname) == 1 && linitial(node->objname) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); @@ -11971,66 +12737,60 @@ _fingerprintObjectWithArgs(FingerprintContext *ctx, const ObjectWithArgs *node, } static void -_fingerprintAccessPriv(FingerprintContext *ctx, const AccessPriv *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterSystemStmt(FingerprintContext *ctx, const AlterSystemStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->cols != NULL && node->cols->length > 0) { + if (node->setstmt != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "cols"); + _fingerprintString(ctx, "setstmt"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->cols, node, "cols", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cols) == 1 && linitial(node->cols) == NIL)) { + _fingerprintVariableSetStmt(ctx, node->setstmt, node, "setstmt", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->priv_name != NULL) { - _fingerprintString(ctx, "priv_name"); - _fingerprintString(ctx, node->priv_name); - } } static void -_fingerprintCreateOpClassItem(FingerprintContext *ctx, const CreateOpClassItem *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintClusterStmt(FingerprintContext *ctx, const ClusterStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->class_args != NULL && node->class_args->length > 0) { + if (node->indexname != NULL) { + _fingerprintString(ctx, "indexname"); + _fingerprintString(ctx, node->indexname); + } + + if (node->params != NULL && node->params->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "class_args"); + _fingerprintString(ctx, "params"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->class_args, node, "class_args", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->class_args) == 1 && linitial(node->class_args) == NIL)) { + _fingerprintNode(ctx, node->params, node, "params", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->params) == 1 && linitial(node->params) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->itemtype != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->itemtype); - _fingerprintString(ctx, "itemtype"); - _fingerprintString(ctx, buffer); - } - - if (node->name != NULL) { + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "name"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintObjectWithArgs(ctx, node->name, node, "name", depth + 1); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -12039,55 +12799,57 @@ _fingerprintCreateOpClassItem(FingerprintContext *ctx, const CreateOpClassItem * XXH3_freeState(prev); } - if (node->number != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->number); - _fingerprintString(ctx, "number"); - _fingerprintString(ctx, buffer); +} + +static void +_fingerprintVacuumStmt(FingerprintContext *ctx, const VacuumStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->is_vacuumcmd) { + _fingerprintString(ctx, "is_vacuumcmd"); + _fingerprintString(ctx, "true"); } - if (node->order_family != NULL && node->order_family->length > 0) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "order_family"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->order_family, node, "order_family", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->order_family) == 1 && linitial(node->order_family) == NIL)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->storedtype != NULL) { + if (node->rels != NULL && node->rels->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "storedtype"); + _fingerprintString(ctx, "rels"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->storedtype, node, "storedtype", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->rels, node, "rels", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->rels) == 1 && linitial(node->rels) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - } static void -_fingerprintTableLikeClause(FingerprintContext *ctx, const TableLikeClause *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintVacuumRelation(FingerprintContext *ctx, const VacuumRelation *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->options != 0) { + if (node->oid != 0) { char buffer[50]; - sprintf(buffer, "%d", node->options); - _fingerprintString(ctx, "options"); + sprintf(buffer, "%d", node->oid); + _fingerprintString(ctx, "oid"); _fingerprintString(ctx, buffer); } @@ -12108,131 +12870,79 @@ _fingerprintTableLikeClause(FingerprintContext *ctx, const TableLikeClause *node XXH3_freeState(prev); } - if (node->relationOid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->relationOid); - _fingerprintString(ctx, "relationOid"); - _fingerprintString(ctx, buffer); - } - -} - -static void -_fingerprintFunctionParameter(FingerprintContext *ctx, const FunctionParameter *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->argType != NULL) { + if (node->va_cols != NULL && node->va_cols->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "argType"); + _fingerprintString(ctx, "va_cols"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->argType, node, "argType", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->va_cols, node, "va_cols", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->va_cols) == 1 && linitial(node->va_cols) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->defexpr != NULL) { +static void +_fingerprintExplainStmt(FingerprintContext *ctx, const ExplainStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "defexpr"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->defexpr, node, "defexpr", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (true) { - _fingerprintString(ctx, "mode"); - _fingerprintString(ctx, _enumToStringFunctionParameterMode(node->mode)); - } - - // Intentionally ignoring node->name for fingerprinting - -} - -static void -_fingerprintLockingClause(FingerprintContext *ctx, const LockingClause *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->lockedRels != NULL && node->lockedRels->length > 0) { + if (node->query != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "lockedRels"); + _fingerprintString(ctx, "query"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->lockedRels, node, "lockedRels", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->lockedRels) == 1 && linitial(node->lockedRels) == NIL)) { + _fingerprintNode(ctx, node->query, node, "query", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "strength"); - _fingerprintString(ctx, _enumToStringLockClauseStrength(node->strength)); - } - - if (true) { - _fingerprintString(ctx, "waitPolicy"); - _fingerprintString(ctx, _enumToStringLockWaitPolicy(node->waitPolicy)); - } } static void -_fingerprintRowMarkClause(FingerprintContext *ctx, const RowMarkClause *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreateTableAsStmt(FingerprintContext *ctx, const CreateTableAsStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->pushedDown) { - _fingerprintString(ctx, "pushedDown"); + if (node->if_not_exists) { + _fingerprintString(ctx, "if_not_exists"); _fingerprintString(ctx, "true"); } - if (node->rti != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->rti); - _fingerprintString(ctx, "rti"); - _fingerprintString(ctx, buffer); - } - - if (true) { - _fingerprintString(ctx, "strength"); - _fingerprintString(ctx, _enumToStringLockClauseStrength(node->strength)); - } - - if (true) { - _fingerprintString(ctx, "waitPolicy"); - _fingerprintString(ctx, _enumToStringLockWaitPolicy(node->waitPolicy)); - } - -} - -static void -_fingerprintXmlSerialize(FingerprintContext *ctx, const XmlSerialize *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->expr != NULL) { + if (node->into != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "expr"); + _fingerprintString(ctx, "into"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->expr, node, "expr", depth + 1); + _fingerprintIntoClause(ctx, node->into, node, "into", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -12241,17 +12951,25 @@ _fingerprintXmlSerialize(FingerprintContext *ctx, const XmlSerialize *node, cons XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting + if (node->is_select_into) { + _fingerprintString(ctx, "is_select_into"); + _fingerprintString(ctx, "true"); + } - if (node->typeName != NULL) { + if (true) { + _fingerprintString(ctx, "objtype"); + _fingerprintString(ctx, _enumToStringObjectType(node->objtype)); + } + + if (node->query != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "typeName"); + _fingerprintString(ctx, "query"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintTypeName(ctx, node->typeName, node, "typeName", depth + 1); + _fingerprintNode(ctx, node->query, node, "query", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -12260,138 +12978,152 @@ _fingerprintXmlSerialize(FingerprintContext *ctx, const XmlSerialize *node, cons XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "xmloption"); - _fingerprintString(ctx, _enumToStringXmlOptionType(node->xmloption)); - } - } static void -_fingerprintWithClause(FingerprintContext *ctx, const WithClause *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintRefreshMatViewStmt(FingerprintContext *ctx, const RefreshMatViewStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->ctes != NULL && node->ctes->length > 0) { + if (node->concurrent) { + _fingerprintString(ctx, "concurrent"); + _fingerprintString(ctx, "true"); + } + + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "ctes"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->ctes, node, "ctes", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->ctes) == 1 && linitial(node->ctes) == NIL)) { + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting - if (node->recursive) { - _fingerprintString(ctx, "recursive"); + if (node->skipData) { + _fingerprintString(ctx, "skipData"); _fingerprintString(ctx, "true"); } } static void -_fingerprintInferClause(FingerprintContext *ctx, const InferClause *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCheckPointStmt(FingerprintContext *ctx, const CheckPointStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->conname != NULL) { - _fingerprintString(ctx, "conname"); - _fingerprintString(ctx, node->conname); +} + +static void +_fingerprintDiscardStmt(FingerprintContext *ctx, const DiscardStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (true) { + _fingerprintString(ctx, "target"); + _fingerprintString(ctx, _enumToStringDiscardMode(node->target)); } - if (node->indexElems != NULL && node->indexElems->length > 0) { +} + +static void +_fingerprintLockStmt(FingerprintContext *ctx, const LockStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->mode != 0) { + char buffer[50]; + sprintf(buffer, "%d", node->mode); + _fingerprintString(ctx, "mode"); + _fingerprintString(ctx, buffer); + } + + if (node->nowait) { + _fingerprintString(ctx, "nowait"); + _fingerprintString(ctx, "true"); + } + + if (node->relations != NULL && node->relations->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "indexElems"); + _fingerprintString(ctx, "relations"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->indexElems, node, "indexElems", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->indexElems) == 1 && linitial(node->indexElems) == NIL)) { + _fingerprintNode(ctx, node->relations, node, "relations", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->relations) == 1 && linitial(node->relations) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting +} - if (node->whereClause != NULL) { +static void +_fingerprintConstraintsSetStmt(FingerprintContext *ctx, const ConstraintsSetStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->constraints != NULL && node->constraints->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whereClause"); + _fingerprintString(ctx, "constraints"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->constraints, node, "constraints", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->constraints) == 1 && linitial(node->constraints) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->deferred) { + _fingerprintString(ctx, "deferred"); + _fingerprintString(ctx, "true"); + } } static void -_fingerprintOnConflictClause(FingerprintContext *ctx, const OnConflictClause *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintReindexStmt(FingerprintContext *ctx, const ReindexStmt *node, const void *parent, const char *field_name, unsigned int depth) { if (true) { - _fingerprintString(ctx, "action"); - _fingerprintString(ctx, _enumToStringOnConflictAction(node->action)); + _fingerprintString(ctx, "kind"); + _fingerprintString(ctx, _enumToStringReindexObjectType(node->kind)); } - if (node->infer != NULL) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "infer"); - - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintInferClause(ctx, node->infer, node, "infer", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); } - // Intentionally ignoring node->location for fingerprinting - - if (node->targetList != NULL && node->targetList->length > 0) { + if (node->params != NULL && node->params->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "targetList"); + _fingerprintString(ctx, "params"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) { + _fingerprintNode(ctx, node->params, node, "params", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->params) == 1 && linitial(node->params) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->whereClause != NULL) { + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whereClause"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -12403,78 +13135,74 @@ _fingerprintOnConflictClause(FingerprintContext *ctx, const OnConflictClause *no } static void -_fingerprintCTESearchClause(FingerprintContext *ctx, const CTESearchClause *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreateConversionStmt(FingerprintContext *ctx, const CreateConversionStmt *node, const void *parent, const char *field_name, unsigned int depth) { - // Intentionally ignoring node->location for fingerprinting - - if (node->search_breadth_first) { - _fingerprintString(ctx, "search_breadth_first"); - _fingerprintString(ctx, "true"); - } - - if (node->search_col_list != NULL && node->search_col_list->length > 0) { + if (node->conversion_name != NULL && node->conversion_name->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "search_col_list"); + _fingerprintString(ctx, "conversion_name"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->search_col_list, node, "search_col_list", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->search_col_list) == 1 && linitial(node->search_col_list) == NIL)) { + _fingerprintNode(ctx, node->conversion_name, node, "conversion_name", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->conversion_name) == 1 && linitial(node->conversion_name) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->search_seq_column != NULL) { - _fingerprintString(ctx, "search_seq_column"); - _fingerprintString(ctx, node->search_seq_column); + if (node->def) { + _fingerprintString(ctx, "def"); + _fingerprintString(ctx, "true"); } -} + if (node->for_encoding_name != NULL) { + _fingerprintString(ctx, "for_encoding_name"); + _fingerprintString(ctx, node->for_encoding_name); + } -static void -_fingerprintCTECycleClause(FingerprintContext *ctx, const CTECycleClause *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->cycle_col_list != NULL && node->cycle_col_list->length > 0) { + if (node->func_name != NULL && node->func_name->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "cycle_col_list"); + _fingerprintString(ctx, "func_name"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->cycle_col_list, node, "cycle_col_list", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cycle_col_list) == 1 && linitial(node->cycle_col_list) == NIL)) { + _fingerprintNode(ctx, node->func_name, node, "func_name", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->func_name) == 1 && linitial(node->func_name) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->cycle_mark_collation != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->cycle_mark_collation); - _fingerprintString(ctx, "cycle_mark_collation"); - _fingerprintString(ctx, buffer); + if (node->to_encoding_name != NULL) { + _fingerprintString(ctx, "to_encoding_name"); + _fingerprintString(ctx, node->to_encoding_name); } - if (node->cycle_mark_column != NULL) { - _fingerprintString(ctx, "cycle_mark_column"); - _fingerprintString(ctx, node->cycle_mark_column); +} + +static void +_fingerprintCreateCastStmt(FingerprintContext *ctx, const CreateCastStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (true) { + _fingerprintString(ctx, "context"); + _fingerprintString(ctx, _enumToStringCoercionContext(node->context)); } - if (node->cycle_mark_default != NULL) { + if (node->func != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "cycle_mark_default"); + _fingerprintString(ctx, "func"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->cycle_mark_default, node, "cycle_mark_default", depth + 1); + _fingerprintObjectWithArgs(ctx, node->func, node, "func", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -12483,36 +13211,20 @@ _fingerprintCTECycleClause(FingerprintContext *ctx, const CTECycleClause *node, XXH3_freeState(prev); } - if (node->cycle_mark_neop != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->cycle_mark_neop); - _fingerprintString(ctx, "cycle_mark_neop"); - _fingerprintString(ctx, buffer); - } - - if (node->cycle_mark_type != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->cycle_mark_type); - _fingerprintString(ctx, "cycle_mark_type"); - _fingerprintString(ctx, buffer); - } - - if (node->cycle_mark_typmod != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->cycle_mark_typmod); - _fingerprintString(ctx, "cycle_mark_typmod"); - _fingerprintString(ctx, buffer); + if (node->inout) { + _fingerprintString(ctx, "inout"); + _fingerprintString(ctx, "true"); } - if (node->cycle_mark_value != NULL) { + if (node->sourcetype != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "cycle_mark_value"); + _fingerprintString(ctx, "sourcetype"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->cycle_mark_value, node, "cycle_mark_value", depth + 1); + _fingerprintTypeName(ctx, node->sourcetype, node, "sourcetype", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -12521,146 +13233,121 @@ _fingerprintCTECycleClause(FingerprintContext *ctx, const CTECycleClause *node, XXH3_freeState(prev); } - if (node->cycle_path_column != NULL) { - _fingerprintString(ctx, "cycle_path_column"); - _fingerprintString(ctx, node->cycle_path_column); - } - - // Intentionally ignoring node->location for fingerprinting - -} - -static void -_fingerprintCommonTableExpr(FingerprintContext *ctx, const CommonTableExpr *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->aliascolnames != NULL && node->aliascolnames->length > 0) { + if (node->targettype != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "aliascolnames"); + _fingerprintString(ctx, "targettype"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->aliascolnames, node, "aliascolnames", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->aliascolnames) == 1 && linitial(node->aliascolnames) == NIL)) { + _fingerprintTypeName(ctx, node->targettype, node, "targettype", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->ctecolcollations != NULL && node->ctecolcollations->length > 0) { - XXH3_state_t* prev = XXH3_createState(); - XXH64_hash_t hash; - XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "ctecolcollations"); +} - hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->ctecolcollations, node, "ctecolcollations", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->ctecolcollations) == 1 && linitial(node->ctecolcollations) == NIL)) { - XXH3_copyState(ctx->xxh_state, prev); - if (ctx->write_tokens) - dlist_delete(dlist_tail_node(&ctx->tokens)); - } - XXH3_freeState(prev); - } - if (node->ctecolnames != NULL && node->ctecolnames->length > 0) { +static void +_fingerprintCreateTransformStmt(FingerprintContext *ctx, const CreateTransformStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->fromsql != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "ctecolnames"); + _fingerprintString(ctx, "fromsql"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->ctecolnames, node, "ctecolnames", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->ctecolnames) == 1 && linitial(node->ctecolnames) == NIL)) { + _fingerprintObjectWithArgs(ctx, node->fromsql, node, "fromsql", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->ctecoltypes != NULL && node->ctecoltypes->length > 0) { + + if (node->lang != NULL) { + _fingerprintString(ctx, "lang"); + _fingerprintString(ctx, node->lang); + } + + if (node->replace) { + _fingerprintString(ctx, "replace"); + _fingerprintString(ctx, "true"); + } + + if (node->tosql != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "ctecoltypes"); + _fingerprintString(ctx, "tosql"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->ctecoltypes, node, "ctecoltypes", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->ctecoltypes) == 1 && linitial(node->ctecoltypes) == NIL)) { + _fingerprintObjectWithArgs(ctx, node->tosql, node, "tosql", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->ctecoltypmods != NULL && node->ctecoltypmods->length > 0) { + + if (node->type_name != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "ctecoltypmods"); + _fingerprintString(ctx, "type_name"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->ctecoltypmods, node, "ctecoltypmods", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->ctecoltypmods) == 1 && linitial(node->ctecoltypmods) == NIL)) { + _fingerprintTypeName(ctx, node->type_name, node, "type_name", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (true) { - _fingerprintString(ctx, "ctematerialized"); - _fingerprintString(ctx, _enumToStringCTEMaterialize(node->ctematerialized)); - } - if (node->ctename != NULL) { - _fingerprintString(ctx, "ctename"); - _fingerprintString(ctx, node->ctename); - } +} - if (node->ctequery != NULL) { +static void +_fingerprintPrepareStmt(FingerprintContext *ctx, const PrepareStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->argtypes != NULL && node->argtypes->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "ctequery"); + _fingerprintString(ctx, "argtypes"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->ctequery, node, "ctequery", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->argtypes, node, "argtypes", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->argtypes) == 1 && linitial(node->argtypes) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + // Intentionally ignoring node->name for fingerprinting - if (node->cterecursive) { - _fingerprintString(ctx, "cterecursive"); - _fingerprintString(ctx, "true"); - } - - if (node->cterefcount != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->cterefcount); - _fingerprintString(ctx, "cterefcount"); - _fingerprintString(ctx, buffer); - } - - if (node->cycle_clause != NULL) { + if (node->query != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "cycle_clause"); + _fingerprintString(ctx, "query"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintCTECycleClause(ctx, node->cycle_clause, node, "cycle_clause", depth + 1); + _fingerprintNode(ctx, node->query, node, "query", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -12669,88 +13356,94 @@ _fingerprintCommonTableExpr(FingerprintContext *ctx, const CommonTableExpr *node XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting +} - if (node->search_clause != NULL) { +static void +_fingerprintExecuteStmt(FingerprintContext *ctx, const ExecuteStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + // Intentionally ignoring node->name for fingerprinting + + if (node->params != NULL && node->params->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "search_clause"); + _fingerprintString(ctx, "params"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintCTESearchClause(ctx, node->search_clause, node, "search_clause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->params, node, "params", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->params) == 1 && linitial(node->params) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} + +static void +_fingerprintDeallocateStmt(FingerprintContext *ctx, const DeallocateStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + // Intentionally ignoring node->name for fingerprinting } static void -_fingerprintMergeWhenClause(FingerprintContext *ctx, const MergeWhenClause *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintDropOwnedStmt(FingerprintContext *ctx, const DropOwnedStmt *node, const void *parent, const char *field_name, unsigned int depth) { if (true) { - _fingerprintString(ctx, "commandType"); - _fingerprintString(ctx, _enumToStringCmdType(node->commandType)); + _fingerprintString(ctx, "behavior"); + _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); } - if (node->condition != NULL) { + if (node->roles != NULL && node->roles->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "condition"); + _fingerprintString(ctx, "roles"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->condition, node, "condition", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - if (node->matched) { - _fingerprintString(ctx, "matched"); - _fingerprintString(ctx, "true"); - } - - if (true) { - _fingerprintString(ctx, "override"); - _fingerprintString(ctx, _enumToStringOverridingKind(node->override)); - } - - if (node->targetList != NULL && node->targetList->length > 0) { +static void +_fingerprintReassignOwnedStmt(FingerprintContext *ctx, const ReassignOwnedStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->newrole != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "targetList"); + _fingerprintString(ctx, "newrole"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->targetList, node, "targetList", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->targetList) == 1 && linitial(node->targetList) == NIL)) { + _fingerprintRoleSpec(ctx, node->newrole, node, "newrole", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->values != NULL && node->values->length > 0) { + + if (node->roles != NULL && node->roles->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "values"); + _fingerprintString(ctx, "roles"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->values, node, "values", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->values) == 1 && linitial(node->values) == NIL)) { + _fingerprintNode(ctx, node->roles, node, "roles", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->roles) == 1 && linitial(node->roles) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); @@ -12760,230 +13453,194 @@ _fingerprintMergeWhenClause(FingerprintContext *ctx, const MergeWhenClause *node } static void -_fingerprintRoleSpec(FingerprintContext *ctx, const RoleSpec *node, const void *parent, const char *field_name, unsigned int depth) -{ - // Intentionally ignoring node->location for fingerprinting - - if (node->rolename != NULL) { - _fingerprintString(ctx, "rolename"); - _fingerprintString(ctx, node->rolename); - } - - if (true) { - _fingerprintString(ctx, "roletype"); - _fingerprintString(ctx, _enumToStringRoleSpecType(node->roletype)); - } - -} - -static void -_fingerprintTriggerTransition(FingerprintContext *ctx, const TriggerTransition *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->isNew) { - _fingerprintString(ctx, "isNew"); - _fingerprintString(ctx, "true"); - } - - if (node->isTable) { - _fingerprintString(ctx, "isTable"); - _fingerprintString(ctx, "true"); - } - - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); - } - -} - -static void -_fingerprintPartitionElem(FingerprintContext *ctx, const PartitionElem *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterTSDictionaryStmt(FingerprintContext *ctx, const AlterTSDictionaryStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->collation != NULL && node->collation->length > 0) { + if (node->dictname != NULL && node->dictname->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "collation"); + _fingerprintString(ctx, "dictname"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->collation, node, "collation", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->collation) == 1 && linitial(node->collation) == NIL)) { + _fingerprintNode(ctx, node->dictname, node, "dictname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->dictname) == 1 && linitial(node->dictname) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->expr != NULL) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "expr"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->expr, node, "expr", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } +} - // Intentionally ignoring node->location for fingerprinting +static void +_fingerprintAlterTSConfigurationStmt(FingerprintContext *ctx, const AlterTSConfigurationStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->cfgname != NULL && node->cfgname->length > 0) { + XXH3_state_t* prev = XXH3_createState(); + XXH64_hash_t hash; - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); - } + XXH3_copyState(prev, ctx->xxh_state); + _fingerprintString(ctx, "cfgname"); - if (node->opclass != NULL && node->opclass->length > 0) { + hash = XXH3_64bits_digest(ctx->xxh_state); + _fingerprintNode(ctx, node->cfgname, node, "cfgname", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->cfgname) == 1 && linitial(node->cfgname) == NIL)) { + XXH3_copyState(ctx->xxh_state, prev); + if (ctx->write_tokens) + dlist_delete(dlist_tail_node(&ctx->tokens)); + } + XXH3_freeState(prev); + } + if (node->dicts != NULL && node->dicts->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "opclass"); + _fingerprintString(ctx, "dicts"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->opclass, node, "opclass", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->opclass) == 1 && linitial(node->opclass) == NIL)) { + _fingerprintNode(ctx, node->dicts, node, "dicts", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->dicts) == 1 && linitial(node->dicts) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } -} + if (true) { + _fingerprintString(ctx, "kind"); + _fingerprintString(ctx, _enumToStringAlterTSConfigType(node->kind)); + } -static void -_fingerprintPartitionSpec(FingerprintContext *ctx, const PartitionSpec *node, const void *parent, const char *field_name, unsigned int depth) -{ - // Intentionally ignoring node->location for fingerprinting + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); + _fingerprintString(ctx, "true"); + } - if (node->partParams != NULL && node->partParams->length > 0) { + if (node->override) { + _fingerprintString(ctx, "override"); + _fingerprintString(ctx, "true"); + } + + if (node->replace) { + _fingerprintString(ctx, "replace"); + _fingerprintString(ctx, "true"); + } + + if (node->tokentype != NULL && node->tokentype->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "partParams"); + _fingerprintString(ctx, "tokentype"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->partParams, node, "partParams", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->partParams) == 1 && linitial(node->partParams) == NIL)) { + _fingerprintNode(ctx, node->tokentype, node, "tokentype", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->tokentype) == 1 && linitial(node->tokentype) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->strategy != NULL) { - _fingerprintString(ctx, "strategy"); - _fingerprintString(ctx, node->strategy); - } - } static void -_fingerprintPartitionBoundSpec(FingerprintContext *ctx, const PartitionBoundSpec *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintPublicationTable(FingerprintContext *ctx, const PublicationTable *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->is_default) { - _fingerprintString(ctx, "is_default"); - _fingerprintString(ctx, "true"); - } - - if (node->listdatums != NULL && node->listdatums->length > 0) { + if (node->columns != NULL && node->columns->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "listdatums"); + _fingerprintString(ctx, "columns"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->listdatums, node, "listdatums", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->listdatums) == 1 && linitial(node->listdatums) == NIL)) { + _fingerprintNode(ctx, node->columns, node, "columns", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->columns) == 1 && linitial(node->columns) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - // Intentionally ignoring node->location for fingerprinting - - if (node->lowerdatums != NULL && node->lowerdatums->length > 0) { + if (node->relation != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "lowerdatums"); + _fingerprintString(ctx, "relation"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->lowerdatums, node, "lowerdatums", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->lowerdatums) == 1 && linitial(node->lowerdatums) == NIL)) { + _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->modulus != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->modulus); - _fingerprintString(ctx, "modulus"); - _fingerprintString(ctx, buffer); - } - - if (node->remainder != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->remainder); - _fingerprintString(ctx, "remainder"); - _fingerprintString(ctx, buffer); - } - - if (node->strategy != 0) { - char buffer[2] = {node->strategy, '\0'}; - _fingerprintString(ctx, "strategy"); - _fingerprintString(ctx, buffer); - } - if (node->upperdatums != NULL && node->upperdatums->length > 0) { + if (node->whereClause != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "upperdatums"); + _fingerprintString(ctx, "whereClause"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->upperdatums, node, "upperdatums", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->upperdatums) == 1 && linitial(node->upperdatums) == NIL)) { + _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + } static void -_fingerprintPartitionRangeDatum(FingerprintContext *ctx, const PartitionRangeDatum *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintPublicationObjSpec(FingerprintContext *ctx, const PublicationObjSpec *node, const void *parent, const char *field_name, unsigned int depth) { - if (true) { - _fingerprintString(ctx, "kind"); - _fingerprintString(ctx, _enumToStringPartitionRangeDatumKind(node->kind)); + // Intentionally ignoring node->location for fingerprinting + + if (node->name != NULL) { + _fingerprintString(ctx, "name"); + _fingerprintString(ctx, node->name); } - // Intentionally ignoring node->location for fingerprinting + if (true) { + _fingerprintString(ctx, "pubobjtype"); + _fingerprintString(ctx, _enumToStringPublicationObjSpecType(node->pubobjtype)); + } - if (node->value != NULL) { + if (node->pubtable != NULL) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "value"); + _fingerprintString(ctx, "pubtable"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->value, node, "value", depth + 1); + _fingerprintPublicationTable(ctx, node->pubtable, node, "pubtable", depth + 1); if (hash == XXH3_64bits_digest(ctx->xxh_state)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) @@ -12995,86 +13652,96 @@ _fingerprintPartitionRangeDatum(FingerprintContext *ctx, const PartitionRangeDat } static void -_fingerprintPartitionCmd(FingerprintContext *ctx, const PartitionCmd *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreatePublicationStmt(FingerprintContext *ctx, const CreatePublicationStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->bound != NULL) { + if (node->for_all_tables) { + _fingerprintString(ctx, "for_all_tables"); + _fingerprintString(ctx, "true"); + } + + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "bound"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintPartitionBoundSpec(ctx, node->bound, node, "bound", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->concurrent) { - _fingerprintString(ctx, "concurrent"); - _fingerprintString(ctx, "true"); + if (node->pubname != NULL) { + _fingerprintString(ctx, "pubname"); + _fingerprintString(ctx, node->pubname); } - if (node->name != NULL) { + if (node->pubobjects != NULL && node->pubobjects->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "name"); + _fingerprintString(ctx, "pubobjects"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->name, node, "name", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->pubobjects, node, "pubobjects", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->pubobjects) == 1 && linitial(node->pubobjects) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - } static void -_fingerprintVacuumRelation(FingerprintContext *ctx, const VacuumRelation *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintAlterPublicationStmt(FingerprintContext *ctx, const AlterPublicationStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->oid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->oid); - _fingerprintString(ctx, "oid"); - _fingerprintString(ctx, buffer); + if (true) { + _fingerprintString(ctx, "action"); + _fingerprintString(ctx, _enumToStringAlterPublicationAction(node->action)); } - if (node->relation != NULL) { + if (node->for_all_tables) { + _fingerprintString(ctx, "for_all_tables"); + _fingerprintString(ctx, "true"); + } + + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->pubname != NULL) { + _fingerprintString(ctx, "pubname"); + _fingerprintString(ctx, node->pubname); + } - if (node->va_cols != NULL && node->va_cols->length > 0) { + if (node->pubobjects != NULL && node->pubobjects->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "va_cols"); + _fingerprintString(ctx, "pubobjects"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->va_cols, node, "va_cols", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->va_cols) == 1 && linitial(node->va_cols) == NIL)) { + _fingerprintNode(ctx, node->pubobjects, node, "pubobjects", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->pubobjects) == 1 && linitial(node->pubobjects) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); @@ -13084,127 +13751,120 @@ _fingerprintVacuumRelation(FingerprintContext *ctx, const VacuumRelation *node, } static void -_fingerprintPublicationObjSpec(FingerprintContext *ctx, const PublicationObjSpec *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintCreateSubscriptionStmt(FingerprintContext *ctx, const CreateSubscriptionStmt *node, const void *parent, const char *field_name, unsigned int depth) { - // Intentionally ignoring node->location for fingerprinting - - if (node->name != NULL) { - _fingerprintString(ctx, "name"); - _fingerprintString(ctx, node->name); - } - - if (true) { - _fingerprintString(ctx, "pubobjtype"); - _fingerprintString(ctx, _enumToStringPublicationObjSpecType(node->pubobjtype)); + if (node->conninfo != NULL) { + _fingerprintString(ctx, "conninfo"); + _fingerprintString(ctx, node->conninfo); } - if (node->pubtable != NULL) { + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "pubtable"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintPublicationTable(ctx, node->pubtable, node, "pubtable", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - -} - -static void -_fingerprintPublicationTable(FingerprintContext *ctx, const PublicationTable *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->columns != NULL && node->columns->length > 0) { + if (node->publication != NULL && node->publication->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "columns"); + _fingerprintString(ctx, "publication"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->columns, node, "columns", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->columns) == 1 && linitial(node->columns) == NIL)) { + _fingerprintNode(ctx, node->publication, node, "publication", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->publication) == 1 && linitial(node->publication) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - if (node->relation != NULL) { + if (node->subname != NULL) { + _fingerprintString(ctx, "subname"); + _fingerprintString(ctx, node->subname); + } + +} + +static void +_fingerprintAlterSubscriptionStmt(FingerprintContext *ctx, const AlterSubscriptionStmt *node, const void *parent, const char *field_name, unsigned int depth) +{ + if (node->conninfo != NULL) { + _fingerprintString(ctx, "conninfo"); + _fingerprintString(ctx, node->conninfo); + } + + if (true) { + _fingerprintString(ctx, "kind"); + _fingerprintString(ctx, _enumToStringAlterSubscriptionType(node->kind)); + } + + if (node->options != NULL && node->options->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "relation"); + _fingerprintString(ctx, "options"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintRangeVar(ctx, node->relation, node, "relation", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->options, node, "options", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->options) == 1 && linitial(node->options) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } - - if (node->whereClause != NULL) { + if (node->publication != NULL && node->publication->length > 0) { XXH3_state_t* prev = XXH3_createState(); XXH64_hash_t hash; XXH3_copyState(prev, ctx->xxh_state); - _fingerprintString(ctx, "whereClause"); + _fingerprintString(ctx, "publication"); hash = XXH3_64bits_digest(ctx->xxh_state); - _fingerprintNode(ctx, node->whereClause, node, "whereClause", depth + 1); - if (hash == XXH3_64bits_digest(ctx->xxh_state)) { + _fingerprintNode(ctx, node->publication, node, "publication", depth + 1); + if (hash == XXH3_64bits_digest(ctx->xxh_state) && !(list_length(node->publication) == 1 && linitial(node->publication) == NIL)) { XXH3_copyState(ctx->xxh_state, prev); if (ctx->write_tokens) dlist_delete(dlist_tail_node(&ctx->tokens)); } XXH3_freeState(prev); } + if (node->subname != NULL) { + _fingerprintString(ctx, "subname"); + _fingerprintString(ctx, node->subname); + } } static void -_fingerprintInlineCodeBlock(FingerprintContext *ctx, const InlineCodeBlock *node, const void *parent, const char *field_name, unsigned int depth) +_fingerprintDropSubscriptionStmt(FingerprintContext *ctx, const DropSubscriptionStmt *node, const void *parent, const char *field_name, unsigned int depth) { - if (node->atomic) { - _fingerprintString(ctx, "atomic"); - _fingerprintString(ctx, "true"); + if (true) { + _fingerprintString(ctx, "behavior"); + _fingerprintString(ctx, _enumToStringDropBehavior(node->behavior)); } - if (node->langIsTrusted) { - _fingerprintString(ctx, "langIsTrusted"); + if (node->missing_ok) { + _fingerprintString(ctx, "missing_ok"); _fingerprintString(ctx, "true"); } - if (node->langOid != 0) { - char buffer[50]; - sprintf(buffer, "%d", node->langOid); - _fingerprintString(ctx, "langOid"); - _fingerprintString(ctx, buffer); - } - - if (node->source_text != NULL) { - _fingerprintString(ctx, "source_text"); - _fingerprintString(ctx, node->source_text); - } - -} - -static void -_fingerprintCallContext(FingerprintContext *ctx, const CallContext *node, const void *parent, const char *field_name, unsigned int depth) -{ - if (node->atomic) { - _fingerprintString(ctx, "atomic"); - _fingerprintString(ctx, "true"); + if (node->subname != NULL) { + _fingerprintString(ctx, "subname"); + _fingerprintString(ctx, node->subname); } }