DBD-mysql icon indicating copy to clipboard operation
DBD-mysql copied to clipboard

RFE: Support for tracking session information [rt.cpan.org #119122]

Open mbeijen opened this issue 8 years ago • 1 comments
trafficstars

Migrated from rt.cpan.org#119122 (status was 'open')

Requestors:

From [email protected] on 2016-12-04 12:19:21:

Hello,

In MySQL 5.7 it is possible to enable tracking of certain session
attributes.

These are the global variables which control that:
session_track_gtids
session_track_schema
session_track_state_change
session_track_system_variables

From the MySQL C API these can be used to get access to the data:
mysql_session_track_get_first()
mysql_session_track_get_next()

The main use case I see is to insert a record on a master and then get
the GTID back which then
can be used with WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() on the replica to
ensure the row did
replicate to the replica.

The other way of doing this would be to @@global.gtid_executed, but that
needs an extra roundtrip.

So it would be nice if DBD::mysql would expose the session tracking data.

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html
https://dev.mysql.com/doc/refman/5.7/en/mysql-session-track-get-first.html
https://dev.mysql.com/doc/refman/5.7/en/mysql-session-track-get-next.html
https://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html#function_wait-until-sql-thread-after-gtids

Daniël

From [email protected] on 2016-12-12 20:55:31:

Pull requests welcome!

https://github.com/perl5-dbi/DBD-mysql

mbeijen avatar Nov 15 '17 07:11 mbeijen

Related to: https://github.com/perl5-dbi/DBD-mysql/pull/77

dveeden avatar Jan 12 '18 13:01 dveeden