[SCN REFACTOR] replace flash back snapshot and remove read snapshot session
This commit is contained in:
		| @ -530,6 +530,14 @@ bool ObOptParamHint::is_param_val_valid(const OptParamType param_type, const ObO | ||||
|       is_valid = val.is_int() && (0 <= val.get_int() && 65535 >= val.get_int()); | ||||
|       break; | ||||
|     } | ||||
|     case DDL_EXECUTION_ID: { | ||||
|       is_valid = val.is_int() && (0 < val.get_int()); | ||||
|       break; | ||||
|     } | ||||
|     case DDL_TASK_ID: { | ||||
|       is_valid = val.is_int() && (0 < val.get_int()); | ||||
|       break; | ||||
|     } | ||||
|     default: | ||||
|       LOG_TRACE("invalid opt param val", K(param_type), K(val)); | ||||
|       break; | ||||
| @ -645,6 +653,7 @@ ObItemType ObHint::get_hint_type(ObItemType type) | ||||
|     case T_NO_PULLUP_EXPR :       return T_PULLUP_EXPR; | ||||
|  | ||||
|     // optimize hint | ||||
|     case T_NO_USE_DAS_HINT:     return T_USE_DAS_HINT; | ||||
|     case T_ORDERED:             return T_LEADING; | ||||
|     case T_NO_USE_MERGE:        return T_USE_MERGE; | ||||
|     case T_NO_USE_HASH:         return T_USE_HASH; | ||||
| @ -700,6 +709,7 @@ const char* ObHint::get_hint_name(ObItemType type, bool is_enable_hint /* defaul | ||||
|     case T_INDEX_HINT:          return "INDEX"; | ||||
|     case T_FULL_HINT:           return "FULL"; | ||||
|     case T_NO_INDEX_HINT:       return "NO_INDEX"; | ||||
|     case T_USE_DAS_HINT:        return is_enable_hint ? "USE_DAS" : "NO_USE_DAS"; | ||||
|     case T_LEADING:             return is_enable_hint ? "LEADING" : "ORDERED"; | ||||
|     case T_USE_MERGE:           return is_enable_hint ? "USE_MERGE" : "NO_USE_MERGE"; | ||||
|     case T_USE_HASH:            return is_enable_hint ? "USE_HASH" : "NO_USE_HASH"; | ||||
| @ -1473,7 +1483,7 @@ int ObSemiToInnerHint::print_hint_desc(planText &plan_text) const | ||||
|     //do nothing | ||||
|   } else if (tables_.count() > 1 && OB_FAIL(BUF_PRINTF("("))) { | ||||
|     LOG_WARN("failed to print hint", K(ret)); | ||||
|   } else if (OB_FAIL(ObTableInHint::print_join_tables_in_hint(plan_text, tables_))) { | ||||
|   } else if (OB_FAIL(ObTableInHint::print_join_tables_in_hint(plan_text, tables_, true))) { | ||||
|     LOG_WARN("failed to print tables", K(ret)); | ||||
|   } else if (tables_.count() > 1 && OB_FAIL(BUF_PRINTF(")"))) { | ||||
|     LOG_WARN("failed to print hint", K(ret)); | ||||
| @ -1621,8 +1631,9 @@ int ObIndexHint::print_hint_desc(planText &plan_text) const | ||||
|   int64_t &pos = plan_text.pos; | ||||
|   if (OB_FAIL(table_.print_table_in_hint(plan_text))) { | ||||
|     LOG_WARN("fail to print table in hint", K(ret)); | ||||
|   } else if (T_FULL_HINT != hint_type_ && | ||||
|              OB_FAIL(BUF_PRINTF(" \"%.*s\"", index_name_.length(), index_name_.ptr()))) { | ||||
|   } else if (T_FULL_HINT == hint_type_ || T_USE_DAS_HINT == hint_type_) { | ||||
|     /* do nothing */ | ||||
|   } else if (OB_FAIL(BUF_PRINTF(" \"%.*s\"", index_name_.length(), index_name_.ptr()))) { | ||||
|     LOG_WARN("fail to print index name", K(ret)); | ||||
|   } | ||||
|   return ret; | ||||
| @ -1646,6 +1657,7 @@ int ObJoinHint::print_hint_desc(planText &plan_text) const | ||||
|   char *buf = plan_text.buf; | ||||
|   int64_t &buf_len = plan_text.buf_len; | ||||
|   int64_t &pos = plan_text.pos; | ||||
|   const char* algo_str = get_dist_algo_str(); | ||||
|   if (OB_UNLIKELY(tables_.empty())) { | ||||
|     ret = OB_ERR_UNEXPECTED; | ||||
|     LOG_WARN("unexpected join hint", K(ret)); | ||||
| @ -1655,7 +1667,8 @@ int ObJoinHint::print_hint_desc(planText &plan_text) const | ||||
|     LOG_WARN("failed to print join tables", K(ret)); | ||||
|   } else if (tables_.count() > 1 && OB_FAIL(BUF_PRINTF(")"))) { | ||||
|     LOG_WARN("failed to print hint", K(ret)); | ||||
|   } else if (T_PQ_DISTRIBUTE == hint_type_ && OB_FAIL(BUF_PRINTF(" %s", get_dist_algo_str()))) { | ||||
|   } else if (T_PQ_DISTRIBUTE == hint_type_ && NULL != algo_str | ||||
|              && OB_FAIL(BUF_PRINTF(" %s", get_dist_algo_str()))) { | ||||
|     LOG_WARN("failed to print dist algo", K(ret)); | ||||
|   } | ||||
|   return ret; | ||||
| @ -1740,6 +1753,7 @@ int ObJoinFilterHint::print_hint_desc(planText &plan_text) const | ||||
| int ObPQSetHint::assign(const ObPQSetHint &other) | ||||
| { | ||||
|   int ret = OB_SUCCESS; | ||||
|   left_branch_ = other.left_branch_; | ||||
|   if (OB_FAIL(dist_methods_.assign(other.dist_methods_))) { | ||||
|     LOG_WARN("fail to assign dist methods", K(ret)); | ||||
|   } else if (OB_FAIL(ObOptHint::assign(other))) { | ||||
| @ -1843,6 +1857,9 @@ int ObPQSetHint::print_hint_desc(planText &plan_text) const | ||||
|   if (OB_UNLIKELY(false == is_valid_dist_methods(dist_methods_))) { | ||||
|     ret = OB_ERR_UNEXPECTED; | ||||
|     LOG_WARN("unexpected pq set hint", K(ret)); | ||||
|   } else if (!left_branch_.empty() | ||||
|              && OB_FAIL(BUF_PRINTF(" \"%.*s\"", left_branch_.length(), left_branch_.ptr()))) { | ||||
|     LOG_WARN("failed to print left branch qb name", K(ret)); | ||||
|   } | ||||
|   for (int i = 0; OB_SUCC(ret) && i < dist_methods_.count(); ++i) { | ||||
|     if (OB_FAIL(BUF_PRINTF(" %s", get_dist_method_str(dist_methods_.at(i))))) { | ||||
| @ -1864,7 +1881,9 @@ DistAlgo ObPQSetHint::get_dist_algo(const ObIArray<ObItemType> &dist_methods, | ||||
| { | ||||
|   DistAlgo dist_algo = DistAlgo::DIST_INVALID_METHOD; | ||||
|   random_none_idx = OB_INVALID_INDEX; | ||||
|   if (dist_methods.count() < 2) { | ||||
|   if (dist_methods.empty()) { | ||||
|     dist_algo = DistAlgo::DIST_BASIC_METHOD; | ||||
|   } else if (dist_methods.count() < 2) { | ||||
|     /* do nothing */ | ||||
|   } else if (2 == dist_methods.count()) { | ||||
|     const ObItemType method1 = dist_methods.at(0); | ||||
| @ -2251,11 +2270,13 @@ bool ObTableInHint::is_match_table_items(ObCollationType cs_type, | ||||
|   return bret; | ||||
| } | ||||
|  | ||||
| void ObTableInHint::reset(const TableItem& table) | ||||
| void ObTableInHint::set_table(const TableItem& table) | ||||
| { | ||||
|   qb_name_.reset(); | ||||
|   db_name_.assign_ptr(table.database_name_.ptr(), table.database_name_.length()); | ||||
|   qb_name_.assign_ptr(table.qb_name_.ptr(), table.qb_name_.length()); | ||||
|   table_name_.assign_ptr(table.get_table_name().ptr(), table.get_table_name().length()); | ||||
|   if (table.is_basic_table()) { | ||||
|     db_name_.assign_ptr(table.database_name_.ptr(), table.database_name_.length()); | ||||
|   } | ||||
| } | ||||
|  | ||||
| const char *ObWindowDistHint::get_dist_algo_str(WinDistAlgo dist_algo) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 wangt1xiuyi
					wangt1xiuyi