aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execProcnode.c
diff options
context:
space:
mode:
authorThomas G. Lockhart <lockhart@fourpalms.org>2000-01-04 07:53:27 +0000
committerThomas G. Lockhart <lockhart@fourpalms.org>2000-01-04 07:53:27 +0000
commit3ec826f99a016b6cfe47db7ebbea21f46486680e (patch)
treeb1aa37a5c469b0799314a2cced269754804e71a1 /src/backend/executor/execProcnode.c
parentaae7b190777686ae3df27fcb1f4576440c4452dd (diff)
downloadpostgresql-3ec826f99a016b6cfe47db7ebbea21f46486680e.tar.gz
postgresql-3ec826f99a016b6cfe47db7ebbea21f46486680e.zip
Repair two recently reported problems:
1) datetime_pl_span() added the seconds field before adding the months field. This lead to erroneous results for e.g. select datetime '1999-11-30' + timespan '1 mon - 1 sec'; Reverse the order of operations to add months first. 2) tm2timespan() did all intermediate math as integer, converting to double at the very end. This resulted in hidden overflows when given very large integer days, hours, etc. For example, select '74565 days'::timespan; produced the wrong result. Change code to ensure that doubles are used for intermediate calculations. Thanks to Olivier PRENANT <ohp@pyrenet.fr> and Tulassay Zsolt <zsolt@tek.bke.hu> for problem reports and to Tom Lane for accurate analyses.
Diffstat (limited to 'src/backend/executor/execProcnode.c')
0 files changed, 0 insertions, 0 deletions