Skip to content

Commit 3ead609

Browse files
committed
fix: improve OpenGauss detection to correctly disable UNLISTEN
The previous detection logic was insufficient for standard OpenGauss environments (e.g., A-compatibility or default modes) as it relied on keys like 'sql_mode' which may not exist. Changes: 1. Updated `_detect_server_capabilities` to identify GaussDB/OpenGauss using the core parameter `session_respool`.
1 parent 9df3367 commit 3ead609

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

async_gaussdb/connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2647,6 +2647,8 @@ class _ConnectionProxy:
26472647

26482648

26492649
def _detect_server_capabilities(server_version, connection_settings):
2650+
print(connection_settings)
2651+
print(server_version)
26502652
if hasattr(connection_settings, 'padb_revision'):
26512653
# Amazon Redshift detected.
26522654
advisory_locks = False
@@ -2674,7 +2676,7 @@ def _detect_server_capabilities(server_version, connection_settings):
26742676
sql_close_all = False
26752677
jit = False
26762678
sql_copy_from_where = False
2677-
elif hasattr(connection_settings, 'sql_mode'):
2679+
elif hasattr(connection_settings, 'sql_mode') or hasattr(connection_settings, 'session_respool'):
26782680
# Standard GaussDBSQL serve
26792681
advisory_locks = True
26802682
notifications = False

0 commit comments

Comments
 (0)