my $blob_cols = $self->_remove_blob_cols($source, $to_insert);
# insert+blob insert done atomically
- my $guard = $self->txn_scope_guard if %$blob_cols;
+ my $guard = $self->txn_scope_guard if $blob_cols;
my $need_last_insert_id = 0;
}
};
- $self->_insert_blobs($source, $blob_cols, $to_insert) if %$blob_cols;
+ $self->_insert_blobs($source, $blob_cols, $to_insert) if $blob_cols;
$guard->commit if $guard;
my $blob_cols = $self->_remove_blob_cols($source, $fields);
# update+blob update(s) done atomically
- my $guard = $self->txn_scope_guard if %$blob_cols;
+ my $guard = $self->txn_scope_guard if $blob_cols;
my @res;
if ($wantarray) {
$self->next::method(@_);
}
- $self->_update_blobs($source, $blob_cols, $where) if %$blob_cols;
+ $self->_update_blobs($source, $blob_cols, $where) if $blob_cols;
- $guard->commit if %$blob_cols;
+ $guard->commit if $guard;
return $wantarray ? @res : $res[0];
}
}
}
- return \%blob_cols;
+ return keys %blob_cols ? \%blob_cols : undef;
}
sub _update_blobs {