合并受阻
Welcome To openGauss Community
Hey @liuhaodong-2026 , thanks for your contribution to the community.
Bot Usage Manual
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.
Contact Guide
If you have any questions, please contact the SIG: Infra ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @ailoooong, @gzbang, @libiao2024, @zhangxubo .


AI Declaration Check Failed
@liuhaodong-2026, AI declaration compliance check failed, please try again later. ❌


【问题】
异常只被转换成 False,最终没有返回非零退出码,测试失败时 CI 仍可能判断成功。
【建议】
末尾增加:
raise SystemExit(1 if failed else 0)


复核当前 head 288fd2af:主程序仍只打印 failed 数量,没有返回非零退出码;任一用例失败时进程仍会以 0 退出,CI 仍可能误判通过。本条尚未修改,请在结果输出后执行 raise SystemExit(1 if failed else 0)。
【问题】
报错后未 rollback,342行 开始的重复键测试可能运行在 aborted transaction 中;同时代码捕获任意异常且没有断言,导致错误映射不正确时仍然 PASS。、
【建议】
两个错误场景使用独立事务;第一个错误后立即 rollback,并断言准确异常类型或 SQLSTATE。


复核当前 head 288fd2af:第一个错误后仍未 rollback,重复键场景仍可能在 aborted transaction 中执行;两处仍捕获任意异常且不校验异常类型、错误码或 SQLSTATE,因此错误映射不正确时仍会 PASS。本条尚未修改。请将两个错误场景拆为独立事务或连接,并分别断言预期异常;重复键必须断言 IntegrityError、1062/23000,不能把任意异常作为通过。
【问题】
测试使用 X'...' SQL 字面量,没有绑定 Python bytes,并且只比较长度。即使 bytes 参数不支持或内容损坏,测试仍可能 PASS。
【建议】
通过 %s 绑定 bytes,查询原始列并逐字节比较。


复核当前 head 288fd2af:BLOB 用例仍使用 X 十六进制 SQL 字面量,只比较长度,未覆盖 mysql-connector 对 Python bytes 的参数编码,也不能证明内容未损坏。本条尚未修改。请用 %s 绑定空 bytes、含 0x00/0xFF 的 bytes 和 1 KB bytes,查询 data 原列并逐字节断言相等。
changed this line on da86edb4 view diff detail
【问题】公共连接方法仍未配置 sql_mode="NO_BACKSLASH_ESCAPES";普通 CRUD 数据恰好没有引号或反斜杠,无法发现通用连接在真实特殊字符下的编码问题。只在个别测试中连接后执行原始 SET,还可能与 Connector/Python 缓存的 connection.sql_mode 不一致。
【建议】在 mysql.connector.connect() 参数中直接增加 sql_mode="NO_BACKSLASH_ESCAPES",并在普通 CRUD 增加含单引号和反斜杠的参数绑定、逐值往返断言。


【标题】Add mysql-connector-python compatibility test for openGauss dolphin plugin
【实现内容】:
新增 mysql-connector-python 连接 openGauss B 兼容模式数据库的兼容性测试代码及自测报告,位于 MysqlConnectorCompatibility/ 目录。
【根因分析】:
现有 examples 仓库缺少 mysql-connector-python 驱动的兼容性验证,开发者无法了解该驱动连接 openGauss dolphin 插件的可行性及所需配置。
【实现方案】:
编写覆盖 18 个测试场景的测试脚本,发现并记录 3 个兼容性问题(collation 不支持、C 扩展认证失败、反斜杠转义不兼容),提供解决方案,全部测试通过(18/18)。
【关联需求或issue】: /
【开发自验报告】:
【当前PR是否有AI参与】:
[x] 否