set the initial value of wrs to scn min

This commit is contained in:
obdev
2022-11-28 02:55:06 +00:00
committed by ob-robot
parent 99d4f56fec
commit 87a9357186
406 changed files with 6473 additions and 50308 deletions

View File

@ -754,26 +754,29 @@ int ObLogJoin::print_join_tables_in_hint(const ObDMLStmt &stmt,
char *buf = plan_text.buf;
int64_t &buf_len = plan_text.buf_len;
int64_t &pos = plan_text.pos;
ObSEArray<int64_t, 8> idx_arr;
bool multi_table = table_set.num_members() > 1;
if (OB_ISNULL(get_plan())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected null", K(ret), K(get_plan()));
} else if (OB_FAIL(table_set.to_array(idx_arr))) {
LOG_WARN("failed to array", K(ret));
} else if (idx_arr.count() > 1 && OB_FAIL(BUF_PRINTF("("))) {
} else if (multi_table && OB_FAIL(BUF_PRINTF("("))) {
} else {
bool is_first_table = true;
const ObIArray<TableItem*> &table_items = stmt.get_table_items();
for (int64_t i = 0; OB_SUCC(ret) && i < idx_arr.count(); ++i) {
const int64_t idx = idx_arr.at(i);
if (OB_UNLIKELY(idx <= 0 || idx > table_items.count())) {
const TableItem *table = NULL;
for (int64_t i = 0; OB_SUCC(ret) && i < table_items.count(); ++i) {
if (OB_ISNULL(table = table_items.at(i))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected idx/table", K(ret), K(idx), K(table_items.count()));
} else if (0 != i && OB_FAIL(BUF_PRINTF(" "))) {
} else if (OB_FAIL(get_plan()->print_outline_table(plan_text, table_items.at(idx - 1)))) {
LOG_WARN("unexpected null", K(ret), K(table));
} else if (!table_set.has_member(stmt.get_table_bit_index(table->table_id_))) {
/* do nothing */
} else if (!is_first_table && OB_FAIL(BUF_PRINTF(" "))) {
} else if (OB_FAIL(get_plan()->print_outline_table(plan_text, table))) {
LOG_WARN("fail to print join table", K(ret));
} else {
is_first_table = false;
}
}
if (OB_SUCC(ret) && idx_arr.count() > 1 && OB_FAIL(BUF_PRINTF(")"))) {
if (OB_SUCC(ret) && multi_table && OB_FAIL(BUF_PRINTF(")"))) {
} else { /* do nothing */ }
}
return ret;