Skip to content

Commit

Permalink
Made some suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivanshGahlot committed Jan 9, 2025
1 parent b8c311b commit 94bd4c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions yb-voyager/src/query/queryissue/detectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func NewUniqueNullsNotDistinctDetector(query string) *UniqueNullsNotDistinctDete

// Detect checks if a unique constraint is defined which has nulls not distinct
func (d *UniqueNullsNotDistinctDetector) Detect(msg protoreflect.Message) error {
if queryparser.GetMsgFullName(msg) == queryparser.PG_QUERY_INDEX_STMT_NODE {
if queryparser.GetMsgFullName(msg) == queryparser.PG_QUERY_INDEXSTMT_NODE {
indexStmt, err := queryparser.ProtoAsIndexStmt(msg)
if err != nil {
return err
Expand All @@ -413,7 +413,7 @@ func (d *UniqueNullsNotDistinctDetector) Detect(msg protoreflect.Message) error
if indexStmt.Unique && indexStmt.NullsNotDistinct {
d.detected = true
}
} else if queryparser.GetMsgFullName(msg) == queryparser.PG_QUERY_TABLECONSTRAINT_NODE {
} else if queryparser.GetMsgFullName(msg) == queryparser.PG_QUERY_CONSTRAINT_NODE {
constraintNode, err := queryparser.ProtoAsTableConstraint(msg)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions yb-voyager/src/query/queryparser/helpers_protomsg.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ func ProtoAsIndexStmt(msg protoreflect.Message) (*pg_query.IndexStmt, error) {
}
indexStmtNode, ok := protoMsg.(*pg_query.IndexStmt)
if !ok {
return nil, fmt.Errorf("failed to cast msg to %s", PG_QUERY_INDEX_STMT_NODE)
return nil, fmt.Errorf("failed to cast msg to %s", PG_QUERY_INDEXSTMT_NODE)
}
return indexStmtNode, nil
}
Expand All @@ -439,7 +439,7 @@ func ProtoAsTableConstraint(msg protoreflect.Message) (*pg_query.Constraint, err
}
constraintNode, ok := proto.(*pg_query.Constraint)
if !ok {
return nil, fmt.Errorf("failed to cast msg to %s", PG_QUERY_TABLECONSTRAINT_NODE)
return nil, fmt.Errorf("failed to cast msg to %s", PG_QUERY_CONSTRAINT_NODE)
}
return constraintNode, nil
}
Expand Down
4 changes: 2 additions & 2 deletions yb-voyager/src/query/queryparser/traversal_proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const (
PG_QUERY_VIEWSTMT_NODE = "pg_query.ViewStmt"
PG_QUERY_COPYSTSMT_NODE = "pg_query.CopyStmt"

PG_QUERY_TABLECONSTRAINT_NODE = "pg_query.Constraint"
PG_QUERY_INDEX_STMT_NODE = "pg_query.IndexStmt"
PG_QUERY_CONSTRAINT_NODE = "pg_query.Constraint"
PG_QUERY_INDEXSTMT_NODE = "pg_query.IndexStmt"
)

// function type for processing nodes during traversal
Expand Down

0 comments on commit 94bd4c8

Please sign in to comment.