Showing 1 changed files with 8 additions and 4 deletions
+8 -4
lib/DBIx/Custom.pm
... ...
@@ -123,6 +123,10 @@ sub assign_clause {
123 123
     my ($self, $param, $opts) = @_;
124 124
     
125 125
     my $wrap = $opts->{wrap} || {};
126
+
127
+    my $qp = $self->_q('');
128
+    my $q = substr($qp, 0, 1) || '';
129
+    my $p = substr($qp, 1, 1) || '';
126 130
     
127 131
     # Create set tag
128 132
     my @params;
... ...
@@ -130,8 +134,8 @@ sub assign_clause {
130 134
     for my $column (sort keys %$param) {
131 135
         croak qq{"$column" is not safety column name } . _subname
132 136
           unless $column =~ /^[$safety\.]+$/;
133
-        my $column_quote = $self->_q($column);
134
-        $column_quote =~ s/\./$self->_q(".")/e;
137
+        my $column_quote = "$q$column$p";
138
+        $column_quote =~ s/\./$p.$q/;
135 139
         my $func = $wrap->{$column} || sub { $_[0] };
136 140
         push @params,
137 141
           ref $param->{$column} eq 'SCALAR' ? "$column_quote = " . ${$param->{$column}}
... ...
@@ -1081,8 +1085,8 @@ sub values_clause {
1081 1085
     my @columns;
1082 1086
     my @placeholders;
1083 1087
     my $qp = $self->_q('');
1084
-    my $q = substr($qp, 0, 1);
1085
-    my $p = substr($qp, 1, 1);
1088
+    my $q = substr($qp, 0, 1) || '';
1089
+    my $p = substr($qp, 1, 1) || '';
1086 1090
     
1087 1091
     for my $column (sort keys %$param) {
1088 1092
         croak qq{"$column" is not safety column name } . _subname