Updated Quoter and ChangeHandler in all the modules

This commit is contained in:
Brian Fraser
2012-08-22 16:21:35 -03:00
parent e52ca00348
commit f8fa5cd3e3
16 changed files with 74 additions and 40 deletions

View File

@@ -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'";