Re: 8.0.0beta1: make check fails on solaris8
От
Tom Lane
Тема
Re: 8.0.0beta1: make check fails on solaris8
Дата
Msg-id
14320.1092244966@sss.pgh.pa.us
Ответ на
Re: 8.0.0beta1: make check fails on solaris8 (Michael Fuhr)
Список
Дерево обсуждения
8.0.0beta1: make check fails on solaris8 Martin Münstermann <mmuenstermann@betrusted.com>
Re: 8.0.0beta1: make check fails on solaris8 Tom Lane <tgl@sss.pgh.pa.us>
Re: 8.0.0beta1: make check fails on solaris8 Martin Münstermann <mmuenstermann@betrusted.com>
Re: 8.0.0beta1: make check fails on solaris8 Tom Lane <tgl@sss.pgh.pa.us>
Re: 8.0.0beta1: make check fails on solaris8 Michael Fuhr <mike@fuhr.org>
Re: 8.0.0beta1: make check fails on solaris8 Tom Lane <tgl@sss.pgh.pa.us>
Re: 8.0.0beta1: make check fails on solaris8 Michael Fuhr <mike@fuhr.org>
Re: 8.0.0beta1: make check fails on solaris8 Tom Lane <tgl@sss.pgh.pa.us>
Re: 8.0.0beta1: make check fails on solaris8 Michael Fuhr <mike@fuhr.org>
Re: 8.0.0beta1: make check fails on solaris8 Tom Lane <tgl@sss.pgh.pa.us>
Re: 8.0.0beta1: make check fails on solaris8 Tom Lane <tgl@sss.pgh.pa.us>
Re: 8.0.0beta1: make check fails on solaris8 Martin Münstermann <mmuenstermann@betrusted.com>
Re: 8.0.0beta1: make check fails on solaris8 Tom Lane <tgl@sss.pgh.pa.us>
I've applied the attached patch to try to fix this problem with minimal
run-time cost. Since I don't have a Solaris machine I can't positively
confirm it works --- would one of you please test?
regards, tom lane
*** src/backend/utils/adt/float.c.orig Wed Aug 4 17:34:02 2004
--- src/backend/utils/adt/float.c Wed Aug 11 13:16:58 2004
***************
*** 317,322 ****
--- 317,334 ----
errmsg("invalid input syntax for type real: \"%s\"",
orig_num)));
}
+ #ifdef HAVE_BUGGY_SOLARIS_STRTOD
+ else
+ {
+ /*
+ * Many versions of Solaris have a bug wherein strtod sets endptr
+ * to point one byte beyond the end of the string when given
+ * "inf" or "infinity".
+ */
+ if (endptr != num && endptr[-1] == '\0')
+ endptr--;
+ }
+ #endif /* HAVE_BUGGY_SOLARIS_STRTOD */
/* skip trailing whitespace */
while (*endptr != '\0' && isspace((unsigned char) *endptr))
***************
*** 482,487 ****
--- 494,511 ----
errmsg("invalid input syntax for type double precision: \"%s\"",
orig_num)));
}
+ #ifdef HAVE_BUGGY_SOLARIS_STRTOD
+ else
+ {
+ /*
+ * Many versions of Solaris have a bug wherein strtod sets endptr
+ * to point one byte beyond the end of the string when given
+ * "inf" or "infinity".
+ */
+ if (endptr != num && endptr[-1] == '\0')
+ endptr--;
+ }
+ #endif /* HAVE_BUGGY_SOLARIS_STRTOD */
/* skip trailing whitespace */
while (*endptr != '\0' && isspace((unsigned char) *endptr))
*** src/include/port/solaris.h.orig Sun Mar 14 22:29:22 2004
--- src/include/port/solaris.h Wed Aug 11 13:16:50 2004
***************
*** 35,37 ****
--- 35,44 ----
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#endif
+
+ /*
+ * Many versions of Solaris have broken strtod() --- see bug #4751182.
+ * For the moment we just assume they all do; it's probably not worth
+ * the trouble to add a configure test for this.
+ */
+ #define HAVE_BUGGY_SOLARIS_STRTODВ списке pgsql-bugs по дате отправления
От: Tom Lane
Дата: