[CP] Fix wrong merge type between set and char

Co-authored-by: Larry955 <1412857955@qq.com>
This commit is contained in:
hezuojiao
2023-12-26 10:13:15 +00:00
committed by ob-robot
parent dd3a7f44f9
commit d52d2c12e6
2 changed files with 18 additions and 3 deletions

View File

@ -1299,7 +1299,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObLongTextType, /* CharType=>ObLongTextType */
ObVarcharType, /* CharType=>ObBitType */
ObVarcharType, /* CharType=>ObEnumType */
ObCharType, /* CharType=>ObSetType */
ObVarcharType, /* CharType=>ObSetType */
ObMaxType, /* CharType=>ObEnumInnerType */
ObMaxType, /* CharType=>ObSetInnerType */
ObCharType, /*CharType=>ObTimestampTZType */
@ -1834,7 +1834,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObVarcharType, /*ObSetType=>TimeType */
ObVarcharType, /*ObSetType=>YearType */
ObVarcharType, /*ObSetType=>VarcharType */
ObCharType, /*ObSetType=>CharType */
ObVarcharType, /*ObSetType=>CharType */
ObVarcharType, /*ObSetType=>HexStringType */
ObMaxType, /*ObSetType=>ExtendType */
ObVarcharType, /*ObSetType=>UnknownType */

View File

@ -175,7 +175,20 @@ int ObRawExprWrapEnumSet::analyze_all_expr(ObDMLStmt &stmt)
LOG_WARN("get relation exprs failed", K(ret));
} else if (OB_FAIL(stmt.get_child_stmts(child_stmts))) {
LOG_WARN("get child stmt failed", K(ret));
} else {/*do nothing*/}
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < stmt.get_table_size(); ++i) {
const TableItem *table_item = stmt.get_table_item(i);
if (OB_ISNULL(table_item)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("table_item is null", K(i));
} else if (table_item->is_temp_table()) {
if (OB_FAIL(child_stmts.push_back(table_item->ref_query_))) {
LOG_WARN("store child stmt failed", K(ret));
}
}
}
}
for (int64_t i = 0; OB_SUCC(ret) && i < relation_exprs.count(); ++i) {
if (OB_FAIL(analyze_expr(relation_exprs.at(i)))) {
LOG_WARN("failed to analyze expr", K(ret));
@ -618,6 +631,7 @@ int ObRawExprWrapEnumSet::visit_right_expr(ObRawExpr &right_expr, int64_t row_di
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("should not come here", K(right_expr), K(ret));
}
LOG_TRACE("succeed to visit right expr", K(root_type), K(row_dimension), K(right_expr));
return ret;
}
@ -777,6 +791,7 @@ bool ObRawExprWrapEnumSet::can_wrap_type_to_str(const ObRawExpr &expr) const
}
}
}
LOG_TRACE("succeed to check can wrap type to str", K(bret), K(expr));
return bret;
}