fix binary-float type error in dblink
This commit is contained in:
@ -156,9 +156,7 @@ int ObMySQLResult::format_precision_scale_length(int16_t &precision, int16_t &sc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// format scale from others to oceanbase
|
// format scale from others to oceanbase
|
||||||
if (DBLINK_DRV_OCI == link_type && (ObFloatType == ob_type || ObDoubleType == ob_type)) {
|
if (DBLINK_DRV_OCI == link_type && ObDateTimeType == ob_type) {
|
||||||
scale = OB_MIN_NUMBER_SCALE - 1; // binary_float and binar_double scale from oci is 0, need set to -85
|
|
||||||
} else if (DBLINK_DRV_OCI == link_type && ObDateTimeType == ob_type) {
|
|
||||||
scale = 0;
|
scale = 0;
|
||||||
} else if (tmp_scale < OB_MIN_NUMBER_SCALE || tmp_scale > OB_MAX_NUMBER_SCALE ||
|
} else if (tmp_scale < OB_MIN_NUMBER_SCALE || tmp_scale > OB_MAX_NUMBER_SCALE ||
|
||||||
(-1 == precision && ObNumberType == ob_type)) {
|
(-1 == precision && ObNumberType == ob_type)) {
|
||||||
@ -181,10 +179,15 @@ int ObMySQLResult::format_precision_scale_length(int16_t &precision, int16_t &sc
|
|||||||
length = tmp_length;
|
length = tmp_length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ObDoubleType == ob_type || ObFloatType == ob_type) {
|
if (ObDoubleType == ob_type || ObUDoubleType == ob_type) {
|
||||||
precision = -1;
|
precision = -1;
|
||||||
scale = -1;
|
scale = -85;
|
||||||
length = -1;
|
length = 22;
|
||||||
|
}
|
||||||
|
if (ObFloatType == ob_type || ObUFloatType == ob_type) {
|
||||||
|
precision = -1;
|
||||||
|
scale = -85;
|
||||||
|
length = 12;
|
||||||
}
|
}
|
||||||
if (ObIntervalYMType == ob_type || ObIntervalDSType == ob_type) {
|
if (ObIntervalYMType == ob_type || ObIntervalDSType == ob_type) {
|
||||||
precision = -1;
|
precision = -1;
|
||||||
|
@ -652,16 +652,16 @@ int ObMySQLResultImpl::get_ob_type(ObObjType &ob_type, obmysql::EMySQLFieldType
|
|||||||
break;
|
break;
|
||||||
case obmysql::EMySQLFieldType::MYSQL_TYPE_FLOAT:
|
case obmysql::EMySQLFieldType::MYSQL_TYPE_FLOAT:
|
||||||
if (is_unsigned_type) {
|
if (is_unsigned_type) {
|
||||||
ob_type = ObFloatType;
|
|
||||||
} else {
|
|
||||||
ob_type = ObUFloatType;
|
ob_type = ObUFloatType;
|
||||||
|
} else {
|
||||||
|
ob_type = ObFloatType;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case obmysql::EMySQLFieldType::MYSQL_TYPE_DOUBLE:
|
case obmysql::EMySQLFieldType::MYSQL_TYPE_DOUBLE:
|
||||||
if (is_unsigned_type) {
|
if (is_unsigned_type) {
|
||||||
ob_type = ObDoubleType;
|
|
||||||
} else {
|
|
||||||
ob_type = ObUDoubleType;
|
ob_type = ObUDoubleType;
|
||||||
|
} else {
|
||||||
|
ob_type = ObDoubleType;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case obmysql::EMySQLFieldType::MYSQL_TYPE_TIMESTAMP:
|
case obmysql::EMySQLFieldType::MYSQL_TYPE_TIMESTAMP:
|
||||||
|
@ -681,3 +681,10 @@ int ObLinkStmtParam::read_next(const char *buf, int64_t buf_len, int64_t &pos, i
|
|||||||
pos = ch - buf;
|
pos = ch - buf;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int64_t ObLinkStmtParam::get_param_len()
|
||||||
|
{
|
||||||
|
return PARAM_LEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
const int64_t ObLinkStmtParam::PARAM_LEN = sizeof(char) * 2 + sizeof(uint16_t);
|
||||||
|
@ -418,7 +418,9 @@ int ObLinkScanOp::inner_get_next_batch(const int64_t max_row_cnt)
|
|||||||
const ObIArray<ObExpr *> &output = spec_.output_;
|
const ObIArray<ObExpr *> &output = spec_.output_;
|
||||||
for (int64_t i = 0; OB_SUCC(ret) && i < output.count(); i++) {
|
for (int64_t i = 0; OB_SUCC(ret) && i < output.count(); i++) {
|
||||||
ObExpr *expr = output.at(i);
|
ObExpr *expr = output.at(i);
|
||||||
if (T_QUESTIONMARK != expr->type_ &&
|
if (!expr->is_const_expr() &&
|
||||||
|
T_FUN_SYS_REMOVE_CONST != expr->type_ &&
|
||||||
|
T_QUESTIONMARK != expr->type_ &&
|
||||||
(ob_is_string_or_lob_type(expr->datum_meta_.type_) ||
|
(ob_is_string_or_lob_type(expr->datum_meta_.type_) ||
|
||||||
ob_is_raw(expr->datum_meta_.type_) || ob_is_json(expr->datum_meta_.type_))) {
|
ob_is_raw(expr->datum_meta_.type_) || ob_is_json(expr->datum_meta_.type_))) {
|
||||||
ObDatum &datum = expr->locate_expr_datum(eval_ctx_);
|
ObDatum &datum = expr->locate_expr_datum(eval_ctx_);
|
||||||
|
@ -3140,13 +3140,6 @@ int ObImplicitCursorInfo::merge_cursor(const ObImplicitCursorInfo &other)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t ObLinkStmtParam::get_param_len()
|
|
||||||
{
|
|
||||||
return PARAM_LEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int64_t ObLinkStmtParam::PARAM_LEN = sizeof(char) * 2 + sizeof(uint16_t);
|
|
||||||
|
|
||||||
bool ObSQLUtils::is_same_type_for_compare(const ObObjMeta &meta1, const ObObjMeta &meta2)
|
bool ObSQLUtils::is_same_type_for_compare(const ObObjMeta &meta1, const ObObjMeta &meta2)
|
||||||
{
|
{
|
||||||
bool is_same = false;
|
bool is_same = false;
|
||||||
|
Reference in New Issue
Block a user