Skip to content

Ce polardb pr 816#619

Merged
LordofAvernus merged 2 commits into
mainfrom
ce_polardb_pr_816
May 18, 2026
Merged

Ce polardb pr 816#619
LordofAvernus merged 2 commits into
mainfrom
ce_polardb_pr_816

Conversation

@BugsGuru
Copy link
Copy Markdown
Collaborator

@BugsGuru BugsGuru commented May 18, 2026

User description

https://github.com/actiontech/dms-ee/issues/816

link https://github.com/actiontech/dms-ee/pull/833


Description

  • 新增对 PolarDB For MySQL 的 DB 类型支持

  • 修改常量定义、解析及数据导出白名单

  • 更新工作台服务中 DB 类型转换逻辑

  • 添加对应单元测试覆盖新功能


Diagram Walkthrough

flowchart LR
  A["ParseDBType逻辑"] -- "匹配新增类型" --> B["PolarDB For MySQL常量"]
  B -- "添加到白名单" --> C["supportedDataExportDBTypes"]
  D["sql_workbench_service转换逻辑"] -- "映射新类型" --> E["返回 MYSQL"]
Loading

File Walkthrough

Relevant files
Enhancement
const.go
添加 PolarDB For MySQL 支持逻辑                                                               

internal/dms/pkg/constant/const.go

  • 新增 PolarDB For MySQL 解析分支
  • 定义 DBTypePolarDBMySQL 常量
  • 更新数据导出白名单支持
+4/-0     
sql_workbench_service.go
更新 DB 类型转换映射                                                                                         

internal/sql_workbench/service/sql_workbench_service.go

  • 添加 PolarDB For MySQL 映射返回 "MYSQL"
+2/-0     
Tests
const_test.go
测试新增 DB 类型支持                                                                                         

internal/dms/pkg/constant/const_test.go

  • 更新白名单测试,包含新类型
  • 添加 TestParseDBType_PolarDB 测试函数
+37/-0   
sql_workbench_service_test.go
新增 DMS 转换单元测试                                                                                       

internal/sql_workbench/service/sql_workbench_service_test.go

  • 新增测试验证 PolarDB For MySQL 转换
  • 检查支持逻辑返回预期结果
+2/-0     

…#816)

- Add DBTypePolarDBMySQL constant with value "PolarDB For MySQL"
- Add ParseDBType case branch for "PolarDB For MySQL"
- Add DBTypePolarDBMySQL to supportedDataExportDBTypes whitelist
- Add unit tests for ParseDBType and data export support
…h (#816)

- convertDBType: map "PolarDB For MySQL" to "MYSQL" so ODC creates MySQL-type connections
- SupportDBType: confirm PolarDB returns false (no Provision integration)
- Unit tests: add PolarDB cases to Test_convertDBType and Test_SupportDBType
@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
统一支持类型逻辑

请确认各模块对 PolarDB For MySQL 是否应保持一致的支持状态。目前在常量和数据导出相关测试中,该类型被视为支持,而在 SQL workbench
测试中却期望不支持,可能导致逻辑混淆。建议统一设计测试预期,以避免系统行为不一致。

internal/sql_workbench/service/sql_workbench_service_test.go [53]

-"PolarDB MySQL unsupported":  {input: pkgConst.DBTypePolarDBMySQL, expected: false},
+"PolarDB MySQL unsupported":  {input: pkgConst.DBTypePolarDBMySQL, expected: true},
Suggestion importance[1-10]: 6

__

Why: The suggestion highlights an inconsistency where PolarDB MySQL is treated as supported in other modules but expected to be unsupported in this test. Changing the expected value to true promotes consistency, though the impact is limited to test behavior.

Low

@LordofAvernus LordofAvernus merged commit b3a68fc into main May 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants