You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1][bug] SHOW CREATE can run on a different pooled connection than USE #290
DDL retrieval methods in SchemaInspector execute USE <database> and SHOW CREATE TABLE ... against the same backend but acquire pool connections independently between the two statements.
Problem
With pool_max > 1, the second statement is not guaranteed to run on the same session. If it doesn't, SHOW CREATE either fails with "no database selected" or returns DDL for the wrong default database. The intermediate USE error is also silently discarded (let _ = ...), hiding root cause.
Set pool_max=4 on a profile. Call get_table_ddl for users 10 times in a loop. Some calls return DDL for a different DB or fail with "no database selected".
Expected
DDL retrieval works consistently regardless of pool_max; the right DB is always inspected.
Proposed fix
Scope M. Either use fully qualified escaped identifiers in SHOW CREATE TABLE \db`.`table`, or acquire one MySqlConnection, run USEandSHOW CREATEon that same connection, propagating theUSE` error.
Acceptance
DDL retrieval works at any pool size, with no error being silently dropped.
Activity
fix(schema): one cache, keyed by connection, and DDL that names its d…
fix(schema): one cache, keyed by connection, and DDL that names its d…