Fixed bug mdev-4894.
This a an old legacy performance bug.
When a very selective range scan existed for the second table in a join,
and, at the same time, there was another range condition depending on the
fields of the first table, the optimizer chose a plan with
'Range checked for each record'. This plan was extremely inefficient in
comparison with the regular selective range scan.
As a matter of fact the range scan chosen for each record was the same as
that selective range scan. 

Changed the test case for bug 24776 to preserve the old output for explain.
MDEV-4890 Valgrind warnings on shutdown on a build with openSSL
A clean-up for DEV-4890 Valgrind warnings on shutdown on a build with openSSL
MDEV-5181 incorrect binary search in remove_status_vars()

The loop in the binary search in remove_status_vars() was
incorrectly implemented and could continue infinitely in some cases.
Rewrote the binary search code.
MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
Allow only one level of symlink recursion in mysql_tzdata_to_sql,
to avoid infinite loops.
MDEV-5290 MTR cannot find mysql_tzinfo_to_sql on Windows

mysql_tzinfo_to_sql is not compiled under Windows in the pre-5.5 versions.
Do not set the MYSQL_TZINFO_TO_SQL variable in the version prior to 5.5
under Windows.
MDEV-5266 MySQL:57657 - Temporary MERGE table with temporary underlying is broken by ALTER

Fix ha_myisammrg::update_create_info() to do what ha_myisammrg::append_create_info() does -
take sub-table names from TABLE_LIST, not reverse engineer tablefile names.

Backport praveenkumar.hulakund@oracle.com-20120127081643-u7dxy23i8yyqarm7 from mysql-5.6
make 5.1 compiling with modern gcc.