fix mysqltest for subquery ambiguously error

This commit is contained in:
hy-guo
2023-10-07 08:40:04 +00:00
committed by ob-robot
parent 774cd1921e
commit e3e5039fd0

View File

@ -278,12 +278,8 @@ int ObColumnNamespaceChecker::check_column_exists(const TableItem &table_item, c
for (int64_t i = 0; OB_SUCC(ret) && i < ref_stmt->get_select_item_size(); ++i) {
SelectItem& tmp_select_item = ref_stmt->get_select_item(i);
if (ObCharset::case_compat_mode_equal(col_name, tmp_select_item.alias_name_)) {
unduplicable_count += ((tmp_select_item.expr_->is_column_ref_expr()
&& static_cast<ObColumnRefRawExpr *>(tmp_select_item.expr_)->is_joined_dup_column())
|| !(tmp_select_item.expr_->is_aggr_expr())) ? 0 : 1;
/* Unduplicable_count is use for column duplicated report in oracle mode.
* It seems only aggr funcs in PIVOT shoulds cause this error.
*/
unduplicable_count += (tmp_select_item.expr_->is_column_ref_expr()
&& !(static_cast<ObColumnRefRawExpr *>(tmp_select_item.expr_)->is_joined_dup_column())) ? 1 : 0;
if (!is_exist) {
// set the is_exist = true, is there is a column with the same column name.
// no matter the column is a duplicable column, we should set the exists to true.