typeCheckSubqueryWithIn checks the case where the right side of an IN expression is a subquery.
(left, right *types.T)
| 1815 | // typeCheckSubqueryWithIn checks the case where the right side of an IN |
| 1816 | // expression is a subquery. |
| 1817 | func typeCheckSubqueryWithIn(left, right *types.T) error { |
| 1818 | if right.Family() == types.TupleFamily { |
| 1819 | // Subqueries come through as a tuple{T}, so T IN tuple{T} should be |
| 1820 | // accepted. |
| 1821 | if len(right.TupleContents()) != 1 { |
| 1822 | return pgerror.Newf(pgcode.InvalidParameterValue, |
| 1823 | unsupportedCompErrFmt, fmt.Sprintf(compSignatureFmt, left, In, right)) |
| 1824 | } |
| 1825 | if !left.EquivalentOrNull(right.TupleContents()[0]) { |
| 1826 | return pgerror.Newf(pgcode.InvalidParameterValue, |
| 1827 | unsupportedCompErrFmt, fmt.Sprintf(compSignatureFmt, left, In, right)) |
| 1828 | } |
| 1829 | } |
| 1830 | return nil |
| 1831 | } |
| 1832 | |
| 1833 | func typeCheckComparisonOp( |
| 1834 | ctx context.Context, semaCtx *SemaContext, op ComparisonOperator, left, right Expr, |
no test coverage detected