Feature Request: Support session state tracking
還沒有人認領這個 Issue。
評估
研究方向
Start with MySQLdb.constants.CLIENT and the _mysql.connection API, then review the MySQL session-tracking documentation linked in the issue. Implementing the minimum means supporting SESSION_TRACK and get_session_track_gtids; completion for the broader request also includes the three variable, transaction-characteristic, and transaction-state methods with their documented return data.
由索引模型根據 Issue 內容生成。
描述
Note: I may be able to work on putting together a pull request for this feature request, but I wanted to make sure you were okay with this feature request and the approach I'm taking before doing all that work, hence I am filing this feature request for discussion and approval.
MySQL has a feature enabling server tracking of client session state changes. When this is enabled on the server and client, the server can actually notify the connected client about changes to its session state. This enables the client to, for example (our use case), determine which Global Transaction ID (GTID) or GTIDs were created when the client commits a transaction.
You can read more about this here:
- https://dev.mysql.com/doc/refman/5.7/en/session-state-tracking.html
- https://dev.mysql.com/doc/refman/5.7/en/mysql-session-track-get-first.html
- https://dev.mysql.com/doc/refman/5.7/en/mysql-session-track-get-next.html
Here's what is needed to support this:
- A new constant in
MySQLdb.constants.CLIENT:SESSION_TRACK = 1 << 23 - A new method on
_mysql.connectionnamedget_session_track_gtidswhich returns a list of GTIDs using C functionsmysql_session_track_get_first/mysql_session_track_get_nextand the enum valueSESSION_TRACK_GTIDS. - A new method on
_mysql.connectionnamedget_session_track_variableswhich returns a list of namedtuples containing the session variable names and values for changed variables using the same C functions and the enum valueSESSION_TRACK_SYSTEM_VARIABLES. - A new method on
_mysql.connectionnamedget_session_track_tx_characteristicswhich returns a list of strings of the characteristics that changed using the same C functions and the enum valueSESSION_TRACK_TRANSACTION_CHARACTERISTICS. - A new method on
_mysql.connectionnamedget_session_track_tx_statewhich returns a list of namedtuples containing information parsed from the data as described in the documentation forSESSION_TRACK_TRANSACTION_STATEusing the same C functions and the enum valueSESSION_TRACK_TRANSACTION_STATE.
The bare minimum that we need is items 1 and 2, but implementing also 3 through 5 would be more complete.
- 主要語言
- Python
- 星號
- 2.5k
- 分支
- 443
- 平均合併
- 1 天 10 小時
- 30 天內合併 PR
- 1
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
PyMySQL/mysqlclient 的其他 Issue
-
feature-request
難度 5/5 一週以上 新手友好度 25/100
PyMySQL/mysqlclient#443 · 5 則留言 ·
-
feature-request
難度 2/5 1-3 小時 新手友好度 42/100
PyMySQL/mysqlclient#319 · 1 則留言 ·
查看 PyMySQL/mysqlclient 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 63/100
GAM-team/got-your-back#547 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
UKGovernmentBEIS/inspect_ai#5821 ·
維護者通常 1 天內回覆
-
docs help wanted
難度 1/5 1-3 小時 新手友好度 75/100
-
evidence wanted good first issue help wanted
難度 2/5 1-3 小時 新手友好度 72/100
open-coder-ai/agentseam#195 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆