Skip to content

[Bug] HostPermissionStore uses Postgres-only OnConflictDoUpdate — fails to compile on MySQL #2358

Description

@dgokeeffe

Summary

tests/stores/test_host_permission_store.py fails on MySQL (6 tests):

sqlalchemy.exc.UnsupportedCompilationError: Compiler MySQLCompiler_mysqldb
can't render element of type <class 'sqlalchemy.dialects.postgresql.dml.OnConflictDoUpdate'>

HostPermissionStore (the grant upsert) uses PostgreSQL-specific postgresql.dml.insert(...).on_conflict_do_update(...), which MySQL cannot compile. So HostPermissionStore is Postgres-only and every test in the MySQL matrix shard fails.

Impact

Pytest (stores-mysql) CI shard is red; host-permission grants would not work on a MySQL-backed deployment.

Fix

Use a dialect-aware upsert (branch on bind.dialect.name, using mysql.insert(...).on_duplicate_key_update(...) for MySQL) or a portable select-then-insert/update, matching how other stores handle cross-dialect upserts.

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingP1-highPriority: major feature broken, no workaroundcomp:serverComponent: server, API, session managementtriagedIssue has been triaged by the bot

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions