diff --git a/src/sql/engine/expr/ob_expr_make_set.cpp b/src/sql/engine/expr/ob_expr_make_set.cpp index b5cd3435db..67e9f00461 100644 --- a/src/sql/engine/expr/ob_expr_make_set.cpp +++ b/src/sql/engine/expr/ob_expr_make_set.cpp @@ -44,6 +44,7 @@ int ObExprMakeSet::calc_result_typeN(ObExprResType &type, } else { // set expected type of parameter ObLength max_len = 0; + type_ctx.set_cast_mode(type_ctx.get_cast_mode() | CM_STRING_INTEGER_TRUNC); types[0].set_calc_type(ObIntType); for (int64_t i = 1; i < param_num; ++i) { types[i].set_calc_type(ObVarcharType); diff --git a/src/sql/engine/expr/ob_expr_oracle_decode.cpp b/src/sql/engine/expr/ob_expr_oracle_decode.cpp index 534f18a721..269598fd2c 100644 --- a/src/sql/engine/expr/ob_expr_oracle_decode.cpp +++ b/src/sql/engine/expr/ob_expr_oracle_decode.cpp @@ -300,13 +300,37 @@ int ObExprOracleDecode::calc_result_typeN(ObExprResType &type, //deduce string length if (ob_is_string_type(type.get_type()) || ob_is_raw(type.get_type())) { ObLength len = -1; - for (int64_t i = 2; i < param_num; i += 2 /*skip conditions */) { - if (types_stack[i].get_length() > len) { - len = types_stack[i].get_length(); + if (is_oracle_mode() && (ob_is_string_tc(type.get_type()) || ob_is_raw(type.get_type()))) { + ObLength deduced_len = -1; + if (OB_ISNULL(type_ctx.get_session())) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("session is NULL", K(ret)); + } + for (int64_t i = 2; OB_SUCC(ret) && i < param_num; i += 2 /*skip conditions */) { + if (OB_FAIL(ObExprResultTypeUtil::deduce_max_string_length_oracle(type_ctx.get_session()->get_dtc_params(), + types_stack[i], type, deduced_len, type.get_length_semantics()))) { + LOG_WARN("fail to deduce max string length", K(ret)); + } else if (deduced_len > len) { + len = deduced_len; + } + } + if (OB_SUCC(ret) && has_default) { + if (OB_FAIL(ObExprResultTypeUtil::deduce_max_string_length_oracle(type_ctx.get_session()->get_dtc_params(), + types_stack[param_num - 1], type, deduced_len, type.get_length_semantics()))) { + LOG_WARN("fail to deduce max string length", K(ret)); + } else if (deduced_len > len) { + len = deduced_len; + } + } + } else { + for (int64_t i = 2; i < param_num; i += 2 /*skip conditions */) { + if (types_stack[i].get_length() > len) { + len = types_stack[i].get_length(); + } + } + if (has_default) { + len = static_cast(MAX(types_stack[param_num - 1].get_length(), len)); } - } - if (has_default) { - len = static_cast(MAX(types_stack[param_num - 1].get_length(), len)); } if (all_literal && lib::is_oracle_mode()) { if (OB_FAIL(calc_result_type_for_literal(type, types_stack, param_num, type_ctx))) { diff --git a/src/sql/engine/expr/ob_expr_result_type_util.cpp b/src/sql/engine/expr/ob_expr_result_type_util.cpp index 9ca811f8c9..c2d717e2a0 100644 --- a/src/sql/engine/expr/ob_expr_result_type_util.cpp +++ b/src/sql/engine/expr/ob_expr_result_type_util.cpp @@ -653,7 +653,7 @@ int ObExprResultTypeUtil::get_arith_calc_type(ObObjType &calc_type, int CHECK_STRING_RES_TYPE_ORACLE(const ObExprResType &type) { int ret = OB_SUCCESS; - if (!type.is_string_or_lob_locator_type()) { + if (!type.is_string_or_lob_locator_type() && !type.is_raw()) { ret = OB_INVALID_ARGUMENT; LOG_WARN("incorrect type of target type", K(ret), K(type)); } else if (type.is_blob() || type.is_blob_locator()) { @@ -663,7 +663,7 @@ int CHECK_STRING_RES_TYPE_ORACLE(const ObExprResType &type) } else if (!ObCharset::is_valid_collation(type.get_collation_type())) { ret = OB_INVALID_ARGUMENT; LOG_WARN("incorrect charset of target type", K(ret), K(type)); - } else if (!type.is_clob() && !type.is_clob_locator() && + } else if (!type.is_clob() && !type.is_clob_locator() && !type.is_raw() && LS_CHAR != type.get_length_semantics() && LS_BYTE != type.get_length_semantics()) { ret = OB_INVALID_ARGUMENT; LOG_WARN("incorrect length_semantics of target type", K(ret), K(type)); @@ -693,6 +693,8 @@ int ObExprResultTypeUtil::deduce_max_string_length_oracle(const ObDataTypeCastPa ObLengthSemantics length_semantics = target_type.get_length_semantics(); if (target_type.is_varchar_or_char() && (LS_BYTE == calc_ls || LS_CHAR == calc_ls)) { length_semantics = calc_ls; + } else if (target_type.is_raw()) { + length_semantics = LS_BYTE; } if (OB_FAIL(CHECK_STRING_RES_TYPE_ORACLE(target_type))) { LOG_WARN("invalid target_type", K(ret)); @@ -736,6 +738,9 @@ int ObExprResultTypeUtil::deduce_max_string_length_oracle(const ObDataTypeCastPa // clob to LS_CHAR int64_t mbminlen = ObCharset::get_charset(target_type.get_collation_type())->mbminlen; length = OB_MAX_ORACLE_VARCHAR_LENGTH / mbminlen; + } else if (target_type.is_raw()) { + //cast not support, return max length + length = OB_MAX_ORACLE_RAW_PL_VAR_LENGTH; } else { // clob to LS_BYTE length = OB_MAX_ORACLE_VARCHAR_LENGTH; @@ -750,6 +755,12 @@ int ObExprResultTypeUtil::deduce_max_string_length_oracle(const ObDataTypeCastPa } length *= ObCharset::MAX_MB_LEN; length /= ObCharset::get_charset(target_type.get_collation_type())->mbminlen; + } else if ((orig_type.is_varchar_or_char() || orig_type.is_nstring()) + && target_type.is_raw()) { + if (LS_CHAR == orig_type.get_length_semantics()) { + length *= ObCharset::get_charset(orig_type.get_collation_type())->mbmaxlen; + } + length = (length + 1) / 2; } else if (LS_CHAR == orig_type.get_length_semantics() && LS_BYTE == length_semantics) { // LS_CHAR to LS_BYTE @@ -790,7 +801,14 @@ int ObExprResultTypeUtil::deduce_max_string_length_oracle(const ObDataTypeCastPa ascii_bytes = orig_type.get_length(); } if (OB_SUCC(ret)) { - if (LS_BYTE == length_semantics && + if (target_type.is_raw()) { + if (orig_type.is_raw() || orig_type.is_json()) { + length = orig_type.get_length(); + } else { + //cast not support, return max length + length = OB_MAX_ORACLE_RAW_PL_VAR_LENGTH; + } + } else if (LS_BYTE == length_semantics && ObCharset::is_cs_nonascii(target_type.get_collation_type())) { length = (ObLength)(ascii_bytes * ObCharset::get_charset(target_type.get_collation_type())->mbminlen); diff --git a/src/sql/engine/expr/ob_expr_substring_index.cpp b/src/sql/engine/expr/ob_expr_substring_index.cpp index 126667b154..0960a6e177 100644 --- a/src/sql/engine/expr/ob_expr_substring_index.cpp +++ b/src/sql/engine/expr/ob_expr_substring_index.cpp @@ -135,9 +135,9 @@ int ObExprSubstringIndex::eval_substring_index( expr_datum.len_ = 0; } else { const ObString m_delim = delim.get_string(); - // Static cast count to int32, compatible with mysql 5.6, + // mysql 5.6 static cast count to int32, // actually this is a bug and fixed in mysql 8.0. - int32_t count_val = static_cast(count.get_int()); + int64_t count_val = count.get_int(); ObString res_str; ObExprKMPSearchCtx *kmp_ctx = NULL; const uint64_t op_id = static_cast(expr.expr_ctx_id_); @@ -180,14 +180,14 @@ int ObExprSubstringIndex::eval_substring_index_batch(const ObExpr &expr, continue;; } ObString res_str; - int32_t count_val = 0; + int64_t count_val = 0; ObDatum &text = expr.args_[0]->locate_expr_datum(ctx, i); ObDatum &delim = expr.args_[1]->locate_expr_datum(ctx, i); ObDatum &count = expr.args_[2]->locate_expr_datum(ctx, i); if (OB_UNLIKELY(text.is_null() || delim.is_null() || count.is_null())) { res[i].set_null(); } else if (0 == text.len_ || 0 == delim.len_ || - 0 == (count_val = static_cast(count.get_int()))) { + 0 == (count_val = count.get_int())) { // return empty string if %str or %delim is empty. //重置null flag 防止丢失空串信息 res[i].null_ = 0; diff --git a/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/expr_str.result b/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/expr_str.result index 7fe2e4f460..7c8aa55c91 100644 --- a/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/expr_str.result +++ b/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/expr_str.result @@ -10069,9 +10069,12 @@ select c21, c1, make_set(c21, c1) from t1; +------+------+-------------------+ | c21 | c1 | make_set(c21, c1) | +------+------+-------------------+ -| 9.5 | 1 | | -| -9.5 | -1 | | +| 9.5 | 1 | 1 | +| -9.5 | -1 | -1 | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c1, concat_ws(c21, c1) from t1; +------+------+--------------------+ | c21 | c1 | concat_ws(c21, c1) | @@ -10091,9 +10094,12 @@ select c21, c2, make_set(c21, c2) from t1; +------+------+-------------------+ | c21 | c2 | make_set(c21, c2) | +------+------+-------------------+ -| 9.5 | 2 | | -| -9.5 | 2 | | +| 9.5 | 2 | 2 | +| -9.5 | 2 | 2 | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c2, concat_ws(c21, c2) from t1; +------+------+--------------------+ | c21 | c2 | concat_ws(c21, c2) | @@ -10113,9 +10119,12 @@ select c21, c3, make_set(c21, c3) from t1; +------+------+-------------------+ | c21 | c3 | make_set(c21, c3) | +------+------+-------------------+ -| 9.5 | 1 | | -| -9.5 | -1 | | +| 9.5 | 1 | 1 | +| -9.5 | -1 | -1 | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c3, concat_ws(c21, c3) from t1; +------+------+--------------------+ | c21 | c3 | concat_ws(c21, c3) | @@ -10135,9 +10144,12 @@ select c21, c4, make_set(c21, c4) from t1; +------+------+-------------------+ | c21 | c4 | make_set(c21, c4) | +------+------+-------------------+ -| 9.5 | 2 | | -| -9.5 | 2 | | +| 9.5 | 2 | 2 | +| -9.5 | 2 | 2 | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c4, concat_ws(c21, c4) from t1; +------+------+--------------------+ | c21 | c4 | concat_ws(c21, c4) | @@ -10157,9 +10169,12 @@ select c21, c5, make_set(c21, c5) from t1; +------+------+-------------------+ | c21 | c5 | make_set(c21, c5) | +------+------+-------------------+ -| 9.5 | 1 | | -| -9.5 | -1 | | +| 9.5 | 1 | 1 | +| -9.5 | -1 | -1 | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c5, concat_ws(c21, c5) from t1; +------+------+--------------------+ | c21 | c5 | concat_ws(c21, c5) | @@ -10179,9 +10194,12 @@ select c21, c6, make_set(c21, c6) from t1; +------+------+-------------------+ | c21 | c6 | make_set(c21, c6) | +------+------+-------------------+ -| 9.5 | 2 | | -| -9.5 | 2 | | +| 9.5 | 2 | 2 | +| -9.5 | 2 | 2 | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c6, concat_ws(c21, c6) from t1; +------+------+--------------------+ | c21 | c6 | concat_ws(c21, c6) | @@ -10201,9 +10219,12 @@ select c21, c7, make_set(c21, c7) from t1; +------+------+-------------------+ | c21 | c7 | make_set(c21, c7) | +------+------+-------------------+ -| 9.5 | 1 | | -| -9.5 | -1 | | +| 9.5 | 1 | 1 | +| -9.5 | -1 | -1 | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c7, concat_ws(c21, c7) from t1; +------+------+--------------------+ | c21 | c7 | concat_ws(c21, c7) | @@ -10223,9 +10244,12 @@ select c21, c8, make_set(c21, c8) from t1; +------+------+-------------------+ | c21 | c8 | make_set(c21, c8) | +------+------+-------------------+ -| 9.5 | 2 | | -| -9.5 | 2 | | +| 9.5 | 2 | 2 | +| -9.5 | 2 | 2 | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c8, concat_ws(c21, c8) from t1; +------+------+--------------------+ | c21 | c8 | concat_ws(c21, c8) | @@ -10245,9 +10269,12 @@ select c21, c9, make_set(c21, c9) from t1; +------+------+-------------------+ | c21 | c9 | make_set(c21, c9) | +------+------+-------------------+ -| 9.5 | 1 | | -| -9.5 | -1 | | +| 9.5 | 1 | 1 | +| -9.5 | -1 | -1 | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c9, concat_ws(c21, c9) from t1; +------+------+--------------------+ | c21 | c9 | concat_ws(c21, c9) | @@ -10267,9 +10294,12 @@ select c21, c10, make_set(c21, c10) from t1; +------+------+--------------------+ | c21 | c10 | make_set(c21, c10) | +------+------+--------------------+ -| 9.5 | 2 | | -| -9.5 | 2 | | +| 9.5 | 2 | 2 | +| -9.5 | 2 | 2 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c10, concat_ws(c21, c10) from t1; +------+------+---------------------+ | c21 | c10 | concat_ws(c21, c10) | @@ -10289,9 +10319,12 @@ select c21, c11, make_set(c21, c11) from t1; +------+------+--------------------+ | c21 | c11 | make_set(c21, c11) | +------+------+--------------------+ -| 9.5 | 1 | | -| -9.5 | -1 | | +| 9.5 | 1 | 1 | +| -9.5 | -1 | -1 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c11, concat_ws(c21, c11) from t1; +------+------+---------------------+ | c21 | c11 | concat_ws(c21, c11) | @@ -10311,9 +10344,12 @@ select c21, c12, make_set(c21, c12) from t1; +------+------+--------------------+ | c21 | c12 | make_set(c21, c12) | +------+------+--------------------+ -| 9.5 | 2 | | -| -9.5 | 2 | | +| 9.5 | 2 | 2 | +| -9.5 | 2 | 2 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c12, concat_ws(c21, c12) from t1; +------+------+---------------------+ | c21 | c12 | concat_ws(c21, c12) | @@ -10333,9 +10369,12 @@ select c21, c13, make_set(c21, c13) from t1; +------+------+--------------------+ | c21 | c13 | make_set(c21, c13) | +------+------+--------------------+ -| 9.5 | 3.5 | | -| -9.5 | -3.5 | | +| 9.5 | 3.5 | 3.5 | +| -9.5 | -3.5 | -3.5 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c13, concat_ws(c21, c13) from t1; +------+------+---------------------+ | c21 | c13 | concat_ws(c21, c13) | @@ -10355,9 +10394,12 @@ select c21, c14, make_set(c21, c14) from t1; +------+------+--------------------+ | c21 | c14 | make_set(c21, c14) | +------+------+--------------------+ -| 9.5 | 4.5 | | -| -9.5 | 4.5 | | +| 9.5 | 4.5 | 4.5 | +| -9.5 | 4.5 | 4.5 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c14, concat_ws(c21, c14) from t1; +------+------+---------------------+ | c21 | c14 | concat_ws(c21, c14) | @@ -10377,9 +10419,12 @@ select c21, c15, make_set(c21, c15) from t1; +------+------+--------------------+ | c21 | c15 | make_set(c21, c15) | +------+------+--------------------+ -| 9.5 | 5.5 | | -| -9.5 | -5.5 | | +| 9.5 | 5.5 | 5.5 | +| -9.5 | -5.5 | -5.5 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c15, concat_ws(c21, c15) from t1; +------+------+---------------------+ | c21 | c15 | concat_ws(c21, c15) | @@ -10399,9 +10444,12 @@ select c21, c16, make_set(c21, c16) from t1; +------+------+--------------------+ | c21 | c16 | make_set(c21, c16) | +------+------+--------------------+ -| 9.5 | 6.5 | | -| -9.5 | 6.5 | | +| 9.5 | 6.5 | 6.5 | +| -9.5 | 6.5 | 6.5 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c16, concat_ws(c21, c16) from t1; +------+------+---------------------+ | c21 | c16 | concat_ws(c21, c16) | @@ -10421,9 +10469,12 @@ select c21, c17, make_set(c21, c17) from t1; +------+------+--------------------+ | c21 | c17 | make_set(c21, c17) | +------+------+--------------------+ -| 9.5 | 8 | | -| -9.5 | -8 | | +| 9.5 | 8 | 8 | +| -9.5 | -8 | -8 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c17, concat_ws(c21, c17) from t1; +------+------+---------------------+ | c21 | c17 | concat_ws(c21, c17) | @@ -10443,9 +10494,12 @@ select c21, c18, make_set(c21, c18) from t1; +------+------+--------------------+ | c21 | c18 | make_set(c21, c18) | +------+------+--------------------+ -| 9.5 | 9 | | -| -9.5 | 9 | | +| 9.5 | 9 | 9 | +| -9.5 | 9 | 9 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c18, concat_ws(c21, c18) from t1; +------+------+---------------------+ | c21 | c18 | concat_ws(c21, c18) | @@ -10462,12 +10516,15 @@ select c21, c18, interval(c21, c18) from t1; +------+------+--------------------+ select c21, c19, make_set(c21, c19) from t1; -+------+---------------------+--------------------+ -| c21 | c19 | make_set(c21, c19) | -+------+---------------------+--------------------+ -| 9.5 | 2019-12-01 12:00:00 | | -| -9.5 | 2019-12-01 12:00:00 | | -+------+---------------------+--------------------+ ++------+---------------------+---------------------+ +| c21 | c19 | make_set(c21, c19) | ++------+---------------------+---------------------+ +| 9.5 | 2019-12-01 12:00:00 | 2019-12-01 12:00:00 | +| -9.5 | 2019-12-01 12:00:00 | 2019-12-01 12:00:00 | ++------+---------------------+---------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c19, concat_ws(c21, c19) from t1; +------+---------------------+---------------------+ | c21 | c19 | concat_ws(c21, c19) | @@ -10484,12 +10541,15 @@ select c21, c19, interval(c21, c19) from t1; +------+---------------------+--------------------+ select c21, c20, make_set(c21, c20) from t1; -+------+---------------------+--------------------+ -| c21 | c20 | make_set(c21, c20) | -+------+---------------------+--------------------+ -| 9.5 | 2019-12-03 06:00:00 | | -| -9.5 | 2019-12-03 06:00:00 | | -+------+---------------------+--------------------+ ++------+---------------------+---------------------+ +| c21 | c20 | make_set(c21, c20) | ++------+---------------------+---------------------+ +| 9.5 | 2019-12-03 06:00:00 | 2019-12-03 06:00:00 | +| -9.5 | 2019-12-03 06:00:00 | 2019-12-03 06:00:00 | ++------+---------------------+---------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c20, concat_ws(c21, c20) from t1; +------+---------------------+---------------------+ | c21 | c20 | concat_ws(c21, c20) | @@ -10509,9 +10569,12 @@ select c21, c21, make_set(c21, c21) from t1; +------+------+--------------------+ | c21 | c21 | make_set(c21, c21) | +------+------+--------------------+ -| 9.5 | 9.5 | | -| -9.5 | -9.5 | | +| 9.5 | 9.5 | 9.5 | +| -9.5 | -9.5 | -9.5 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c21, concat_ws(c21, c21) from t1; +------+------+---------------------+ | c21 | c21 | concat_ws(c21, c21) | @@ -10531,9 +10594,12 @@ select c21, c22, make_set(c21, c22) from t1; +------+------+--------------------+ | c21 | c22 | make_set(c21, c22) | +------+------+--------------------+ -| 9.5 | 10.5 | | -| -9.5 | 10.5 | | +| 9.5 | 10.5 | 10.5 | +| -9.5 | 10.5 | 10.5 | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '9.5' +Warning 1292 Truncated incorrect INTEGER value: '-9.5' select c21, c22, concat_ws(c21, c22) from t1; +------+------+---------------------+ | c21 | c22 | concat_ws(c21, c22) | @@ -10567,9 +10633,12 @@ select c22, c1, make_set(c22, c1) from t1; +------+------+-------------------+ | c22 | c1 | make_set(c22, c1) | +------+------+-------------------+ -| 10.5 | 1 | 1 | -| 10.5 | -1 | -1 | +| 10.5 | 1 | | +| 10.5 | -1 | | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c1, concat_ws(c22, c1) from t1; +------+------+--------------------+ | c22 | c1 | concat_ws(c22, c1) | @@ -10589,9 +10658,12 @@ select c22, c2, make_set(c22, c2) from t1; +------+------+-------------------+ | c22 | c2 | make_set(c22, c2) | +------+------+-------------------+ -| 10.5 | 2 | 2 | -| 10.5 | 2 | 2 | +| 10.5 | 2 | | +| 10.5 | 2 | | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c2, concat_ws(c22, c2) from t1; +------+------+--------------------+ | c22 | c2 | concat_ws(c22, c2) | @@ -10611,9 +10683,12 @@ select c22, c3, make_set(c22, c3) from t1; +------+------+-------------------+ | c22 | c3 | make_set(c22, c3) | +------+------+-------------------+ -| 10.5 | 1 | 1 | -| 10.5 | -1 | -1 | +| 10.5 | 1 | | +| 10.5 | -1 | | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c3, concat_ws(c22, c3) from t1; +------+------+--------------------+ | c22 | c3 | concat_ws(c22, c3) | @@ -10633,9 +10708,12 @@ select c22, c4, make_set(c22, c4) from t1; +------+------+-------------------+ | c22 | c4 | make_set(c22, c4) | +------+------+-------------------+ -| 10.5 | 2 | 2 | -| 10.5 | 2 | 2 | +| 10.5 | 2 | | +| 10.5 | 2 | | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c4, concat_ws(c22, c4) from t1; +------+------+--------------------+ | c22 | c4 | concat_ws(c22, c4) | @@ -10655,9 +10733,12 @@ select c22, c5, make_set(c22, c5) from t1; +------+------+-------------------+ | c22 | c5 | make_set(c22, c5) | +------+------+-------------------+ -| 10.5 | 1 | 1 | -| 10.5 | -1 | -1 | +| 10.5 | 1 | | +| 10.5 | -1 | | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c5, concat_ws(c22, c5) from t1; +------+------+--------------------+ | c22 | c5 | concat_ws(c22, c5) | @@ -10677,9 +10758,12 @@ select c22, c6, make_set(c22, c6) from t1; +------+------+-------------------+ | c22 | c6 | make_set(c22, c6) | +------+------+-------------------+ -| 10.5 | 2 | 2 | -| 10.5 | 2 | 2 | +| 10.5 | 2 | | +| 10.5 | 2 | | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c6, concat_ws(c22, c6) from t1; +------+------+--------------------+ | c22 | c6 | concat_ws(c22, c6) | @@ -10699,9 +10783,12 @@ select c22, c7, make_set(c22, c7) from t1; +------+------+-------------------+ | c22 | c7 | make_set(c22, c7) | +------+------+-------------------+ -| 10.5 | 1 | 1 | -| 10.5 | -1 | -1 | +| 10.5 | 1 | | +| 10.5 | -1 | | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c7, concat_ws(c22, c7) from t1; +------+------+--------------------+ | c22 | c7 | concat_ws(c22, c7) | @@ -10721,9 +10808,12 @@ select c22, c8, make_set(c22, c8) from t1; +------+------+-------------------+ | c22 | c8 | make_set(c22, c8) | +------+------+-------------------+ -| 10.5 | 2 | 2 | -| 10.5 | 2 | 2 | +| 10.5 | 2 | | +| 10.5 | 2 | | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c8, concat_ws(c22, c8) from t1; +------+------+--------------------+ | c22 | c8 | concat_ws(c22, c8) | @@ -10743,9 +10833,12 @@ select c22, c9, make_set(c22, c9) from t1; +------+------+-------------------+ | c22 | c9 | make_set(c22, c9) | +------+------+-------------------+ -| 10.5 | 1 | 1 | -| 10.5 | -1 | -1 | +| 10.5 | 1 | | +| 10.5 | -1 | | +------+------+-------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c9, concat_ws(c22, c9) from t1; +------+------+--------------------+ | c22 | c9 | concat_ws(c22, c9) | @@ -10765,9 +10858,12 @@ select c22, c10, make_set(c22, c10) from t1; +------+------+--------------------+ | c22 | c10 | make_set(c22, c10) | +------+------+--------------------+ -| 10.5 | 2 | 2 | -| 10.5 | 2 | 2 | +| 10.5 | 2 | | +| 10.5 | 2 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c10, concat_ws(c22, c10) from t1; +------+------+---------------------+ | c22 | c10 | concat_ws(c22, c10) | @@ -10787,9 +10883,12 @@ select c22, c11, make_set(c22, c11) from t1; +------+------+--------------------+ | c22 | c11 | make_set(c22, c11) | +------+------+--------------------+ -| 10.5 | 1 | 1 | -| 10.5 | -1 | -1 | +| 10.5 | 1 | | +| 10.5 | -1 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c11, concat_ws(c22, c11) from t1; +------+------+---------------------+ | c22 | c11 | concat_ws(c22, c11) | @@ -10809,9 +10908,12 @@ select c22, c12, make_set(c22, c12) from t1; +------+------+--------------------+ | c22 | c12 | make_set(c22, c12) | +------+------+--------------------+ -| 10.5 | 2 | 2 | -| 10.5 | 2 | 2 | +| 10.5 | 2 | | +| 10.5 | 2 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c12, concat_ws(c22, c12) from t1; +------+------+---------------------+ | c22 | c12 | concat_ws(c22, c12) | @@ -10831,9 +10933,12 @@ select c22, c13, make_set(c22, c13) from t1; +------+------+--------------------+ | c22 | c13 | make_set(c22, c13) | +------+------+--------------------+ -| 10.5 | 3.5 | 3.5 | -| 10.5 | -3.5 | -3.5 | +| 10.5 | 3.5 | | +| 10.5 | -3.5 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c13, concat_ws(c22, c13) from t1; +------+------+---------------------+ | c22 | c13 | concat_ws(c22, c13) | @@ -10853,9 +10958,12 @@ select c22, c14, make_set(c22, c14) from t1; +------+------+--------------------+ | c22 | c14 | make_set(c22, c14) | +------+------+--------------------+ -| 10.5 | 4.5 | 4.5 | -| 10.5 | 4.5 | 4.5 | +| 10.5 | 4.5 | | +| 10.5 | 4.5 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c14, concat_ws(c22, c14) from t1; +------+------+---------------------+ | c22 | c14 | concat_ws(c22, c14) | @@ -10875,9 +10983,12 @@ select c22, c15, make_set(c22, c15) from t1; +------+------+--------------------+ | c22 | c15 | make_set(c22, c15) | +------+------+--------------------+ -| 10.5 | 5.5 | 5.5 | -| 10.5 | -5.5 | -5.5 | +| 10.5 | 5.5 | | +| 10.5 | -5.5 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c15, concat_ws(c22, c15) from t1; +------+------+---------------------+ | c22 | c15 | concat_ws(c22, c15) | @@ -10897,9 +11008,12 @@ select c22, c16, make_set(c22, c16) from t1; +------+------+--------------------+ | c22 | c16 | make_set(c22, c16) | +------+------+--------------------+ -| 10.5 | 6.5 | 6.5 | -| 10.5 | 6.5 | 6.5 | +| 10.5 | 6.5 | | +| 10.5 | 6.5 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c16, concat_ws(c22, c16) from t1; +------+------+---------------------+ | c22 | c16 | concat_ws(c22, c16) | @@ -10919,9 +11033,12 @@ select c22, c17, make_set(c22, c17) from t1; +------+------+--------------------+ | c22 | c17 | make_set(c22, c17) | +------+------+--------------------+ -| 10.5 | 8 | 8 | -| 10.5 | -8 | -8 | +| 10.5 | 8 | | +| 10.5 | -8 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c17, concat_ws(c22, c17) from t1; +------+------+---------------------+ | c22 | c17 | concat_ws(c22, c17) | @@ -10941,9 +11058,12 @@ select c22, c18, make_set(c22, c18) from t1; +------+------+--------------------+ | c22 | c18 | make_set(c22, c18) | +------+------+--------------------+ -| 10.5 | 9 | 9 | -| 10.5 | 9 | 9 | +| 10.5 | 9 | | +| 10.5 | 9 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c18, concat_ws(c22, c18) from t1; +------+------+---------------------+ | c22 | c18 | concat_ws(c22, c18) | @@ -10960,12 +11080,15 @@ select c22, c18, interval(c22, c18) from t1; +------+------+--------------------+ select c22, c19, make_set(c22, c19) from t1; -+------+---------------------+---------------------+ -| c22 | c19 | make_set(c22, c19) | -+------+---------------------+---------------------+ -| 10.5 | 2019-12-01 12:00:00 | 2019-12-01 12:00:00 | -| 10.5 | 2019-12-01 12:00:00 | 2019-12-01 12:00:00 | -+------+---------------------+---------------------+ ++------+---------------------+--------------------+ +| c22 | c19 | make_set(c22, c19) | ++------+---------------------+--------------------+ +| 10.5 | 2019-12-01 12:00:00 | | +| 10.5 | 2019-12-01 12:00:00 | | ++------+---------------------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c19, concat_ws(c22, c19) from t1; +------+---------------------+---------------------+ | c22 | c19 | concat_ws(c22, c19) | @@ -10982,12 +11105,15 @@ select c22, c19, interval(c22, c19) from t1; +------+---------------------+--------------------+ select c22, c20, make_set(c22, c20) from t1; -+------+---------------------+---------------------+ -| c22 | c20 | make_set(c22, c20) | -+------+---------------------+---------------------+ -| 10.5 | 2019-12-03 06:00:00 | 2019-12-03 06:00:00 | -| 10.5 | 2019-12-03 06:00:00 | 2019-12-03 06:00:00 | -+------+---------------------+---------------------+ ++------+---------------------+--------------------+ +| c22 | c20 | make_set(c22, c20) | ++------+---------------------+--------------------+ +| 10.5 | 2019-12-03 06:00:00 | | +| 10.5 | 2019-12-03 06:00:00 | | ++------+---------------------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c20, concat_ws(c22, c20) from t1; +------+---------------------+---------------------+ | c22 | c20 | concat_ws(c22, c20) | @@ -11007,9 +11133,12 @@ select c22, c21, make_set(c22, c21) from t1; +------+------+--------------------+ | c22 | c21 | make_set(c22, c21) | +------+------+--------------------+ -| 10.5 | 9.5 | 9.5 | -| 10.5 | -9.5 | -9.5 | +| 10.5 | 9.5 | | +| 10.5 | -9.5 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c21, concat_ws(c22, c21) from t1; +------+------+---------------------+ | c22 | c21 | concat_ws(c22, c21) | @@ -11029,9 +11158,12 @@ select c22, c22, make_set(c22, c22) from t1; +------+------+--------------------+ | c22 | c22 | make_set(c22, c22) | +------+------+--------------------+ -| 10.5 | 10.5 | 10.5 | -| 10.5 | 10.5 | 10.5 | +| 10.5 | 10.5 | | +| 10.5 | 10.5 | | +------+------+--------------------+ +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '10.5' +Warning 1292 Truncated incorrect INTEGER value: '10.5' select c22, c22, concat_ws(c22, c22) from t1; +------+------+---------------------+ | c22 | c22 | concat_ws(c22, c22) | diff --git a/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/expr_substring_index.result b/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/expr_substring_index.result index 195db806b0..e5a11ddfe1 100644 --- a/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/expr_substring_index.result +++ b/tools/deploy/mysql_test/test_suite/static_engine/r/mysql/expr_substring_index.result @@ -87,14 +87,14 @@ select c1, substring_index("a,b,c,d", ",", c1), c2, substring_index("a,b,c,d", " | -2 | c,d | 0 | | 2.10 | a,b | 2.9 | a,b | | -2 | c,d | 0 | | 2.90 | a,b,c | 2.9 | a,b | | -10 | a,b,c,d | 0 | | 10.00 | a,b,c,d | 10 | a,b,c,d | -| 4294967296 | | 4294967296 | | 4294967296.00 | | 4294967296 | | -| 4294967297 | a | 4294967297 | a | 4294967295.00 | d | 4294967295 | d | -| -4294967296 | | 4294967296 | | -4294967296.00 | | -4294967296 | | -| -4294967297 | d | 4294967297 | a | -4294967295.00 | a | -4294967295 | a | -| 9223372036854775806 | c,d | 9223372036854775808 | | 9223372036854775808.00 | d | 9223372036854775808 | d | -| 9223372036854775807 | d | 9223372036854775807 | d | 9223372036854775807.00 | d | 9223372036854775807 | d | -| 9223372036854775806 | c,d | 9223372036854775809 | a | 9223372036854775809.00 | d | 9223372036854775809 | d | -| -9223372036854775807 | a | 9223372036854775807 | d | -9223372036854775807.00 | a | -9223372036854775807 | a | +| 4294967296 | a,b,c,d | 4294967296 | a,b,c,d | 4294967296.00 | a,b,c,d | 4294967296 | a,b,c,d | +| 4294967297 | a,b,c,d | 4294967297 | a,b,c,d | 4294967295.00 | a,b,c,d | 4294967295 | a,b,c,d | +| -4294967296 | a,b,c,d | 4294967296 | a,b,c,d | -4294967296.00 | a,b,c,d | -4294967296 | a,b,c,d | +| -4294967297 | a,b,c,d | 4294967297 | a,b,c,d | -4294967295.00 | a,b,c,d | -4294967295 | a,b,c,d | +| 9223372036854775806 | a,b,c,d | 9223372036854775808 | a,b,c,d | 9223372036854775808.00 | a,b,c,d | 9223372036854775808 | a,b,c,d | +| 9223372036854775807 | a,b,c,d | 9223372036854775807 | a,b,c,d | 9223372036854775807.00 | a,b,c,d | 9223372036854775807 | a,b,c,d | +| 9223372036854775806 | a,b,c,d | 9223372036854775809 | a,b,c,d | 9223372036854775809.00 | a,b,c,d | 9223372036854775809 | a,b,c,d | +| -9223372036854775807 | a,b,c,d | 9223372036854775807 | a,b,c,d | -9223372036854775807.00 | a,b,c,d | -9223372036854775807 | a,b,c,d | +----------------------+-------------------------------------+---------------------+-------------------------------------+-------------------------+-------------------------------------+----------------------+-------------------------------------+ //for