- attached patch
sqlalchemy core: using scalarselect in "with_only_columns"
I may have found a bug when using a scalar_select in the with_only_columns expression from an enclosing select.
The problem is, a special case for scalar selects try to evaluates them in a boolean context, which is not defined for scalars.
Please see the attached test case, alongside with the proposed patch.
Sorry if this issue has already been reported, but I could not find it.
Thank you.
Comments (5)
-
Account Deleted -
Account Deleted - attached testcase.py
Test case
-
repo owner yes that's totally a bug, this is for 0.6.9/0.7.3. I apologize for the usage of "x AND y or Z" - up until 0.7 we've supported Python 2.4 which doesn't have "X if Y else Z" syntax. SQLA 0.8 will move up to Python 2.5. Thanks for the patch !
-
repo owner - changed status to resolved
Despite committing the fix to 0.6, 0.6 renders the wrong FROM clause anyway, and I'm not about to tinker with those mechanics for 0.6. good for 0.7 though.
9d775a4cd4b8f66baa0f0256059fd547894f0813 de5aaa27f20cdf56fc071e09e23027bdf5489ea4
-
repo owner - removed milestone
Removing milestone: 0.6.9 (automated comment)
- Log in to comment
Proposed patch