fix values table print bug

This commit is contained in:
JinmaoLi
2024-11-06 06:47:22 +00:00
committed by ob-robot
parent 8308c30def
commit b51b21995c

View File

@ -525,7 +525,8 @@ int ObDMLStmtPrinter::print_values_table(const TableItem &table_item, bool no_pr
LOG_WARN("values table def should not be NULL", K(ret), KP(table_def));
} else {
const int64_t column_cnt = table_def->column_cnt_;
const int64_t row_cnt = table_def->row_cnt_;
if (ObValuesTableDef::ACCESS_EXPR == table_def->access_type_ ||
ObValuesTableDef::FOLD_ACCESS_EXPR == table_def->access_type_) {
const ObIArray<ObRawExpr *> &values = table_def->access_exprs_;
if (OB_UNLIKELY(column_cnt <= 0 || values.empty() || values.count() % column_cnt != 0)) {
ret = OB_ERR_UNEXPECTED;
@ -550,6 +551,9 @@ int ObDMLStmtPrinter::print_values_table(const TableItem &table_item, bool no_pr
DATA_PRINTF("))");
DATA_PRINTF(" %.*s", LEN_AND_PTR(table_item.alias_name_));
}
} else {
DATA_PRINTF("%.*s", LEN_AND_PTR(table_item.get_table_name()));
}
}
return ret;
}