[CP] fix oracle distinct to_char column order by column resolver bug.
This commit is contained in:
		| @ -944,6 +944,17 @@ int ObSelectResolver::check_order_by() | |||||||
|           ObRawExpr *expr = select_items.at(i).expr_; |           ObRawExpr *expr = select_items.at(i).expr_; | ||||||
|           if (OB_FAIL(select_item_exprs.push_back(expr))) { |           if (OB_FAIL(select_item_exprs.push_back(expr))) { | ||||||
|               LOG_WARN("fail to push back expr", K(ret)); |               LOG_WARN("fail to push back expr", K(ret)); | ||||||
|  |             // Support non-standard semantics in oracle | ||||||
|  |             // | ||||||
|  |           } else if (T_FUN_SYS_TO_CHAR == expr->get_expr_type() && expr->get_param_count() == 1) { | ||||||
|  |             if (OB_ISNULL(expr->get_param_expr(0))) { | ||||||
|  |               ret = OB_ERR_UNEXPECTED; | ||||||
|  |               LOG_WARN("to_char has no child expr", K(ret)); | ||||||
|  |             } else if (expr->get_param_expr(0)->get_result_type().is_number()) { | ||||||
|  |               if (OB_FAIL(select_item_exprs.push_back(expr->get_param_expr(0)))) { | ||||||
|  |                 LOG_WARN("fail to push back expr", K(ret)); | ||||||
|  |               } | ||||||
|  |             } | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
|         if (OB_SUCC(ret)) { |         if (OB_SUCC(ret)) { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 SevenJ-swj
					SevenJ-swj