From 31e69ccb210cf49712f77facbf90661d8bc2eed5 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 11 Mar 2003 21:01:33 +0000 Subject: Add explicit tests for division by zero to all user-accessible integer division and modulo functions, to avoid problems on OS X (which fails to trap 0 divide at all) and Windows (which traps it in some bizarre nonstandard fashion). Standardize on 'division by zero' as the one true spelling of this error message. Add regression tests as suggested by Neil Conway. --- src/backend/utils/adt/timestamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/timestamp.c') diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index d3390fd3274..2764fee906a 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.79 2003/02/27 21:36:58 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.80 2003/03/11 21:01:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1869,7 +1869,7 @@ interval_div(PG_FUNCTION_ARGS) result = (Interval *) palloc(sizeof(Interval)); if (factor == 0.0) - elog(ERROR, "interval_div: divide by 0.0 error"); + elog(ERROR, "division by zero"); #ifdef HAVE_INT64_TIMESTAMP result->month = (span->month / factor); -- cgit v1.2.3