Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshi-yb committed Jan 29, 2025
1 parent 9eaa806 commit 7f2a0bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions yb-voyager/src/query/queryissue/issues_ddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func testSetAttributeIssue(t *testing.T) {

var errMsg string
switch {
case testYbVersion.Equal(ybversion.V2_25_0_0):
case testYbVersion.ReleaseType() == ybversion.V2_25_0_0.ReleaseType() && testYbVersion.GreaterThanOrEqual(ybversion.V2_25_0_0):
errMsg = `ALTER action ALTER COLUMN ... SET not supported yet`
default:
errMsg = "ALTER TABLE ALTER column not supported yet"
Expand All @@ -171,7 +171,7 @@ func testClusterOnIssue(t *testing.T) {

var errMsg string
switch {
case testYbVersion.Equal(ybversion.V2_25_0_0):
case testYbVersion.ReleaseType() == ybversion.V2_25_0_0.ReleaseType() && testYbVersion.GreaterThanOrEqual(ybversion.V2_25_0_0):
errMsg = "ALTER action CLUSTER ON not supported yet"
default:
errMsg = "ALTER TABLE CLUSTER not supported yet"
Expand All @@ -194,7 +194,7 @@ func testDisableRuleIssue(t *testing.T) {

var errMsg string
switch {
case testYbVersion.Equal(ybversion.V2_25_0_0):
case testYbVersion.ReleaseType() == ybversion.V2_25_0_0.ReleaseType() && testYbVersion.GreaterThanOrEqual(ybversion.V2_25_0_0):
errMsg = "ALTER action DISABLE RULE not supported yet"
default:
errMsg = "ALTER TABLE DISABLE RULE not supported yet"
Expand Down Expand Up @@ -417,7 +417,7 @@ INSERT INTO collation_ex (name) VALUES
('andrÉ');
;`)
switch {
case testYbVersion.Equal(ybversion.V2_25_0_0):
case testYbVersion.ReleaseType() == ybversion.V2_25_0_0.ReleaseType() && testYbVersion.GreaterThanOrEqual(ybversion.V2_25_0_0):
assert.NoError(t, err)
rows, err := conn.Query(context.Background(), `SELECT name
FROM collation_ex
Expand Down
4 changes: 2 additions & 2 deletions yb-voyager/src/query/queryissue/issues_dml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ RETURNING merge_action(), w.*;
_, err = conn.Exec(ctx, sql)
var errMsg string
switch {
case testYbVersion.Equal(ybversion.V2_25_0_0):
case testYbVersion.ReleaseType() == ybversion.V2_25_0_0.ReleaseType() && testYbVersion.GreaterThanOrEqual(ybversion.V2_25_0_0):
errMsg = "This statement not supported yet"
default:
errMsg = `syntax error at or near "MERGE"`
Expand Down Expand Up @@ -352,7 +352,7 @@ func testNonDecimalIntegerLiteralIssue(t *testing.T) {
_, err = conn.Exec(ctx, sql)
var errMsg string
switch {
case testYbVersion.Equal(ybversion.V2_25_0_0):
case testYbVersion.ReleaseType() == ybversion.V2_25_0_0.ReleaseType() && testYbVersion.GreaterThanOrEqual(ybversion.V2_25_0_0):
errMsg = `trailing junk after numeric literal at or near`
default:
errMsg = `syntax error at or near "as"`
Expand Down
1 change: 1 addition & 0 deletions yb-voyager/src/ybversion/yb_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func (ybv *YBVersion) OriginalSegmentsLen() int {
}

func (ybv *YBVersion) GreaterThanOrEqual(other *YBVersion) bool {
//TODO: should fail in case the ybv and other version is of different release type
return ybv.Version.GreaterThanOrEqual(other.Version)
}

Expand Down

0 comments on commit 7f2a0bf

Please sign in to comment.