MDEV-6247: Merge 10.0-galera to 10.1.

Merged lp:maria/maria-10.0-galera up to revision 3867.
MDEV-6567: Raw debug output in the error log.

Removed raw debug output when no error on OS operation has not happened.
Basic test of slave_run_triggers_for_rbr variable added.
MDEV-6575: main.view --ps-protocol fails in ANALYZE code

- After PREPARE is done, save the value of thd->select_number
  (this is what will be assigned to next select_lex object)
- Restore the value at each execution of the prepared statement.
Merge branch '10.1' of github.com:MariaDB/server into 10.1
MDEV-6172: Monitor progress of ALTER TABLE ... ADD INDEX,
ALGORITHM=INPLACE for InnoDB

Added thd_progress calls to row_merge_sort to give
some hint how merge sort progresses.
Merge branch '10.1' of github.com:MariaDB/server into 10.1
MDEV-4262 - P_S discovery

Discover P_S tables automatically.

Most of this patch is code clean-up:
- removed tests and code responsible for P_S tables correctness verification
- always return error from ha_perfschema::create()
- install/upgrade scripts won't create P_S tables anymore
Review fixes.
Fix Windows compiler errors.
Fix merge error.
Fix merge errors.
MDEV-6634: Wrong estimates for ref(const) and key IS NULL predicate

IS [NOT] NULL predicate is sargable within an outer join. Range
analysis only uses predicates from ON expressions, which have
regular semantics (without null-complemented rows, etc).
There is no reason not use IS [NOT] NULL predicates.
Merge lp:maria/maria-10.0-galera revisions 3867..3869 and
3871..3879.
MDEV-6305 - UNINIT_VAR emits code in non-debug builds

Reverted workaround for gcc bug, which was fixed 3 years ago:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772
Add missing test files for new configuration variables.

Added a new functions to handler API to forcefully abort_transaction,
producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
were added for future possiblity to add more storage engines that
could use galera replication.
MDEV-6634: Wrong estimates for ref(const): Update test result
MDEV-6247: Merge 10.0-galera to 10.1.

Merged lp:maria/maria-10.0-galera up to revision 3879.

Added a new functions to handler API to forcefully abort_transaction,
producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
were added for future possiblity to add more storage engines that
could use galera replication.
Merge branch 'bb-10.1-galera' of github.com:MariaDB/server into bb-10.1-galera
MDEV-6247: Merge 10.0-galera to 10.1.

    Merged lp:maria/maria-10.0-galera up to revision 3880.

    Added a new functions to handler API to forcefully abort_transaction,
    producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
    were added for future possiblity to add more storage engines that
    could use galera replication.