# as a new txn is started immediately on commit
$self->transaction_depth(1) if (
!$self->transaction_depth
- and
+ and
defined $self->_dbh_autocommit
and
! $self->_dbh_autocommit
# as a new txn is started immediately on commit
$self->transaction_depth(1) if (
!$self->transaction_depth
- and
+ and
defined $self->_dbh_autocommit
and
! $self->_dbh_autocommit
}];
}
+ if ($op eq 'select'
+ && first { blessed($_->[1]) && $_->[1]->isa('DateTime') } @final_bind) {
+
+ carp_unique 'DateTime objects passed to search() are not supported '
+ . 'properly (InflateColumn::DateTime formats and settings are not '
+ . 'respected.) See "Formatting DateTime objects in queries" in '
+ . 'DBIx::Class::Manual::Cookbook';
+ }
+
($sql, \@final_bind);
}
$_->{dbd_attrs}
}
elsif($_->{sqlt_datatype}) {
- $self->bind_attribute_by_data_type($_->{sqlt_datatype}) || undef;
+ # cache the result in the dbh_details hash, as it can not change unless
+ # we connect to something else
+ my $cache = $self->_dbh_details->{_datatype_map_cache} ||= {};
+ if (not exists $cache->{$_->{sqlt_datatype}}) {
+ $cache->{$_->{sqlt_datatype}} = $self->bind_attribute_by_data_type($_->{sqlt_datatype}) || undef;
+ }
+ $cache->{$_->{sqlt_datatype}};
}
elsif ($sba_attrs and $_->{dbic_colname}) {
$sba_attrs->{$_->{dbic_colname}} || undef;
if ($data_type =~ /^(?:
l? (?:var)? char(?:acter)? (?:\s*varying)?
|
- (?:var)? binary (?:\s*varying)?
+ (?:var)? binary (?:\s*varying)?
|
raw
)\b/x