[COMMITTERS] pgsql: Fix interval_transform so it doesn't throw away non-no-opcasts.
[COMMITTERS] pgsql: Fix interval_transform so it doesn't throw away non-no-opcasts.
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Fix interval_transform so it doesn't throw away non-no-op casts. interval_transform() contained two separate bugs that caused it to sometimes mistakenly decide that a cast from interval to restricted interval is a no-op and throw it away. First, it was wrong to rely on dt.h's field type macros to have an ordering consistent with the field's significance; in one case they do not. This led to mistakenly treating YEAR as less significant than MONTH, so that a cast from INTERVAL MONTH to INTERVAL YEAR was incorrectly discarded. Second, fls(1<