Skip to content

Commit 55bdfc1

Browse files
committed
revert: remove DBTypeOpenGauss constant + ParseDBType openGauss case (#2905)
按 fix_session_20260526_053311 用户反馈: > 禁止将opengauss单列出来,它和华为云GaussDB对于sqle平台来说是一样的, > 都是通过gaussdb插件连接管理。 > 理论上数据库结构对比功能不涉及dms、sqle代码改动。 回退两个 commit: - c6e74c2 feat(constant): add DBTypeOpenGauss + ParseDBType case for openGauss - 4e48dee test(constant): assert ParseDBType resolves openGauss three-case openGauss 不再作为独立 DBType;GaussDB / openGauss 统一为 DBTypeGaussDB="GaussDB" (通过 GitLab sqle-gaussdb-plugin 同一 PluginName 连接)。dms 代码恢复零改动状态。
1 parent 4e48dee commit 55bdfc1

2 files changed

Lines changed: 0 additions & 35 deletions

File tree

internal/dms/pkg/constant/const.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ func ParseDBType(s string) (DBType, error) {
250250
return DBTypeDM, nil
251251
case "GaussDB":
252252
return DBTypeGaussDB, nil
253-
case "openGauss", "OPENGAUSS", "opengauss":
254-
return DBTypeOpenGauss, nil
255253
case "GaussDB for MySQL":
256254
return DBTypeGaussDBForMySQL, nil
257255
case "HANA":
@@ -280,7 +278,6 @@ const (
280278
DBTypeHive DBType = "Hive"
281279
DBTypeDM DBType = "达梦(DM)"
282280
DBTypeGaussDB DBType = "GaussDB"
283-
DBTypeOpenGauss DBType = "openGauss"
284281
DBTypeGaussDBForMySQL DBType = "GaussDB for MySQL"
285282
DBTypeHANA DBType = "HANA"
286283
DBTypePolarDBForMySQL DBType = "PolarDB For MySQL"

internal/dms/pkg/constant/const_test.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -152,35 +152,3 @@ func TestParseDBType(t *testing.T) {
152152
})
153153
}
154154
}
155-
156-
func TestParseDBType_OpenGauss_EE(t *testing.T) {
157-
cases := map[string]struct {
158-
input string
159-
want DBType
160-
wantErr bool
161-
}{
162-
"openGauss literal": {input: "openGauss", want: DBTypeOpenGauss, wantErr: false},
163-
"OPENGAUSS upper": {input: "OPENGAUSS", want: DBTypeOpenGauss, wantErr: false},
164-
"opengauss lower": {input: "opengauss", want: DBTypeOpenGauss, wantErr: false},
165-
"GaussDB regression": {input: "GaussDB", want: DBTypeGaussDB, wantErr: false},
166-
"GaussDB for MySQL regression": {input: "GaussDB for MySQL", want: DBTypeGaussDBForMySQL, wantErr: false},
167-
"Unknown returns explicit error": {input: "Unknown", want: DBType(""), wantErr: true},
168-
}
169-
for name, tc := range cases {
170-
t.Run(name, func(t *testing.T) {
171-
got, err := ParseDBType(tc.input)
172-
if tc.wantErr {
173-
if err == nil {
174-
t.Fatalf("expected error for input %q, got nil", tc.input)
175-
}
176-
return
177-
}
178-
if err != nil {
179-
t.Fatalf("unexpected error for input %q: %v", tc.input, err)
180-
}
181-
if got != tc.want {
182-
t.Fatalf("ParseDBType(%q): got %q, want %q", tc.input, got, tc.want)
183-
}
184-
})
185-
}
186-
}

0 commit comments

Comments
 (0)