Fix a bug when create view with having clause
This commit is contained in:
@ -792,7 +792,7 @@ int ObSelectStmtPrinter::print_having()
|
|||||||
if (having_exprs_size > 0) {
|
if (having_exprs_size > 0) {
|
||||||
DATA_PRINTF(" having ");
|
DATA_PRINTF(" having ");
|
||||||
for (int64_t i = 0; OB_SUCC(ret) && i < having_exprs_size; ++i) {
|
for (int64_t i = 0; OB_SUCC(ret) && i < having_exprs_size; ++i) {
|
||||||
if (OB_FAIL(expr_printer_.do_print(having_exprs.at(i), T_NONE_SCOPE))) {
|
if (OB_FAIL(expr_printer_.do_print(having_exprs.at(i), T_HAVING_SCOPE))) {
|
||||||
LOG_WARN("fail to print having expr", K(ret));
|
LOG_WARN("fail to print having expr", K(ret));
|
||||||
}
|
}
|
||||||
DATA_PRINTF(" and ");
|
DATA_PRINTF(" and ");
|
||||||
|
|||||||
@ -102,7 +102,8 @@ int ObRawExprPrinter::print(ObRawExpr *expr)
|
|||||||
&& scope_ != T_GROUP_SCOPE
|
&& scope_ != T_GROUP_SCOPE
|
||||||
&& scope_ != T_WHERE_SCOPE
|
&& scope_ != T_WHERE_SCOPE
|
||||||
&& scope_ != T_NONE_SCOPE
|
&& scope_ != T_NONE_SCOPE
|
||||||
&& scope_ != T_ORDER_SCOPE) {
|
&& scope_ != T_ORDER_SCOPE
|
||||||
|
&& (scope_ == T_HAVING_SCOPE && lib::is_mysql_mode())) {
|
||||||
//expr is a alias column ref
|
//expr is a alias column ref
|
||||||
//alias column target list
|
//alias column target list
|
||||||
PRINT_IDENT_WITH_QUOT(expr->get_alias_column_name());
|
PRINT_IDENT_WITH_QUOT(expr->get_alias_column_name());
|
||||||
|
|||||||
Reference in New Issue
Block a user