Imported mysql-5.6.17

Summary:
Pushing pristine mysql-5.6.17 from Oracle's mysql-5.6.17.tar.gz.

Test Plan:
diff -ur <repo> <untarred_5.6.17_release>
Only difference was the .git dir.
Imported mysql-5.6.19

Summary:
Pushing pristine mysql-5.6.19 from Oracle's mysql-5.6.19.tar.gz.

Test Plan:
diff -ur <repo> <untarred_5.6.19_release>
Only difference was the .git dir.
Add public phabricator config and testing support for WebScaleSQL

Summary:
This will let us handle reviews with external groups directly.

This also causes a "postponed" test to appear in the public diff page,
on each revision created with 'arc diff'.

This doesn't actually launch any tests, but it creates the "postponed"
test which allows for our internal testing sytem (and perhaps others) to
be pointed at this page, and fill out the test results from a test run.

Also added the created cache file to .gitignore.

Test Plan:
This is a combination of two, tested, diffs:

This diff was reviewed via public phabricator, so that works:
	https://reviews.facebook.net/D15621

And this diff was tested by using it to test a follow-up diff:
	https://reviews.facebook.net/D16713

For reference, the follow-up diff in question is here:
	https://reviews.facebook.net/D16629

Reviewers: pivanof, inaam-rana

Reviewed By: pivanof

CC: jtolmer

Differential Revision: https://reviews.facebook.net/D15621
Differential Revision: https://reviews.facebook.net/D16713
Remove extra files from distro tarball

Summary:
Feature: Basic Build Fixes

Oracle included two .gitignore files in their release tarball.

Oracle included generated sql_yacc.{cc|h} in their release tarball.

This diff removes these.

Test Plan: git show

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15627
Remove -DWITH_DEBUG from cmake setup

Summary:
Feature: Basic Build Fixes

This causes confusion, even apparently from Oracle.

The cmakeage adding it actually made Debug and WITH_DEBUG into two
different debug builds.

Now, we print an error and exit if someone passes -DWITH_DEBUG to cmake.

Test Plan: Jenkins

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15633
Switch to C++11 and C99

Summary:
Feature: Basic Build Fixes

Adds -std=c++11 to gcc and clang C++ builds,
and -std=c99 to gcc and clang C builds.

Also, -Wdeclaration-after-statement isn't compatible with C99 (since
it's a warning about a feature now allowed in C99), so this diff also
removes this.

Test Plan: Built with it, with this option removed from our build tools.

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15639
Enable linking with system libraries

Summary:
Feature: Basic Build Fixes

This gets mysqld, mysql, xtrabackup, libmysqlclient, etc...
all to link correctly with openssl, zlib, etc....

This lets us switch from the embedded versions cleanly.

Test Plan:
Built both debug and release, both with and without the build system
changes to use system openssl libs (and others).

Both types of builds work with this diff (embedded and system).

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15645
Fix Oracle's disabling of libreadline

Summary:
Feature: Basic Build Fixes

Oracle intentionally broke building with libreadline.  This undoes that.

I reverted to 5.6.11's libreadline detection, then applied fixes to it
to make that actually work.  Some are adapted from the attachments here:

	http://bugs.mysql.com/63130

I also ripped out the embedded libedit.  It's useless.

We now *always* build with libreadline, and require that library.

Test Plan:
Jenkins tests all pass.
Built it, tested client, works.

Built it with our tools, and with raw cmake.
Used ldd to confirm each was linked to the system readline lib.

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15651
Adjust linking flags to not embed some libs

Summary:
Feature: Basic Build Fixes

Adjust mysql linking flags to not embed openssl and zlib in static libs.

By default, libmysqlclient.a includes a copy of the openssl and
zlib it was linked against, thanks to a MERGE_LIBRARY call.  This isn't
ideal in fbcode's third-party environment where we want targets to have
to link in openssl on their own.

This change removes the ssl and zlib libraries from the merge and
instead sets them as a dependency for the build, so that other built
targets, such as the command line tools, still end up properly linked
but libmysqlclient.a doesn't include embedded copies.  It also removes
the munging of the library names when doing a static build so that they
are not called "imported_crypto" and "imported_openssl" and instead are
called by their normal names.

Test Plan:
mtr; also builting in third-party, confirming the .a file
does not contain openssl symbols and that building a third-party library
that depends on libmysqlclient works as expected

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15657
Modernize bison usage to work with bison3

Summary:
Feature: Basic Build Fixes

Fix usage of bison, roughly similar to MDEV-4902.  This works
with old and new bisons.

https://mariadb.atlassian.net/browse/MDEV-4902

Test Plan: built on my devserver, built on debian unstable

Reviewers: pivanof, steaphan, darnaut

Reviewed By: pivanof

CC: steaphan, darnaut

Differential Revision: https://reviews.facebook.net/D17229
Correct basic warnings from official MySQL-5.6

Summary:
Feature: Basic Code Fixes

Corrected all of the gcc and clang warnings from upstream MySQL source.
Our MySQL-5.6 now builds both ways with zero warnings in both.

Added DBUG_ONLY define to __attribute__ debug-only vars as
((unused)) in non-debug compiles to avoid gcc unused warnings.

Oracle's code was missing a "using" for "isfinite", needed in C++11.

Oracle blindly defined _GNU_SOURCE, which may already be defined.

Since bzero is a macro in newer glibc's, we need to undefine it if
it is already defined, before redefining it.

Fixed some bit-size mismatches in bitwise operations, detected by clang.

Fixed some integer type mismatches, detected by clang.

Fixed a too-many-parens warning, fired by clang.

Fixed some unused static vars when building without SAFE_STATISTICS.

The var "thread_running" was renamed to "num_thread_running" in 5.6.6,
but apparently not all the uses of "thread_running" were fixed -
the extern still had the old name.  This fixes that.

Test Plan:
Built both build types with devserver builds, no warnings.
Built both build types with Jenkins builds, no warnings.

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15663
Differential Revision: https://reviews.facebook.net/D15897
Differential Revision: https://reviews.facebook.net/D16497
Correct upstream warnings from calls to fwrite()

Summary:
Feature: Basic Code Fixes

Added blind_fwrite to call for fwrites where mysql apparently
doesn't care about actual success or failure of fwrite().

Test Plan:
Built both build types with devserver builds, no warnings.
Built both build types with Jenkins builds, no warnings.

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15669
Actually fix all the array bounds warnings

Summary:
Feature: Basic Code Fixes

This code is so convoluted, these really need at least these checks.

Test Plan:
The full Jenkins run will double-check me.

These were detected with gcc.  Rather than supress them, I fixed them.
Now, gcc no longer complains.

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15675
Fix errors detected by ASan at compile time

Summary:
Feature: Basic Code Fixes

Compiles cleanly with ASan now.

Test Plan: Built it with ASan, no warnings/errors.

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15681
Fix errors detected by ASan at runtime

Summary:
Feature: Basic Code Fixes

Most of these have been fixed by 5.6.15.  Only one remains:
A memcmp() on a string, that may go out of bounds of the string.

I simply replaced this with strncmp().

Test Plan:
Ran new ASan-Enabled 'arc unit', and 'arc unit --everything'.
All passed in both Release and Debug builds.

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15687
Remove bad "" operators

Summary:
Feature: Basic Code Fixes

In C++11, "" is not parsed as before.  So "A""B" is not the same as "AB".

Instead, whitespace is required, like: "A" "B"

This adds that whitespace everywhere gcc-4.7 found it in our builds.

Test Plan:
Built with gcc-4.7.
'git show -w' shows zero changes.

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15693
Update valgrind suppression for gcc 4.8.1 / glibc 2.17

Summary:
Feature: Basic Test Fixes

One existing valgrind suppression was not getting triggered because
the call stack is slightly different in newer libs.  So, reduce the
detail a bit to catch this in each version.

Also add a new supression to cover this known sendmsg bug:

	http://sourceware.org/bugzilla/show_bug.cgi?id=14687

Test Plan:
Jenkins
arc unit --everything

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15699
Bump the ram our tests use

Summary:
Feature: Basic Test Fixes

8M should be enough for anyone.  Except, no, it isn't.  Bloat
up to 32M, which beyond a doubt will be enough for anyone ever.

Test Plan: run mtr

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15705
Remove hard-coded aio disable from mtr

Summary:
Feature: Basic Test Fixes

An obsolete hard-coded limit in mtr prevented testing using aio with --mem.

Confirmed this is completely obsolete in all our kernels, then removed it.

Note: This bug was fixed in the linux-2.6.27 release:
	http://kernelnewbies.org/Linux_2_6_27

Test Plan: Jenkins: 'arc unit' - all tests still pass.

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15711
Mark one test as requiring profiling support

Summary:
Feature: Basic Test Fixes

This test needs profiling, but wasn't marked as such.

This fixes that.

Test Plan: Jenkins - all pass now.

Reviewers: flamingcow, pivanof, jeremycole, andrew-ford, inaam-rana

Reviewed By: pivanof

CC: jtolmer, MarkCallaghan

Differential Revision: https://reviews.facebook.net/D15717