postgresql/src
Tom Lane 9662143f0c Allow regex operations to be terminated early by query cancel requests.
The regex code didn't have any provision for query cancel; which is
unsurprising given its non-Postgres origin, but still problematic since
some operations can take a long time.  Introduce a callback function to
check for a pending query cancel or session termination request, and
call it in a couple of strategic spots where we can make the regex code
exit with an error indicator.

If we ever actually split out the regex code as a standalone library,
some additional work will be needed to let the cancel callback function
be specified externally to the library.  But that's straightforward
(certainly so by comparison to putting the locale-dependent character
classification logic on a similar arms-length basis), and there seems
no need to do it right now.

A bigger issue is that there may be more places than these two where
we need to check for cancels.  We can always add more checks later,
now that the infrastructure is in place.

Since there are known examples of not-terribly-long regexes that can
lock up a backend for a long time, back-patch to all supported branches.
I have hopes of fixing the known performance problems later, but adding
query cancel ability seems like a good idea even if they were all fixed.
2014-03-01 15:20:56 -05:00
..
backend Allow regex operations to be terminated early by query cancel requests. 2014-03-01 15:20:56 -05:00
bin Allow BASE_BACKUP to be throttled 2014-02-27 18:55:57 -03:00
common Prevent potential overruns of fixed-size buffers. 2014-02-17 11:20:21 -05:00
include Allow regex operations to be terminated early by query cancel requests. 2014-03-01 15:20:56 -05:00
interfaces Fix some missing .gitignore and "make clean" items in ecpg. 2014-02-19 18:50:48 -05:00
makefiles Flush a stray definition of $(DLLTOOL). 2014-02-11 12:59:48 -05:00
pl Prefer pg_any_to_server/pg_server_to_any over pg_do_encoding_conversion. 2014-02-23 16:59:05 -05:00
port Fix unportable coding in tarCreateHeader(). 2014-02-16 20:01:18 -05:00
template Revert to using --enable-auto-import in Cygwin builds. 2014-02-16 15:14:04 -05:00
test Show xid and xmin in pg_stat_activity and pg_stat_replication. 2014-02-25 12:34:04 -05:00
timezone Prevent potential overruns of fixed-size buffers. 2014-02-17 11:20:21 -05:00
tools Disable RandomizedBaseAddress on MSVC builds 2014-02-18 14:45:58 +01:00
tutorial Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
.gitignore
DEVELOPERS
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Cygwin build fixes. 2014-02-11 12:10:52 -05:00
Makefile.shlib Tweak position of $(DLL_DEFFILE) in shared-library link commands. 2014-02-12 11:22:23 -05:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
nls-global.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00