mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-07 04:49:48 +00:00
Updated Quoter and ChangeHandler in all the modules
This commit is contained in:
@@ -1436,11 +1436,12 @@ sub quote {
|
||||
}
|
||||
|
||||
sub quote_val {
|
||||
my ( $self, $val ) = @_;
|
||||
my ( $self, $val, %args ) = @_;
|
||||
|
||||
return 'NULL' unless defined $val; # undef = NULL
|
||||
return "''" if $val eq ''; # blank string = ''
|
||||
return $val if $val =~ m/^0x[0-9a-fA-F]+$/; # hex data
|
||||
return $val if $val =~ m/^0x[0-9a-fA-F]+$/ # quote hex data
|
||||
&& !$args{is_char}; # unless is_char is true
|
||||
|
||||
$val =~ s/(['\\])/\\$1/g;
|
||||
return "'$val'";
|
||||
|
Reference in New Issue
Block a user