pt-table-sync accept user variables

Bug #1592903 reported by Andy Mahoney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
New
Undecided
Unassigned

Bug Description

If pt-table-sync where to remove the SESSION from the SET line of any variable that began with an @ given to --set-vars would it be applied to every MySQL connection made by the tool.

The reason I ask is because user variables could be used to disable triggers and then allow pt-table-sync to bring a slave sync with a master.

Something like the following or would this require more in depth changes?

$ pt-table-sync --version
pt-table-sync 2.2.13

2375,2376c2375,2385
<
< my $sql = "SET SESSION $var=$val";
---
>
> my $setvar = "";
> if ($var =~ /^@.*/){
> PTDEBUG && _d('Not setting session as var', $var,
> 'is a user var');
> $setvar = "SET";
> } else {
> $setvar = "SET SESSION";
> }
>
> my $sql = "$setvar $var=$val";

Thanks
Andy M

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1357

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.