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
The following issue is a repost of SeaQL/sea-orm#1527, since this issue actually belongs here.
I've also encountered the bug with gte : `"operator does not exist: some_enum >= text".
Description
.is_in(...) and .is_not_in(...) don't use CAST when comparing enums.
gte as well and other operators I guess.
Steps to Reproduce
Create a table in Postgres, that has a field with custom type as enum.
Make a query to that table, having a condition of this enum field IN vector.
Expected Behavior
The same as with .eq, .ne operators. Resulting query should look something like this.
-- For .eq operator, it generates correctlyWHERE"table"."enum_field"= CAST($1AS enum_type)
-- For .is_in operator, it generates a different query without CASTWHERE"table"."enum_field"IN (CAST($1AS enum_type), CAST($2AS enum_type))
Actual Behavior
Generated query looks something like this
WHERE"table"."enum_field"IN ($1, $2)
PgDatabaseError is returned.
{severity: Error, code: "42883", message: "operator does not exist: enum_type <> text", ...}
Reproduces How Often
Always, I assume. But the bug was spoted when in subquery.
Description
.is_in(...)
and.is_not_in(...)
don't use CAST when comparing enums.Steps to Reproduce
Expected Behavior
The same as with
.eq
,.ne
operators. Resulting query should look something like this.Actual Behavior
Generated query looks something like this
PgDatabaseError
is returned.Reproduces How Often
Always, I assume. But the bug was spoted when in subquery.
Versions
sea-orm v0.11.0
postgres
macos Ventura
Additional Information
cc @0xAndoroid
The text was updated successfully, but these errors were encountered: