Port fix for mysqlbinlog reading big records from stdin

Summary:
Fixed mysqlbinlog error when reading big records from stdin.

When mysqlbinlog tries to read a big record (over 128KB) from stdin, the
glibc read in my_read will return 128KB instead of the full size. This
causes _my_b_read to fail.

Ported the folowing change
In mysqlbinlog.cc, enable MY_FULL_IO, and in my_read.c, fix the
MY_FULL_IO logic.

Test Plan:
ported the test case which generates an event of size greater
than greater than 128kb and runs mysqlbinlog.

Reviewers: steaphan

Reviewed By: steaphan
port streaming binlogs to 5.6.11

Summary:
Currently 5.6 doesn't suppport compressed binlogs as input to mysqlbinlog.

The original bug link is http://bugs.mysql.com/bug.php?id=49336

This fix allows mysqlbinlog to take multiple compressed files as direct
input to mysqlbinlog rather than first decompressing the input files and
passing them to mysqlbinlog.

Ports the following change:
	'Fix mysqlbinlog to take streaming file input'

The following are the changes
1) Use read_log_event in check_header rather than my_b_seek if it is
streaming file
2) After check_header, skip start_position - current_position bytes
(rather than start_position bytes)

Ports the following fix:
	'Handle multiple files being streamed to mysqlbinlog'

5.6 takes multiple compressed file as input to mysqlbinlog.

Changes in the original diff are

1) When multiple files are streamed, the binlog magic number occurs in
the middle of stream and is causing problems. Skip such binlog magic
magic numbers that occur in the middle of stream. Also, do not allow
--stop-position with stream input because we do not know when the last
file starts.

Port the following fix:

rpl.rpl_row_mysqlbinlog is using --stop-position with stdin so that
rpl.rpl_row_mysqlbinlog passes. rpl.rpl_row_mysqlbinlog has 2 tests
using --stop-position with stdin. Change them to expect error.

Test Plan: ported the test cases.

Reviewers: steaphan

Reviewed By: steaphan
Make mysqldump not lock all tables with --single-transaction

Summary:
Change the behavior of --single-transaction to use

	START TRANSACTION WITH CONSISTENT INNODB SNAPSHOT

to begin transactions, which returns the binlog file and offset. This
is later used if --master-data is specified and becomes part of the
output (otherwise it just avoids the lock tables).

Test Plan:
mtr tests pass.
main.mysqldump contains a test for this, check for Bug#12809202
Not sure if more testing is required.

Reviewers: jtolmer, steaphan

Reviewed By: steaphan
Make default value of binlog_checksum 'NONE'

Summary:
Replciation from 5.6 to 5.1 fails because of checksum values
in binlog events which are not handled by 5.1. Setting binlog_checksum
to NONE as default value solves the issue. I think this is better than
setting binlog_checksum=NONE explicitly in cnf files while setting up
replication from 5.6 to 5.1. It would be good to change the default
value again to CRC32 once 5.6 is deployed everywhere.

Test Plan: Tested replication from 5.1 slave with 5.6 master.

Reviewers: jtolmer, steaphan

Reviewed By: steaphan
Two fixes for logical read-ahead feature

Summary:
1) Do not use adaptive hash index for node pointer records.
2) Fix logical read-ahead for debug build.

This diff is meant to fix two bugs related to logical read ahead:

1- Compute the depth of B-tree by looking at the height of the root
node. Earlier we were searching for a record and reading the value from
btr_cursor.tree_height but this field is not set when adaptive hash
index is used.

2- When UNIV_DEBUG is enabled trx->lra_sort_arr array was zeroed before
it was filled with new page numbers. A previous revision changed the
sort array size but I forgot to change the size parameter used for
memset().

Test Plan:
* mtr
Reviewers: yoshinori, steaphan

Reviewed By: yoshinori
Add config option gtid_deployment_step useful for deployment

Summary:

With gtid_deployment_step enabled, a host cannot generate gtids on its
own, but if gtid logged events are received through replication stream
from master, gtids will be logged.

Modified logic such that sql_thread never generates gtids automatically
on it's own. This diff is likely to be reverted when Oracle adds support
for gtid_mode=UPGRADE_STEP_1 & 2 which may be useful for deployment.

Test Plan:
Tested replication working with the
following scenarios.
1) Both Master and slave with gtid_deployment_step=0 and
   gtid_mode=OFF.
2) Master with gtid_deployment_step=0 and gtid_mode=OFF, slave with
   gtid_deployment_step=1 and gtid_mode=ON.
3) Both master and slave with gtid_deployment_step=1 and gtid_mode=ON.
4) Master with gtid_deployment_step=0 and gtid_mode=ON, slave with
   gtid_deployment_step=1 and gtid_mode=ON.
5) Both master and slave with gtid_deployment_step=0 and gtid_mode=ON.

Reviewers: jtolmer

Reviewed By: jtolmer