Create xtrabackup_logfile in the supplied target_dir

Summary:
Without this change, xtrabackup_logfile is created in the directory
specified as tmpdir in my.cnf file.

As the logfile can be quite large (>10 GB) the tmpdir is not always the
best option. Hence, create xtrabackup_logfile in the supplied
target_dir.

Test Plan:
Checked with lsof | grep xtrabackup_logfile, that the logfile is created
in the directory specified with --tmpdir in innobackupex and
--target_dir in xtrabackup

Reviewers: steaphan

Reviewed By: steaphan
Xtrabackup: Always use default error messages

Summary:
Do not use thread specific locales for error messages. Instead always
use the default ones.

Test Plan: Artificially threw some warnings in xtrabackup.

Reviewers: steaphan

Reviewed By: steaphan
Change binlog index file format to incude previous gtid set.

Summary:
Format of binlog index file is changed to include previous gtid set.
This is used during server start-up where gtid_executed and gtid_purged
are initialized without scanning and opening binary logs. The functions
find_log_pos, find_next_log, are changed so that they skip previous gtid
set(stored as binary string) in the index file while reading. The new
change will handle both old and new formats.

The initialization of gtid_sets is called (init_gtid_sets()) before
opening binlog (open_binlog()) during server start-up. This is done to
avoid the extra work of opening the active file again to write the
previous gtid log event. This also avoids writing the the previous gtid
set again in the index file which needs to be done if init_gtid_sets()
is called after open_binlog().

Added a mapping from binlog name to previous gtid set in that binlog in
memory(previous_gtid_set_map) so that opening binlog files is not
necessary by the dump thread when a slave reconnects. Modified the logic
in find_first_log_not_in_gtid_set so that it reverse iterates over the
in memory data structure previous_gtid_set_map.

Test Plan:
Added a test case to check @@gtid_executed and @@gtid_purged are
initialized properly on both master and slave after FLUSH LOGS, PURGE
BINARY LOGS command and also after restarting server several times.
No extra tests are added to test the scenario where gtid_mode=OFF and
reading binlog index files since binlog.binlog_index tests all those
scenarios.

Reviewers: jtolmer

Reviewed By: jtolmer
Fix CREATE TABLE ... LIKE to handle KEY_BLOCK_SIZE

Summary:
When doing a CREATE TABLE ... LIKE where the origin table uses both
ROW_FORMAT=COMPRESSED and a KEY_BLOCK_SIZE which is not the default,
then the created table claims that it is using the same key block as
the origin but in fact uses the default.

SHOW CREATE TABLE will report an incorrect key block size but
innochecksum will show that the file on disk is actually using
the default.

I entered this as http://bugs.mysql.com/bug.php?id=66738.

I also corrected the output of innochecksum so that it doesn't
report things like 4096K.

Test Plan: Wrote a new test

Reviewers: rongrong

Reviewed By: rongrong
Zero-padding trx log write to OS block size

Summary:
When writing transaction logs to disk, zero-padding the log up to a full
OS block size. A new sysvar OS_FILE_PAD is added and passed down to fil_io
for transaction log writes. We only pad writes to actual log entires,
excluding writes to log headers, since log headers are reused and
updated.

Test Plan: Domas tested this manually.  Jenkins tests all pass.

Reviewers: steaphan, dmituzas

Reviewed By: steaphan
Oracle's fix for flush tables breaking replication

Summary:
This is a fix for http://bugs.mysql.com/bug.php?id=69045
This fixes the statement flush tables breaking replication.

This should be part of 5.6.12, so we don't need to port this forward.

Test Plan: Added a new test case.

Reviewers: jtolmer

Reviewed By: jtolmer
Back-port Oracle's fix for CREATE TABLE IF NOT EXISTS

Summary:
This fixes the hang when using CREATE TABLE IF NOT EXISTS.

This should become part of mysql-5.6.13, when it's released.

Test Plan:
mtr test changes included, they all pass.
Yoshinori will test further.

Reviewers: jtolmer

Reviewed By: jtolmer