Merge from 5.6
Bug#17600176: This query returns a row in 5.5 but not 5.6 or current 5.7

The problem query contains an IN subquery that is transformed to
a semi-join. The subquery contains an outer join operation.
When run standalone, the outer join in the subquery is preserved as an
outer join and returns one row. However, when the full query is run,
the outer join is converted into an inner join, and the subquery no
longer returns any row. This causes the outer query to return no rows.

The problem is with the IF clause in the WHERE clause of the subquery,
When transforming into semi-join, we rely on Item::fix_after_pullout()
to adjust used_tables and not_null_tables information within the
condition objects, in order to determine e.g. the outer join to inner
join transform. However, there is no specific implementation of
::fix_after_pullout() for the IF clause, so it returns generic
information generated by Item_func::fix_after_pullout(). The fix is to
add this function.

By analysis, this appears to be a problem for BETWEEN predicates and
IN predicates too. A specific implementation of :;fix_after_pullout()
is added for both classes.

In addition, it was detected that not_null_tables information was not
updated correctly for class Item_row. However, I was not able to think
out any failing test for this problem, so no test case was added.
Null merge
Bug#17826757 CMAKE SUPPORT FOR GCC ON SOLARIS

We got segfault with -03 on intel/solaris/gcc/32bit

$gcc -c -Q -O3 --help=optimizers > foo
$gcc -c -Q -O2 --help=optimizers > bar

$diff foo bar | grep enabled
<   -fgcse-after-reload                         [enabled]
<   -finline-functions                          [enabled]
<   -fipa-cp-clone                              [enabled]
<   -fpredictive-commoning                      [enabled]
<   -ftree-loop-distribute-patterns     [enabled]
<   -ftree-partial-pre                          [enabled]
<   -ftree-vectorize                            [enabled]
<   -funswitch-loops                            [enabled]
<   -fvect-cost-model                           [enabled]

this made mysqld crash, so disable it:
 -ftree-vectorize                            [enabled]
Bug#11752665: WINDOWS SERVER X64: SO MANY COMPILER WARNINGS

Patch #3: Revert C API changes.
Bug#17928281 'CHECK_PERFORMANCE_SCHEMA()' LEAVES 'CURRENT_THD' REFERRING
DESTRUCTED THD OBJ 

Prior to fix, function check_performance_schema() could leave
behind stale pointers in thread local storage, for the following keys:
- THR_THD (used by _current_thd)
- THR_MALLOC (used for memory allocation)
This is an unsafe practice, which can potentially cause crashes,
and that can cause other bugs when code is modified during maintenance.

With this fix, thread local storage keys used temporarily within
function check_performance_schema() are cleaned up after use.
WL#5768 : PERFORMANCE SCHEMA, prepared statements instrumentation.

Details:
 - Fixed multiple test result file accordingly.
 - Fixed crashes seen on PB2.
Changed the parallel=auto option to parallel=4 for max_parts tests MTR
run command to reduce the load on the solaris machine.
Bug#14635144 IMPROVE FILESORT MEMCMP BY USING GLIBC MEMCMP FOR LONG KEYS

Post-push fix: remove some warnings from clang.
CheckCXXCompilerFlag incorrectly reports that clang supports -fno-builtin-memcmp
Running regression tests on PB2 for WL#7299
Backport from mysql-trunk to mysql-5.6:

  ** revision-id: vasil.dimov@oracle.com-20131203163459-tlkyqdq93jysk9z0
  ** committer: Vasil Dimov <vasil.dimov@oracle.com>
  ** branch nick: mysql-trunk
  ** timestamp: Tue 2013-12-03 18:34:59 +0200
  ** message:
  **   Fix Bug#70768 Persistent optimizer statistics often causes LOCK_open stalls
  **
  **   Protect each table's dict_table_t::stat* members with a latch dedicated
  **   for this table instead of using a global pool of 64 shared latches.
  **   With 6 tables, the chances of at least two ending up with the same latch
  **   is 23.9%. With a lots of tables, there are tons of collisions.
  **
  **   Reviewed by:	Kevin (rb:3805)
Null-merge mysql-5.6 -> mysql-trunk
reverted back the unintended changes made to  mysql-test/collections/mysql-trunk-stage.push
WL#6120- Change master without stopping slave

- Addressed review coments.
- Re-organized, cleaned code and added coments
  to change_master() function.
Bug#17894997 CMAKE WARNING WRT INTERFACE_LINK_LIBRARIES
Bug#17905155 CMAKE WARNING WHEN GENERATING MAKEFILE
Bug#71089 CMake warning when generating Makefile

Use old policy for LINK_INTERFACE_LIBRARIES.
Address some of Kevin's suggestions on rb:3493
Bug#17935793 UT_GET_NAMEL() IS NOT THREAD SAFE
Problem: Static variable is used in ut_get_namel(), which is not thread safe.
         Also replace the call of ut_print_timestamp() by ib_logf(), wherever in
         InnoDB if possible.

Fixed: Remove static identifier from ut_get_namel().
       Also fixed ut_print_timestamp().

Approved by Kevin (rb#4151).
Fixed the valgrind test failure reported in daily pb2 emerge from ut_get_namel()

--Approved by Annamalai (over IM).
Bug #17827378 - MTR DOES NOT REPORT IF A TEST FAILS TO DROP CREATED EVENTS
Bug 17827378 5.5=>5.6