maria:MDEV-10570-plinux

Last commit made on 2017-01-20
Get this branch:
git clone -b MDEV-10570-plinux https://git.launchpad.net/maria

Branch merges

Branch information

Name:
MDEV-10570-plinux
Repository:
lp:maria

Recent commits

c2bda7d... by Lixun Peng <email address hidden> on 2017-01-20

[MDEV-10570] Merge Existing Community Patch “Flashback”

==== Description ====

Flashback can rollback the instances/databases/tables to an old snapshot.
It's implement on Server-Level by full image format binary logs (--binlog-row-image=FULL), so it supports all engines.
Currently, it’s a feature inside mysqlbinlog tool (with --flashback arguments).

Because the flashback binlog events will store in the memory, you should check if there is enough memory in your machine.

==== New Arguments ====

--flashback (-B)
It will let mysqlbinlog to work on FLASHBACK mode.

==== Example ====

I have a table "t" in database "test", we can compare the output with "--flashback" and without.

#client/mysqlbinlog /data/mysqldata_10.0/binlog/mysql-bin.000001 -vv -d test -T t --start-datetime="2013-03-27 14:54:00" > /tmp/1.sql
#client/mysqlbinlog /data/mysqldata_10.0/binlog/mysql-bin.000001 -vv -d test -T t --start-datetime="2013-03-27 14:54:00" -B > /tmp/2.sql

Then, importing the output flashback file (/tmp/2.log), it can flashback your database/table to the special time (--start-datetime).
And if you know the exact postion, "--start-postion" is also works, mysqlbinlog will output the flashback logs that can flashback to "--start-postion" position.

==== Implement ====

1. As we know, if binlog_format is ROW (binlog-row-image=FULL in 10.1 and later), all columns value are store in the row event, so we can get the data before mis-operation.

2. Just do following things:

  2.1 Change Event Type, INSERT->DELETE, DELETE->INSERT.
  For example:
    INSERT INTO t VALUES (...) ---> DELETE FROM t WHERE ...
    DELETE FROM t ... ---> INSERT INTO t VALUES (...)

  2.2 For Update_Event, swapping the SET part and WHERE part.
  For example:
    UPDATE t SET cols1 = vals1 WHERE cols2 = vals2
    --->
    UPDATE t SET cols2 = vals2 WHERE cols1 = vals1

  2.3 For Multi-Rows Event, reverse the rows sequence, from the last row to the first row.
  For example:
    DELETE FROM t WHERE id=1; DELETE FROM t WHERE id=2; ...; DELETE FROM t WHERE id=n;
    --->
    DELETE FROM t WHERE id=n; ...; DELETE FROM t WHERE id=2; DELETE FROM t WHERE id=1;

  2.4 Output those events from the last one to the first one which mis-operation happened.
  For example:

c849b7d... by Marko Mäkelä on 2017-01-17

MDEV-11785 Remove INFORMATION_SCHEMA.INNODB_TEMP_TABLE_INFO

The INFORMATION_SCHEMA view INNODB_TEMP_TABLE_INFO was added to
MySQL 5.7 as part of the work to implement temporary tables
without any redo logging.

The only use case of this view was SELECT COUNT(*) in some tests,
to see how many temporary tables exist in InnoDB. The columns do
not report much useful information. For example, the table name
would not be the user-specified table name, but a generated #sql
name. Also, the session that created the table is not identified.

bb109ae... by Marko Mäkelä on 2017-01-16

MDEV-6076: Fix a broken assertion.

1ba7234... by Marko Mäkelä on 2017-01-12

Follow-up to MDEV-11713: Make more use of DBUG_LOG

7c81f15... by Marko Mäkelä on 2017-01-12

Merge 10.1 into bb-10.2-mdev-11782

2dc5d8b... by Marko Mäkelä on 2017-01-12

Improve an MDEV-9011 test of innodb_encrypt_log.

Test crash recovery from an encrypted redo log with innodb_encrypt_log=0.
Previously, we did a clean shutdown, so only the log checkpoint
information would have been read from the redo log. With this change,
we will be reading and applying encrypted redo log records.

include/start_mysqld.inc: Observe $restart_parameters.

encryption.innodb-log-encrypt: Remove some unnecessary statements,
and instead of restarting the server and concurrently accessing
the files while the server is running, kill the server, check the
files, and finally start up the server.

innodb.log_data_file_size: Use start_mysqld.inc with $restart_parameters.

fd0479c... by Marko Mäkelä on 2017-01-11

Merge 10.1 into 10.2

4507f1e... by Marko Mäkelä on 2017-01-11

Remove an excessive copyright message.

5b5bce8... by Marko Mäkelä on 2017-01-11

Merge 10.0 into 10.1

833fda8... by Marko Mäkelä on 2017-01-11

InnoDB: Enable UNIV_DEBUG_VALGRIND for cmake -DWITH_VALGRIND

The symbol HAVE_VALGRIND_MEMCHECK_H was never defined.
Instead, the symbol HAVE_VALGRIND should have been used.