Upgrade the bundled PCRE version to 8.34 and add a CMake option to compile against an external PCRE library


The official PCRE-8.33 has a bug that makes the function
pcre_compile() crash if the pattern has too deep parenthesis level.
We cannot compile MariaDB against an external PCRE-8.33 (or earlier)
library to avoid this crash.

PCRE-8.33 bundled with MariaDB-10.0.5 has our own patch
to prevent this crash in queries like:
SELECT 'x' RLIKE CONCAT(REPEAT('(',300), 'x', REPEAT(')',300));

The problem was reported to the PCRE maintainers and is already
fixed in the PCRE trunk. The next release PCRE-8.34 (which is going to
be released around the end of December 2013) will include this fix.

After 8.34 is out, we should upgrade the bundled version to 8.34
and add an option to compile MariaDB against an external
PCRE library (8.34 or later) instead of the bundled one.
This will reduce the size of "mysqld" on many systems that
have PCRE as a package, and will be inline with the
"No Bundled Libraries" concept followed by most Linux


Note, mysqld is linked against libpcre.so as a dependency when compiled against openssl,
which makes it even worse (two copies of PCRE inside mysqld, one statically linked, and
another one dynamically linked):


Alexander Barkov


Alexander Barkov



Fix versions