postgresql/src/interfaces/ecpg
Tom Lane 2e82d0b396 Prevent datebsearch() from crashing on base == NULL && nel == 0.
Normally nel == 0 works okay because the initial value of "last" will be
less than "base"; but if "base" is zero then the calculation wraps around
and we have a very large (unsigned) value for "last", so that the loop can
be entered and we get a SIGSEGV on a bogus pointer.

This is certainly the proximate cause of the recent reports of Windows
builds crashing on 'infinity'::timestamp --- evidently, they're either not
setting an active timezonetktbl, or setting an empty one.  It's not yet
clear to me why it's only happening on Windows and not happening on any
buildfarm member.  But even if that's due to some bug elsewhere, it seems
wise for this function to not choke on the powerup values of
timezonetktbl/sztimezonetktbl.

I also changed the copy of this code in ecpglib, although I am not sure
whether it's exposed to a similar hazard.

Per report and stack trace from Richard Broersma.
2011-05-10 20:37:26 -04:00
..
compatlib Add gitignore entries for Windows MSVC builds 2011-04-19 20:04:41 +03:00
ecpglib Revert "Remove hard coded formats for INT64 and use configured settings instead." 2011-04-27 11:28:14 -04:00
include fix up a couple non-prototypes of the form foo() to be foo(void) -- found using -Wstrict-prototypes 2011-03-27 21:31:41 +01:00
pgtypeslib Prevent datebsearch() from crashing on base == NULL && nel == 0. 2011-05-10 20:37:26 -04:00
preproc Use a macro variable PG_PRINTF_ATTRIBUTE for the style used for checking printf type functions. 2011-04-28 10:56:14 -04:00
test Rename pg_regress option --multibyte to --encoding 2011-04-15 08:42:05 +03:00
Makefile Fix parallel make when running make install before make all 2011-03-08 23:52:29 +02:00
README.dynSQL Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00

src/interfaces/ecpg/README.dynSQL

descriptor statements have the following shortcomings

- input descriptors (USING DESCRIPTOR <name>) are not supported

  Reason: to fully support dynamic SQL the frontend/backend communication
  	should change to recognize input parameters.
  	Since this is not likely to happen in the near future and you
  	can cover the same functionality with the existing infrastructure
  	(using s[n]printf), I'll leave the work to someone else.