fix sign expr bug
This commit is contained in:
@ -134,6 +134,10 @@ int calc_sign_expr(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &res_datum)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ObBitTC: {
|
||||
res_int = arg_datum->get_bit() == 0 ? 0 : 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected arg_type", K(ret), K(arg_type));
|
||||
|
||||
@ -896,3 +896,17 @@ select sign(1E-400) from dual;
|
||||
+--------------+
|
||||
| 0 |
|
||||
+--------------+
|
||||
|
||||
##bug:
|
||||
drop table if exists t1;
|
||||
create table t1(c1 bit(64),c2 bit(64));
|
||||
insert into t1(c1) values(1);
|
||||
|
||||
select sign(c1) from t1;
|
||||
+----------+
|
||||
| sign(c1) |
|
||||
+----------+
|
||||
| 1 |
|
||||
+----------+
|
||||
|
||||
drop table t1;
|
||||
|
||||
@ -147,3 +147,16 @@ select sign( cast(a2 as char(1024)) ) , sign( cast(a4 as char(1024)) ) from t2 f
|
||||
--echo #
|
||||
select sign(1E-300) from dual;
|
||||
select sign(1E-400) from dual;
|
||||
|
||||
##bug:
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1(c1 bit(64),c2 bit(64));
|
||||
insert into t1(c1) values(1);
|
||||
|
||||
select sign(c1) from t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
Reference in New Issue
Block a user