alter table mysql.user add system versioning;
|
# Query OK, 2 rows affected (0.04 sec)
|
|
select user, host, sys_trx_start, sys_trx_end from mysql.user for system_time all;
|
# +------+-----------+----------------------------+----------------------------+
|
# | user | host | sys_trx_start | sys_trx_end |
|
# +------+-----------+----------------------------+----------------------------+
|
# | root | localhost | 2017-12-28 19:40:13.453770 | 2038-01-19 05:14:07.999999 |
|
# | root | 127.0.0.1 | 2017-12-28 19:40:13.453770 | 2038-01-19 05:14:07.999999 |
|
# +------+-----------+----------------------------+----------------------------+
|
|
create user foo@localhost;
|
# Query OK, 0 rows affected (0.00 sec)
|
|
select user, host, sys_trx_start, sys_trx_end from mysql.user for system_time as of current_timestamp;
|
# +------+-----------+----------------------------+----------------------------+
|
# | user | host | sys_trx_start | sys_trx_end |
|
# +------+-----------+----------------------------+----------------------------+
|
# | root | localhost | 2017-12-28 19:40:13.453770 | 2038-01-19 05:14:07.999999 |
|
# | root | 127.0.0.1 | 2017-12-28 19:40:13.453770 | 2038-01-19 05:14:07.999999 |
|
# +------+-----------+----------------------------+----------------------------+
|
|
select user, host, sys_trx_start, sys_trx_end from mysql.user for system_time all;
|
# +------+-----------+----------------------------+----------------------------+
|
# | user | host | sys_trx_start | sys_trx_end |
|
# +------+-----------+----------------------------+----------------------------+
|
# | root | localhost | 2017-12-28 19:40:13.453770 | 2038-01-19 05:14:07.999999 |
|
# | root | 127.0.0.1 | 2017-12-28 19:40:13.453770 | 2038-01-19 05:14:07.999999 |
|
# | foo | localhost | NULL | 0000-00-00 00:00:00.000000 |
|
# +------+-----------+----------------------------+----------------------------+
|