fix some bugs
This commit is contained in:
@ -2175,7 +2175,7 @@ int ObRelationalExprOperator::deduce_cmp_type(const ObExprOperator &expr,
|
|||||||
} else if (ObRawType == cmp_type.get_calc_type()) {
|
} else if (ObRawType == cmp_type.get_calc_type()) {
|
||||||
type1.set_calc_collation_type(CS_TYPE_BINARY);
|
type1.set_calc_collation_type(CS_TYPE_BINARY);
|
||||||
type2.set_calc_collation_type(CS_TYPE_BINARY);
|
type2.set_calc_collation_type(CS_TYPE_BINARY);
|
||||||
} else if (is_mysql_mode() && ObDoubleType == cmp_type.get_calc_type()) {
|
} else if (is_mysql_mode() && ob_is_double_type(cmp_type.get_calc_type())) {
|
||||||
if (ob_is_numeric_tc(type1.get_type_class()) && ob_is_numeric_tc(type2.get_type_class()) &&
|
if (ob_is_numeric_tc(type1.get_type_class()) && ob_is_numeric_tc(type2.get_type_class()) &&
|
||||||
SCALE_UNKNOWN_YET != type1.get_scale() && SCALE_UNKNOWN_YET != type2.get_scale()) {
|
SCALE_UNKNOWN_YET != type1.get_scale() && SCALE_UNKNOWN_YET != type2.get_scale()) {
|
||||||
const ObScale scale = MAX(type1.get_scale(), type2.get_scale());
|
const ObScale scale = MAX(type1.get_scale(), type2.get_scale());
|
||||||
@ -3932,7 +3932,7 @@ int ObVectorExprOperator::calc_result_type2_(ObExprResType &type,
|
|||||||
} else if (ObRawType == cmp_type.get_calc_type()) {
|
} else if (ObRawType == cmp_type.get_calc_type()) {
|
||||||
type1.set_calc_collation_type(CS_TYPE_BINARY);
|
type1.set_calc_collation_type(CS_TYPE_BINARY);
|
||||||
type2.set_calc_collation_type(CS_TYPE_BINARY);
|
type2.set_calc_collation_type(CS_TYPE_BINARY);
|
||||||
} else if (is_mysql_mode() && ObDoubleType == cmp_type.get_calc_type()) {
|
} else if (is_mysql_mode() && ob_is_double_tc(cmp_type.get_calc_type())) {
|
||||||
if (ob_is_numeric_tc(type1.get_type_class()) && ob_is_numeric_tc(type2.get_type_class()) &&
|
if (ob_is_numeric_tc(type1.get_type_class()) && ob_is_numeric_tc(type2.get_type_class()) &&
|
||||||
SCALE_UNKNOWN_YET != type1.get_scale() && SCALE_UNKNOWN_YET != type2.get_scale()) {
|
SCALE_UNKNOWN_YET != type1.get_scale() && SCALE_UNKNOWN_YET != type2.get_scale()) {
|
||||||
const ObScale scale = MAX(type1.get_scale(), type2.get_scale());
|
const ObScale scale = MAX(type1.get_scale(), type2.get_scale());
|
||||||
|
|||||||
@ -340,6 +340,14 @@ int ObLogSet::compute_sharding_info()
|
|||||||
is_partition_wise_ = false;
|
is_partition_wise_ = false;
|
||||||
strong_sharding_ = second_child->get_strong_sharding();
|
strong_sharding_ = second_child->get_strong_sharding();
|
||||||
inherit_sharding_index_ = ObLogicalOperator::second_child;
|
inherit_sharding_index_ = ObLogicalOperator::second_child;
|
||||||
|
} else if (DistAlgo::DIST_PARTITION_NONE == set_dist_algo_) {
|
||||||
|
is_partition_wise_ = false;
|
||||||
|
strong_sharding_ = second_child->get_strong_sharding();
|
||||||
|
inherit_sharding_index_ = ObLogicalOperator::second_child;
|
||||||
|
} else if (DistAlgo::DIST_NONE_PARTITION == set_dist_algo_) {
|
||||||
|
is_partition_wise_ = false;
|
||||||
|
strong_sharding_ = first_child->get_strong_sharding();
|
||||||
|
inherit_sharding_index_ = ObLogicalOperator::first_child;
|
||||||
} else if (OB_FAIL(ObLogicalOperator::compute_sharding_info())) {
|
} else if (OB_FAIL(ObLogicalOperator::compute_sharding_info())) {
|
||||||
LOG_WARN("failed to compute sharding info", K(ret));
|
LOG_WARN("failed to compute sharding info", K(ret));
|
||||||
} else { /*do nothing*/ }
|
} else { /*do nothing*/ }
|
||||||
|
|||||||
@ -344,6 +344,8 @@ int ObTransformGroupByPullup::check_groupby_pullup_validity(ObDMLStmt *stmt,
|
|||||||
JoinedTable *joined_table = static_cast<JoinedTable*>(table);
|
JoinedTable *joined_table = static_cast<JoinedTable*>(table);
|
||||||
PullupHelper left_helper = helper;
|
PullupHelper left_helper = helper;
|
||||||
PullupHelper right_helper = helper;
|
PullupHelper right_helper = helper;
|
||||||
|
bool check_left = true;
|
||||||
|
bool check_right = true;
|
||||||
left_helper.parent_table_ = joined_table;
|
left_helper.parent_table_ = joined_table;
|
||||||
right_helper.parent_table_ = joined_table;
|
right_helper.parent_table_ = joined_table;
|
||||||
if (LEFT_OUTER_JOIN == joined_table->joined_type_) {
|
if (LEFT_OUTER_JOIN == joined_table->joined_type_) {
|
||||||
@ -351,10 +353,12 @@ int ObTransformGroupByPullup::check_groupby_pullup_validity(ObDMLStmt *stmt,
|
|||||||
//LEFT OUTER JOIN的右表上拉group by要求不能有having条件
|
//LEFT OUTER JOIN的右表上拉group by要求不能有having条件
|
||||||
right_helper.need_check_having_ = true;
|
right_helper.need_check_having_ = true;
|
||||||
right_helper.need_check_null_propagate_ = true;
|
right_helper.need_check_null_propagate_ = true;
|
||||||
|
check_left = false;
|
||||||
} else if (RIGHT_OUTER_JOIN == joined_table->joined_type_) {
|
} else if (RIGHT_OUTER_JOIN == joined_table->joined_type_) {
|
||||||
//RIGHT OUTER JOIN的左表上拉group by要求不能有having条件
|
//RIGHT OUTER JOIN的左表上拉group by要求不能有having条件
|
||||||
left_helper.need_check_having_ = true;
|
left_helper.need_check_having_ = true;
|
||||||
left_helper.need_check_null_propagate_ = true;
|
left_helper.need_check_null_propagate_ = true;
|
||||||
|
check_right = false;
|
||||||
//LEFT OUTER JOIN的右表行为跟parent table相同
|
//LEFT OUTER JOIN的右表行为跟parent table相同
|
||||||
} else if (INNER_JOIN == joined_table->joined_type_) {
|
} else if (INNER_JOIN == joined_table->joined_type_) {
|
||||||
//INNER JOIN的左表行为跟parent table相同
|
//INNER JOIN的左表行为跟parent table相同
|
||||||
@ -369,6 +373,8 @@ int ObTransformGroupByPullup::check_groupby_pullup_validity(ObDMLStmt *stmt,
|
|||||||
//full join要求两侧至少有一个basic table,否则不能保证能够生成严格唯一键
|
//full join要求两侧至少有一个basic table,否则不能保证能够生成严格唯一键
|
||||||
is_valid = false;
|
is_valid = false;
|
||||||
} else {
|
} else {
|
||||||
|
check_left = false;
|
||||||
|
check_right = false;
|
||||||
left_helper.need_check_having_ = true;
|
left_helper.need_check_having_ = true;
|
||||||
left_helper.need_check_null_propagate_ = true;
|
left_helper.need_check_null_propagate_ = true;
|
||||||
right_helper.need_check_having_ = true;
|
right_helper.need_check_having_ = true;
|
||||||
@ -379,7 +385,8 @@ int ObTransformGroupByPullup::check_groupby_pullup_validity(ObDMLStmt *stmt,
|
|||||||
//do nothing
|
//do nothing
|
||||||
} else if (!is_valid) {
|
} else if (!is_valid) {
|
||||||
//do nothing
|
//do nothing
|
||||||
} else if (OB_FAIL(SMART_CALL(check_groupby_pullup_validity(stmt,
|
} else if (check_left &&
|
||||||
|
OB_FAIL(SMART_CALL(check_groupby_pullup_validity(stmt,
|
||||||
joined_table->left_table_,
|
joined_table->left_table_,
|
||||||
left_helper,
|
left_helper,
|
||||||
contain_inner_table,
|
contain_inner_table,
|
||||||
@ -387,7 +394,8 @@ int ObTransformGroupByPullup::check_groupby_pullup_validity(ObDMLStmt *stmt,
|
|||||||
valid_views,
|
valid_views,
|
||||||
is_valid)))) {
|
is_valid)))) {
|
||||||
LOG_WARN("failed to check group by pull up validity", K(ret));
|
LOG_WARN("failed to check group by pull up validity", K(ret));
|
||||||
} else if (OB_FAIL(SMART_CALL(check_groupby_pullup_validity(stmt,
|
} else if (check_right &&
|
||||||
|
OB_FAIL(SMART_CALL(check_groupby_pullup_validity(stmt,
|
||||||
joined_table->right_table_,
|
joined_table->right_table_,
|
||||||
right_helper,
|
right_helper,
|
||||||
contain_inner_table,
|
contain_inner_table,
|
||||||
|
|||||||
Reference in New Issue
Block a user