修改interval在PG兼容模式下的默认单位为秒

This commit is contained in:
luozihao
2024-01-17 19:55:49 +08:00
parent 16cbdbdb43
commit c90831cce7
3 changed files with 9 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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)

View File

@ -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;