Add a rule to force use das if has variable assignments in sql

This commit is contained in:
obdev
2023-09-13 13:21:37 +00:00
committed by ob-robot
parent 0d35739e39
commit c8c222deaa
4 changed files with 14 additions and 0 deletions

View File

@ -1766,6 +1766,11 @@ int ObSelectResolver::resolve_order_item(const ParseNode &sort_node, OrderItem &
LOG_WARN("ORDER BY item must be the number of a SELECT-list expression", K(ret));
}
}
if (OB_SUCC(ret) && OB_NOT_NULL(order_item.expr_) && order_item.expr_->has_flag(CNT_ASSIGN_EXPR)) {
ret = OB_NOT_SUPPORTED;
LOG_WARN("Not supported variable assignment in order by item", K(ret));
LOG_USER_ERROR(OB_NOT_SUPPORTED, "Variable assignment in order by item");
}
return ret;
}