@@ -64,7 +64,7 @@ class DialectCode(Enum):
6464 MYSQL = "mysql"
6565
6666 MULTI_AZ_CLUSTER_PG = "multi-az-pg"
67- GLOBAL_AURORA_PG = "aurora-pg"
67+ GLOBAL_AURORA_PG = "global- aurora-pg"
6868 AURORA_PG = "aurora-pg"
6969 RDS_PG = "rds-pg"
7070 PG = "pg"
@@ -547,7 +547,7 @@ class GlobalAuroraMysqlDialect(AuroraMysqlDialect, GlobalAuroraTopologyDialect):
547547 "FROM information_schema.aurora_global_db_instance_status " )
548548 _REGION_COUNT_QUERY = "SELECT count(1) FROM information_schema.aurora_global_db_status"
549549 _REGION_BY_INSTANCE_ID_QUERY = \
550- "SELECT AWS_REGION FROM information_schema.aurora_global_db_instance_status WHERE SERVER_ID = ? "
550+ "SELECT AWS_REGION FROM information_schema.aurora_global_db_instance_status WHERE SERVER_ID = %s "
551551
552552 @property
553553 def dialect_update_candidates (self ) -> Optional [Tuple [DialectCode , ...]]:
@@ -564,10 +564,10 @@ def is_dialect(self, conn: Connection, driver_dialect: DriverDialect) -> bool:
564564 with closing (conn .cursor ()) as cursor :
565565 cursor .execute (self ._REGION_COUNT_QUERY )
566566 record = cursor .fetchone ()
567- if record is None or len (record ) < 2 :
567+ if record is None or len (record ) < 1 :
568568 return False
569569
570- aws_region_count = record [1 ]
570+ aws_region_count = record [0 ]
571571 return aws_region_count is not None and aws_region_count > 1
572572 except Exception :
573573 if not initial_transaction_status and driver_dialect .is_in_transaction (conn ):
@@ -592,7 +592,7 @@ class GlobalAuroraPgDialect(AuroraPgDialect, GlobalAuroraTopologyDialect):
592592 "FROM aurora_global_db_instance_status()" )
593593 _REGION_COUNT_QUERY = "SELECT count(1) FROM aurora_global_db_status()"
594594 _REGION_BY_INSTANCE_ID_QUERY = \
595- "SELECT AWS_REGION FROM aurora_global_db_instance_status() WHERE SERVER_ID = ? "
595+ "SELECT AWS_REGION FROM aurora_global_db_instance_status() WHERE SERVER_ID = %s "
596596
597597 @property
598598 def dialect_update_candidates (self ) -> Optional [Tuple [DialectCode , ...]]:
@@ -620,10 +620,10 @@ def is_dialect(self, conn: Connection, driver_dialect: DriverDialect) -> bool:
620620 with closing (conn .cursor ()) as cursor :
621621 cursor .execute (self ._REGION_COUNT_QUERY )
622622 record = cursor .fetchone ()
623- if record is None or len (record ) < 2 :
623+ if record is None or len (record ) < 1 :
624624 return False
625625
626- aws_region_count = record [1 ]
626+ aws_region_count = record [0 ]
627627 return aws_region_count is not None and aws_region_count > 1
628628
629629 except Exception :
0 commit comments