Remove redundant test

Summary:
When Oracle gave us the patch for the test case for
public bug 69122, it added the test under a different name
than what they pushed to the official source. We now have the
correct upstream test in innodb-change-buffer-recovery.test.

This diff fully reverts the original diff which added this test
as well as subsequent changes to those files.

Test Plan: None

Reviewers: steaphan

Reviewed By: steaphan
[refactor] Put all repeated logic to get trx_id_col into a separate function

Summary: The same logic appeared 3 times. put them into one function to ease readability.

Test Plan: jenkins

Reviewers: over

Reviewed By: over
Revert "Skip purged records when serializing except for the record offsets."

Summary:
Revert the change that skips the purge record so we can refactor
compression code easier. One of the goals for refactoring is to get rid
of the streamd zlib compression all together. To do this, we need to
keep the buffered zlib compression and streamed zlib compression format
compatible. However, current buffered zlib compression is only available
with format change. Skiping purged records is one of the things that
changes the data format. So we revert this first.

Test Plan: jenkins

Reviewers: over

Reviewed By: over
Revert "Minihashmap implementation Part 1: skip rollback pointers for fresh inserts"

Summary:
Revert minihashmap change to refactor codebase. We might or might not
use the minihashmap implementation for metadata later.

Test Plan: jenkins

Reviewers: over

Reviewed By: over
Revert "Store transaction ids and rollback pointers in a mini hash table"

Summary:
Revert the mini hashmap changes to make refactor easier. We might or
might not keep this implementation for metadata reduction.

Test Plan: jenkins

Reviewers: over

Reviewed By: over
[refactor] page0zip.cc: move some inline functions to a separate file

Summary:
Move some inline functions to a helper file.
Delete unuesed macro: ASSERT_ZERO_BLOB
Removed some unnecessary macros, just use functions: page_zip_fail, page_zip_dir_find

Test Plan:
jenkins

https://ci-builds.fb.com/view/MySQL/job/mysql-precommit-big/350/

Reviewers: over

Reviewed By: over
[refactor] Put things related to page trailer into page0zip_trailer and things related to log to page0zip_mlog

Summary:
Added two new files, page0zip_trailer contains functions that writes to page trailer,
page0zip_mlog contains functions that writes to modification log.

Test Plan: jenkins

Reviewers: over

Reviewed By: over
[refactor] page_zip_decompress, page zip stats

Summary: remove page_zip_compress_low. refactor page_zip_stats.

Test Plan: jenkins

Reviewers: over

Reviewed By: over
refactor checksum for compressed page into page0zip_checksum

Summary:
this removes the dependency of innochecksum on the whole page0zip,
since it only needs page_zip_verify_checksum.

Test Plan: jenkins

Reviewers: over

Reviewed By: over
[refactor] page_zip_dir_add_slot should not be visible to other modules.

Summary: move page_zip_dir_add_slot to page0zip_helper.h

Test Plan: jenkins

Reviewers: over

Reviewed By: over
tidy page0types.h

Summary: page0types.h should not have function definitions.

Test Plan: jenkins

Reviewers: over

Reviewed By: over
At least once semantic for rbr binlog events

Summary:
We need at least once semantic for binlog transactions which is
strictly required for taking backup from row based binary logs
and for wormhole.

With less durable settings (sync_binlog=0) a slave may not have
synced the transactions to disk before crashing. This will leave
some transactions committed in storage engine but not
in binlog. After slave's crash recovery these transactions are skipped
to commit inside innodb using the slave_gtid_info table. These skipped
transactions are logged to binlog to achieve at least once semantic.

A flag binlog_only_row_event is used to skip applying event in innodb
for a Row_log_event.

Note this diff affects the slave behavior.

Test Plan:
mtr tests. Testing method explained in rpl_slave_gtid_info.inc
file.

Reviewers: jtolmer

Reviewed By: jtolmer
Option to run triggers on slave for row-based events

Summary:
Port the slave_run_triggers_for_rbr feature from mariadb 10.1.1.

When using statement based replication slave executes the sql statments
which runs the slave side triggers. Since in row based replication, slave
applies the row events directly to the storage engine, triggers on the slave
table are not executed. Add functionality to run triggers on slave side
when executing row based events.

The following triggers are invoked:

* Update_row_event runs an UPDATE trigger
* Delete_row_event runs a DELETE trigger
* Write_row_event action depends on whether the operation will require foreign key checks:
  1) when FK checks are not necessary, the operation will invoke a DELETE trigger if the record
  to be modified existed in the table. After that, an INSERT trigger will be invoked.
  2) when FK checks are necessary, either an UPDATE or or a combination of
     DELETE and INSERT triggers will be invoked.

slave_run_triggers_for_rbr option controls the feature.
Default value is NO which don't invoke trigger for row-based events; Setting the option
to YES will cause the SQL slave thread to invoke triggers for row based events; setting it to
LOGGING will also cause the changes made by the triggers to be written into the binary log.

There is a basic protection against triggers being invoked both on the master and slave.
If the master modifies a table that has triggers, it will produce row-based binlog events
with the "triggers were invoked for this event" flag. The slave will not invoke any
triggers for flagged events.

Test Plan: mtr tests

Reviewers: jtolmer

Reviewed By: jtolmer
Make the show engine innodb status more true to original

Summary:
The change to implement granular InnoDB status commands introduced
sub-command to "show engine innodb status", which changed the logic of
some other call sites of the function srv_printf_innodb_monitor.

Change it back to the original logic. Also includes a change to use
bitmap macro and some format cleanup.

Test Plan:
The test introduced in the original commit still passes.

Reviewers: over

Reviewed By: over
Some fixes for admin port for MySQL

Summary:
* Fixed the issue that cannot shutdown mysqld when admin port is enabled
* Support unlimited number of connections to admin port instead of one
* Support command 'show global variables', i.e. show global variables like '%admin%'
* Support command 'show processlist'
* Connections via admin port no longer limited by @@max_user_connections

Test Plan:
* Built RPM and manually tested shutdown logic
* Added test case sys_vars.admin_port_basic.test
* Modified existing tests admin_connection.test and admin_connection_ipv6.test
* Enhanced tests admin_connections.test and admin_connections_ipv6.test
  for @@max_user_connections

Reviewers: santoshb, steaphan, jtolmer

Reviewed By: jtolmer, santoshb
Add new FbsonValue API to get value as byte array

Summary:
This patch adds a convenient way to get the size of an fbson value (without its
header and length info) and the value itself as a byte array.

Example:

  // Get size of the value (excluding headers and length info)
  // FbsonValue::size();

  // Get the value as byte array
  // FbsonValue::getValuePtr();

  // Now we can memcpy the value directly without worrying the underlying type
  FbsonValue *val = ...
  if ( val && val->size() )
    memcpy(ret_buf, val->getValuePtr(), val->size());

This is a port from FBSON library.

Test Plan: Unit tests

Reviewers: pengt

Reviewed By: pengt
Port FBSON library's unit test code

Summary:
This is to port all unit test code (using GTest) into MySQL's fbson lib
directory. The unit tests are not intented to be ran with MySQL's test
framework, but are ported as a referenece for people who wish to use and add
tests to the FBSON library.

Test Plan: FBSON unit tests

Reviewers: pengt

Reviewed By: pengt
Support document paths as general expressions in SQL and index creation on document paths

Summary:
  Support document path for document type as general expression in SQL
  Support creating table with keys on or contain document paths
  Support creating indexes on or contain document paths
  allow_document_type was a global variable, now it is also a session varaible

Test Plan:
  Added new test case json.type_document_path.test
  Added new test case json.type_document_path_indexing.test
  Modified sys_vars.allow_document_type_basic.test since this variable now is both global and session

Reviewers: tianx

Reviewed By: tianx
Make sql_log_bin session only

Summary: Change sql_log_bin to be SESSION_ONLY instead of SESSION_VAR

Test Plan:
Created a new test file with validation for sql_log_bin.
mysqltest.sh mysql-test/t/sql_log_bin_tests.test

Spent 0.002 of 15 seconds executing testcases

Completed: All 1 tests were successful.

Reviewers: kuko, rongrong

Reviewed By: rongrong
super_read_only should not get affected by read_only_slave

Summary:
see title

Test Plan: mtr

Reviewers: evanelias, lachlan, jtolmer

Reviewed By: jtolmer