已开启
[开源实习]: openGauss B库B协议适配MySQL python orm框架 Django #34
totaj创建于  7月20日
totaj
totaj成员
7月20日 创建

【任务分值】20分

背景描述

openGauss B库dolphin插件中实现了MySQL协议兼容,用户在设置相关参数后,可通过MySQL的JDBC driver或者MySQL命令行客户端,直接连接openGauss。为加强生态适配,本项目旨在测试验证并适配使用python orm框架 Django配合 MySQL python驱动连接 openGauss B 兼容模式数据库。

需求描述

基于openGauss的MySQL协议兼容,测试验证并适配使用python orm框架 Django配合 MySQL python驱动连接 openGauss B 兼容模式数据库,并输出示例指导文档。

CPU架构

x86_64/aarch64 均可

操作系统版本

openEuler 20.03 LTS

openGauss版本

openGauss 7.0.0-LTS

产出标准

1、代码
如有适配代码,提交到plugin仓
https://gitcode.com/opengauss/Plugin
2、测试代码
输出测试思维导图及测试代码,并输出自测报告,如发现bug,请修复,并补充在测试报告中,统一提交到examples仓库
https://gitcode.com/opengauss/examples
10、使用示例指导文档
参考基于Mybatis开发,输出基于python orm框架 Django开发指导文档,提交到docs仓
https://docs.opengauss.org/zh/docs/latest/mysql_compatibility_developer_guide/mybatis_development.html
https://gitcode.com/opengauss/docs

PR提交地址

https://gitcode.com/opengauss/docs

期望完成时间

2026.10.30

开发指导

https://docs.opengauss.org/zh/docs/7.0.0-RC3/extension_reference/dolphin_mysql_protocol_compatibility.html

导师及邮箱

@wofanzheng hanlizhu@huawei.com wofanzheng

【备注】领取本任务时,请参照官网文档提前安装好 openGauss,并将安装且运行成功的截图、您的简历与本任务的开发方案邮件发给导师。导师收到邮件后,会在本任务的issue评论内通过命令反馈评审结果。

likedislike
opengauss_bot
opengauss_bot成员
7月20日 评论:

This issue requires an assignee. Since you haven't specified one, we've assigned TestManager as the default assignee for this issue.

likedislike
opengauss_botopengauss_bot成员
7月20日 将 TestManager 设为负责人
opengauss_botopengauss_bot成员
7月20日 添加了label:sig/Community
opengauss_bot
opengauss_bot成员
7月20日 评论:

Welcome To openGauss Community

Hey @totaj , 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: Community ,
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
Yhw050920
Yhw050920
7月30日 评论:

/intern-assign

likedislike
opengauss_bot
opengauss_bot成员
7月30日 评论:

@hongwei-2026 , 感谢您认领此任务, 请及时跟导师沟通, 导师审核通过后才能承担此任务, 否则任务无效.

likedislike
Yhw050920
Yhw050920
7月30日 评论:

@wofanzheng 已发邮箱,请过目

likedislike
Yhw050920
Yhw050920
7月31日 评论:

@totaj @TestManager @opengauss_bot @wofanzheng 邮箱已发,邮箱为feizi_050920@qq.com,麻烦老师有时间帮忙看看

likedislike
wofanzheng
wofanzheng成员
7月31日 评论:

/intern-approve

likedislike
opengauss_bot
opengauss_bot成员
7月31日 评论:

@hongwei-2026 , 恭喜您已成功领取该任务, 请及时处理任务. 认领任务>导师审核认领资格>处理任务>提交任务>导师审核>pr合入>获得积分.

likedislike
Yhw050920
Yhw050920
8月5日 评论:

任务进度同步(#34)

已完成开发与自测,并向上游提交 PR(请导师/维护者检视):

产出 PR
examples(示例 + 自测报告 + 思维导图 + 截图) https://gitcode.com/opengauss/examples/merge_requests/103
docs(Django 开发指南) https://gitcode.com/opengauss/docs/merge_requests/8774
Plugin 本期无服务端补丁(适配在 Django 客户端侧)

环境与验收

  • OS:openEuler 20.03 LTS x86_64
  • DB:openGauss 7.0.0-LTS.B008(archive_test,build 75f983eb;正式 LTS 未上架说明见 PR)
  • 结果:INSTALL_OK / DEMO_OK(截图见 PR 描述)

AI 辅助披露(openEuler 策略)

请关联检视上述 PR,谢谢!

likedislike
Yhw050920
Yhw050920
8月5日 评论:

合规修复同步(Issue #34)

已针对流水线问题完成修复并强推特性分支:

  1. AI Declaration:PR 描述与 commit 统一为
    Assisted-by: Cursor Agent/Composer(Agent=Cursor Agent,Model=Composer),移除不合规的 Co-authored-by: Cursor
  2. 敏感信息:删除明文口令/公网 IP;密码仅环境变量注入;移除可能含口令的截图文件。
  3. 设计文档:examples 增加 DjangoConnectOpenGaussB/docs/设计文档.md
  4. CLA 邮箱:Git Author 已改为 feizi_050920@qq.com(hongwei-2026),请用该邮箱完成个人 CLA 签署。

PR:

请重新触发检视/流水线,谢谢。

likedislike
Yhw050920
Yhw050920
8月5日 评论:

AI Declaration 说明(请维护者/导师协助)

本贡献实际使用的工具栈为:

  • Agent平台:Cursor
  • 模型:Composer-2(Cursor 内置编码模型)

已按 openEuler AI 策略 模板填写,且 commit 含:

Assisted-by: Cursor/Composer-2

若流水线白名单尚未收录 Cursor/Composer-2,请协助放行或告知允许的声明写法。谢谢。

关联:https://gitcode.com/opengauss/opensource-intership/issues/34

likedislike
Yhw050920
Yhw050920
8月6日 评论:

@wofanzheng
老师您好:

关于任务 [开源实习] openGauss B库B协议适配MySQL python orm框架 Django #34,iusse:https://gitcode.com/opengauss/opensource-intership/issues/34,进展与测试版本差异说明如下。
一、进展
已提 PR:
examples:https://gitcode.com/opengauss/examples/merge_requests/103
docs:https://gitcode.com/opengauss/docs/merge_requests/8774
自测通过:INSTALL_OK / DEMO_OK(Django + PyMySQL,dolphin 3308,B 库 ORM CRUD)。本期无服务端缺陷,未提 Plugin PR。
二、测试版本为何不一致(重点)
任务要求 7.0.0-LTS;我实际使用 7.0.0-LTS.B008(archive_test 转测包),构建号 75f983eb(与 git_num 一致)。
原因:
发现正式 7.0.0-LTS 当时未在本 OS/架构完整上架;openEuler 20.03/x86 上最新可用且含 dolphin 的 Server 包为 LTS.B008;gs_ctl -V 仍可能显示 7.0.0-RC3——这是包内二进制展示字段;判定应以转测目录名 LTS.B008 与构建号 75f983eb 为准,并非装错包。
若需换成指定正式包,请告知目标版本,我可重装补测。
三、合规
CLA 已签(feizi_050920@qq.com)。AI 声明为 Cursor / Auto(Assisted-by: Cursor/Auto)。若白名单不认 Auto,请老师指导允许写法或协助放行。
请老师确认:B008 版本说明是否可接受、PR 是否还需修改。
ci也跑过了
728d5cf826df9ca73ed5b10e87698f71.png
这个错误信息点进去看不了

likedislike
Yhw050920
Yhw050920
27 天前 评论:

@wofanzheng ,老师帮忙看一下iusse和PR

likedislike
Yhw050920
Yhw050920
27 天前 评论:

/intern-completed

likedislike
opengauss_bot
opengauss_bot成员
27 天前 评论:

@hongwei-2026 , 请关注您提交的pr审核进度, 跟进相关负责人审核, pr合入后可获得积分. 注: 提交pr时, 请务必在pr描述里添加此issue编号(#issue编号), 谢谢!

likedislike
Yhw050920Yhw050920
26 天前 关联了pull request:【实习#34】dolphin: 增加 default_storage_engine/sql_auto_is_null 兼容变量以支持 Django 原生 MySQL backend
Yhw050920
Yhw050920
25 天前 评论:
likedislike
Yhw050920
Yhw050920
25 天前 评论:
totajtotaj成员
12 天前 修改了issue 的描述
wofanzheng
wofanzheng成员
11 天前 评论:

@wofanzheng
老师您好:

关于任务 [开源实习] openGauss B库B协议适配MySQL python orm框架 Django #34,iusse:https://gitcode.com/opengauss/opensource-intership/issues/34,进展与测试版本差异说明如下。
一、进展
已提 PR:
examples:https://gitcode.com/opengauss/examples/merge_requests/103
docs:https://gitcode.com/opengauss/docs/merge_requests/8774
自测通过:INSTALL_OK / DEMO_OK(Django + PyMySQL,dolphin 3308,B 库 ORM CRUD)。本期无服务端缺陷,未提 Plugin PR。
二、测试版本为何不一致(重点)
任务要求 7.0.0-LTS;我实际使用 7.0.0-LTS.B008(archive_test 转测包),构建号 75f983eb(与 git_num 一致)。
原因:
发现正式 7.0.0-LTS 当时未在本 OS/架构完整上架;openEuler 20.03/x86 上最新可用且含 dolphin 的 Server 包为 LTS.B008;gs_ctl -V 仍可能显示 7.0.0-RC3——这是包内二进制展示字段;判定应以转测目录名 LTS.B008 与构建号 75f983eb 为准,并非装错包。
若需换成指定正式包,请告知目标版本,我可重装补测。
三、合规
CLA 已签(feizi_050920@qq.com)。AI 声明为 Cursor / Auto(Assisted-by: Cursor/Auto)。若白名单不认 Auto,请老师指导允许写法或协助放行。
请老师确认:B008 版本说明是否可接受、PR 是否还需修改。
ci也跑过了
728d5cf826df9ca73ed5b10e87698f71.png
这个错误信息点进去看不了

@hongwei-2026

测试版本主线就可以,具体commit不要求,错误信息不用管

likedislike
Yhw050920
Yhw050920
11 天前 评论:
likedislike
Yhw050920
Yhw050920
11 天前 评论:
likedislike
Yhw050920
Yhw050920
11 天前 评论:

CI通过了,iusse: [开源实习]: openGauss B库B协议适配MySQL python orm框架 Django
docs: https://gitcode.com/opengauss/docs/merge_requests/8774
examples: https://gitcode.com/opengauss/examples/merge_requests/103
Plugin : https://gitcode.com/opengauss/Plugin/merge_requests/2524
老师,根据最新要求,已修改,并且流水已跑通,麻烦有时间帮忙检视@wofanzheng

likedislike
Yhw050920
Yhw050920
8 天前 评论:

CI通过了,iusse: [开源实习]: openGauss B库B协议适配MySQL python orm框架 Django
docs: https://gitcode.com/opengauss/docs/merge_requests/8774
examples: https://gitcode.com/opengauss/examples/merge_requests/103
Plugin : https://gitcode.com/opengauss/Plugin/merge_requests/2524
老师,根据最新要求,已修改,并且流水已跑通,麻烦有时间帮忙检视
@wofanzheng

likedislike
wofanzheng
wofanzheng成员
6 天前 评论:

收到,处理检视合入中

likedislike
Yhw050920
Yhw050920
6 天前 评论:

CI通过了,iusse: [开源实习]: openGauss B库B协议适配MySQL python orm框架 Django
docs: https://gitcode.com/opengauss/docs/merge_requests/8774
examples: https://gitcode.com/opengauss/examples/merge_requests/103
Plugin : https://gitcode.com/opengauss/Plugin/merge_requests/2524
老师,根据最新要求,已修改,并且流水已跑通,麻烦有时间帮忙检视

@wofanzheng 老师好,Plugin MR !2524 的主流水卡住了,麻烦帮忙看一下。
现象:

  1. 标签一直停在 ci-pipeline-running(时间戳卡在 14:57),但实际没有跑完
  2. 最近一次 openGauss_Plugin_PR 是 #7542 ABORTED
  3. 之后多次 /retest,以及空提交推送,都没有产生新的 build(7543+ 不存在)
  4. sca-success / codecheck-success / opengauss-cla/yes 都已正常
    请求:
    请帮忙清掉僵尸的 ci-pipeline-running,或手动触发一次 openGauss_Plugin_PR。我这边先不再发 /retest,避免继续 ABORT。
    MR:https://gitcode.com/opengauss/Plugin/merge_requests/2524
    Jenkins:https://opengaussjenkins.osinfra.cn/view/openGauss_plugin_PR/job/openGauss_Plugin_PR/7542/

@wofanzheng

likedislike
Yhw050920
Yhw050920
6 天前 评论:

@wofanzheng 老师好,MR !2524 连续多次 fastcheck 失败,根因都是环境连不上临时库,不是本次 dolphin GUC 改动。
现象:

  • configure / make install 成功
  • postmaster 已在 25432 启动后,gsql 立即报 failed to connect Unknown:25432
  • Part2 甚至在 CREATE DATABASE contrib_regression 阶段就失败
  • expected/results 的 diff 也是 dummy.out 变成连接失败,不是业务 SQL 结果不一致
    请帮忙看下 CI 节点/重跑,或确认是否环境抖动。代码侧暂无明显可改点。
    MR:https://gitcode.com/opengauss/Plugin/merge_requests/2524
likedislike
wofanzheng
wofanzheng成员
5 天前 评论:

已复核最新提交和 #7543/#7546 的原始子任务日志。这次不能按“纯环境抖动”处理,也不建议只重跑。

两次 Part2 都在 test_guc_select_and_set 的同一位置稳定复现:SET default_storage_engine 为 MyISAM 后,查询结果变成长串 ZZZ...;随后 SET 为 ArbitraryEngine 时出现 connection to server was lost,后面的 failed to connect 是服务进程退出后的连锁结果。对应当前 Plugin !2524 的 plugin_postgres.cpp:L910-L912 使用 pstrdup 替换 GUC 字符串,存在生命周期错误。#7546 另一路在 CREATE DATABASE 前失败可能有节点因素,但不能解释上述两次确定性代码故障。

请先按 PR 行内意见修复字符串生命周期问题、同步回归预期,再执行 /retest。docs !8774 和 examples !103 的主要功能问题已修复,但两处仍需明确补充 Plugin !2522 的前置依赖。

Part2 日志:

likedislike
Yhw050920
Yhw050920
4 天前 评论:

@wofanzheng
已按复核意见更新三仓:

Plugin 415729bd1:default_storage_engine 非 InnoDB 拒值,去掉 pstrdup 悬空指针,回归 expected 已同步
docs 49efc35 / examples 587b37ac:正文与 README 已明确 Plugin !2522 须先合入,并补充配套 PR 列表 请帮忙再看,谢谢!

likedislike
Yhw050920
Yhw050920
4 天前 评论:

@wofanzheng

README 依赖问题已在后续提交 587b37ac 修复:环境与 Plugin 侧依赖均已明确列出 Plugin !2522(须先合入)与 !2524 的先后要求。请以当前 tip 复核,谢谢!

likedislike
wofanzheng
wofanzheng成员
4 天前 评论:

已按当前 tip 复核:

  • docs 49efc35:VERSION bootstrap、按本次主键操作以及 Plugin !2522 前置依赖均已补齐;
  • examples abd57c8:README 依赖顺序、转义配置、特殊字符断言和精确 CRUD 均已补齐;
  • Plugin 415729b:已删除 pstrdup 悬空指针实现,改为拒绝非 InnoDB,并同步 MyISAM/任意值回归。

上述 6 条功能检视意见已确认修复并关闭。Plugin 新 head 此前只跑了 SCA/CodeCheck,现有 ci-pipeline-failed 仍对应旧 #7546;我已在 !2524 触发一次 /retest。请等待新主流水结果,通过后再确认任务 34 合入。合入顺序仍为 !2522 → !2524 → examples/docs。

likedislike
wofanzheng
wofanzheng成员
4 天前 评论:

补充最终流水结论:Plugin !2524 最新 head 415729b 的 openGauss_Plugin_PR #7568 已 SUCCESS。Compile #7493 的 48/48 与 b_proto_jdbc 全部通过,Part2 #3174 也通过,且本次直接相关的 test_guc_select_and_set 为 ok;GitCode 已更新为 ci-pipeline-success。

因此任务 34 三个 PR 的本轮功能检视均已通过,未发现新的代码功能问题。实际合入/使用仍按依赖顺序:Plugin !2522 → Plugin !2524 → examples/docs;其中 !2522 仍有未修意见,需先处理。

流水:https://opengaussjenkins.osinfra.cn/view/openGauss_plugin_PR/job/openGauss_Plugin_PR/7568

likedislike
Yhw050920
Yhw050920
1 天前 评论:
likedislike
wofanzheng
wofanzheng成员
1 天前 评论:

2026-09-07 已再次复扫:docs #8774(49efc35)、examples #103(abd57c8)、Plugin #2524(415729b)均无新提交,原功能意见仍为已解决,Plugin 主流水 #7568 仍为 SUCCESS,本轮没有新增代码功能问题。

结论不变:任务 34 三个 PR 自身功能检视通过;实际合入/使用仍按 Plugin #2522 → Plugin #2524 → examples/docs 的依赖顺序。当前 #2522 新复扫仍有协议状态阻塞问题,因此先等待 #2522 修复。

likedislike