From ddc66757efcfbddf7676964ca94a02992e8663cd Mon Sep 17 00:00:00 2001 From: Mikhail Chinkov Date: Fri, 3 Jan 2025 15:03:39 +0100 Subject: [PATCH] add database name as the Connection attribute --- src/MySQLdb/connections.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/MySQLdb/connections.py b/src/MySQLdb/connections.py index 73c95e0..c357545 100644 --- a/src/MySQLdb/connections.py +++ b/src/MySQLdb/connections.py @@ -204,6 +204,8 @@ class object, used to create cursors (keyword only) if type(k) is not int # noqa: E721 } + self.database = kwargs2.get("database", "") + self._server_version = tuple( [numeric_part(n) for n in self.get_server_info().split(".")[:2]] )