修改interval在PG兼容模式下的默认单位为秒
This commit is contained in:
@ -2761,7 +2761,7 @@ int DecodeInterval(char** field, const int* ftype, int nf, int range, int* dtype
|
||||
type = DTK_SECOND;
|
||||
break;
|
||||
default:
|
||||
type = DTK_DAY;
|
||||
type = DB_IS_CMPT(PG_FORMAT) ? DTK_SECOND : DTK_DAY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -118,3 +118,9 @@ CONTEXT: referenced column: int8mod
|
||||
select numeric_mod(1234.5678,0.0);
|
||||
ERROR: division by zero
|
||||
CONTEXT: referenced column: numeric_mod
|
||||
select '10'::interval;
|
||||
interval
|
||||
-----------
|
||||
@ 10 secs
|
||||
(1 row)
|
||||
|
||||
|
@ -44,4 +44,5 @@ select int1mod(3, 0);
|
||||
select int2mod(3, 0);
|
||||
select int4mod(3, 0);
|
||||
select int8mod(3, 0);
|
||||
select numeric_mod(1234.5678,0.0);
|
||||
select numeric_mod(1234.5678,0.0);
|
||||
select '10'::interval;
|
Reference in New Issue
Block a user