Bug #84779 Expose binlog file and position of last transaction.
Submitted: 1 Feb 2017 18:54 Modified: 6 Feb 2017 7:29
Reporter: Jean-François Gagné Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[1 Feb 2017 18:54] Jean-François Gagné
Description:
Hi,

the GTID of the last transaction is exposed in the OK packet by enabling session_track_gtids ([1]) and using the 2 following Connector functions:

- mysql_session_track_get_first ([2])
- and mysql_session_track_get_next ([3]).

[1]: https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_session_track_...

[2]: https://dev.mysql.com/doc/refman/5.7/en/mysql-session-track-get-first.html

[3]: https://dev.mysql.com/doc/refman/5.7/en/mysql-session-track-get-next.html

In a Binlog Server deployment ([4]), binlog file and position is a GTID.  So knowing the binlog file and position of the last transaction is as valuable as knowing the GTID of the last transaction.

[4]: https://blog.booking.com/abstracting_binlog_servers_and_mysql_master_promotion_wo_reconfig...

So please consider exposing the binlog file and position of the last transaction in the OK packet.

Also please consider exposing that in a session variable (related to Bug#84747).

Also, please consider implementing a way to tell MySQL at the statement level that the binlog file and position of the last transaction should be put in the OK packet (related to Bug#84748).

Many thanks,

JFG

How to repeat:
This is a feature request.

Suggested fix:
Expose the binlog file and position of the last transaction in the OK packet and in a session variable.
[6 Feb 2017 7:29] MySQL Verification Team
Hello  Jean-François,

Thank you for the report and feature request!

Thanks,
Umesh