Lazy expression not enclosed in braces
Bug #903777 reported by
Gavin Panella
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Undecided
|
Unassigned |
Bug Description
An assignment like:
person.toy_count = Select(
results in SQL (for PostgreSQL) like:
UPDATE Person SET toy_count = SELECT COUNT(Toy.id) FROM Toy ... ;
Note the absence of braces around the SELECT. This is rejected by PostgreSQL.
The following is a useful workaround:
person.toy_count = Union(Select(...))
but it smells a bit.
To post a comment you must log in.
This is probably just a problem with the precedence in the expression compiler rather than just being related to arbitrary lazy expressions.
The extra parentheses in your workaround probably come from the interaction of the Union() and Select() rather than the Update() and Union().