已开启
feat: add PyMySQL compatibility test suite for openGauss dolphin plugin #106
liuhaodong-2026创建于 27 天前
feat: add PyMySQL compatibility test suite for openGauss dolphin plugin #106
已开启
liuhaodong-2026创建于 27 天前
27 天前

【标题】
PyMySQL 1.2.0 兼容 openGauss 7.0.0-RC3 B兼容数据库(dolphin插件)兼容性测试

【实现内容】:
提交 PyMySQL 兼容性测试套件及自测报告,包含:

  • test_pymysql_opengauss.py:18个测试项,覆盖连接认证、CRUD、事务、游标类型、二进制、日期时间、Unicode、重连稳定性等
  • self_test_report.md:详细自测报告,含测试结果与已知限制说明

【根因分析】:
PyMySQL 通过 dolphin 插件 MySQL 协议端口连接 openGauss 时存在协议兼容性问题,
本测试验证修复后的兼容性现状。

【实现方案】:
基于 PyMySQL 1.2.0 + openGauss 7.0.0-RC3 + dolphin 插件,
在 B 兼容数据库上运行 18 项兼容性测试。

【关联需求或issue】:
2025 开源之夏课题:PyMySQL 兼容 openGauss B兼容数据库

【开发自验报告】:

  1. 自验结果见 PyMySQLCompatibility/self_test_report.md,18项中17项PASS,1项(错误码映射)为已知限制
  2. 不涉及 fastcheck 测试用例(纯客户端兼容性测试)
  3. 不涉及资料修改(文档在 docs 仓库单独提交)
    4-8. 不涉及
  4. 不涉及 Plugin 仓代码修改

【当前PR是否有AI参与】:
[x] 否

likedislike
合并受阻
Lliuhaodong-2026
27 天前 创建了 pull request,commit 6fb8525a
opengauss_botopengauss_bot成员
27 天前 添加了label:sig/Infra
opengauss_bot
opengauss_bot成员
27 天前 评论:

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 .

likedislike
opengauss_botopengauss_bot成员
27 天前 添加了label:stat/needs-squashai-co-authored
opengauss_botopengauss_bot成员
27 天前 添加了label:opengauss-cla/no
此处折叠了105条消息 查看更多
opengauss_bot
opengauss_bot成员
22 小时前 评论:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): stat/needs-squash.

likedislike
opengauss_botopengauss_bot成员
22 小时前 添加了label:opengauss-cla/no
liuhaodong-2026
22 小时前 评论:

/check-cla

likedislike
opengauss_bot
opengauss_bot成员
22 小时前 评论:

CLA Signature Guide

@liuhaodong-2026 , thanks for your pull request.

The following commit(s) are not associated with a signed Contributor License Agreement (CLA).

Commit Reason
6604b9ae test: add pymysql compatibility ... the email used in the commit is not linked to a signed CLA!
please verify that it matches the email you used when signing the CLA.

To sign CLA, click here.

To check if your email is configured correctly, refer to the FAQs.

Once you've signed the CLA or updating your email, please comment /check-cla to revalidate CLA status.

likedislike
wofanzheng
wofanzheng成员4 小时前进行代码检视1
PyMySQLCompatibility/test_pymysql_opengauss.py
@@ -0,0 +490,4 @@
490+ conn = new_conn()
491+ cur = conn.cursor()
492+ try:
493+ cur.execute("DROP TABLE IF EXISTS t_dup")
wofanzheng
wofanzheng4 小时前评论:

位置:test_pymysql_opengauss.py:L493-L498

【问题】
重复键场景把 DROP TABLECREATE TABLE、第一次正常 INSERT 和真正应触发重复键的第二次 INSERT 放在同一个 try 中。若建表失败、权限不足或第一次 INSERT 失败,也会落入 L508 的通用异常分支并加入 xfail_reasons;runner 最终只统计 XFAIL、仍返回退出码 0,因此测试可能根本没有执行重复键 SQL却显示流水成功。

当前代码:https://gitcode.com/opengauss/examples/blob/6604b9ae56d68391e325f1545a38613310bf62c7/PyMySQLCompatibility/test_pymysql_opengauss.py#L493-L512

【建议】
先在异常断言之外完成 DROP/CREATE/第一次 INSERT 并提交,再用单独 try 只包住第二次重复键 INSERT;仅将已确认的错误映射差异认定为 XFAIL,准备阶段或连接类异常直接作为 FAIL 抛出。

likedislike