Complete
Details
Details
Assignee
Vladimir Vinogradenko
Vladimir VinogradenkoReporter
Bug Clerk
Bug ClerkLabels
Time remaining
0m
Components
Fix versions
Priority
Katalon Platform
Katalon Platform
Created January 15, 2022 at 12:04 AM
Updated August 19, 2022 at 1:00 PM
Resolved January 19, 2022 at 3:36 PM
PR: https://github.com/truenas/middleware/pull/8139
SQLAlchemy includes a variant on a bound parameter known as `BindParameter.expanding`,
which is a “late evaluated” parameter that is rendered in an intermediary state when
a SQL construct is compiled, which is then further processed at statement execution
time when the actual known values are passed. “Expanding” parameters are used for
`ColumnOperators.in_()` expressions by default so that the SQL string can be safely
cached independently of the actual lists of values being passed to a particular
invocation of `ColumnOperators.in_()`.
We need to render the `IN` clause with real bound parameter symbols as we store these
statements in HA database journal and execute them in a lower-level connection that
does not support these SQLAlchemy substitutions.