use Context::Preserve 'preserve_context';
use Try::Tiny;
use Data::Compare (); # no imports!!! guard against insane architecture
-use DBIx::Class::_Util qw(is_plain_value is_literal_value);
+use SQL::Abstract qw(is_plain_value is_literal_value);
use namespace::clean;
# default cursor class, overridable in connect_info attributes
);
}
else {
+ # FIXME SUBOPTIMAL - DBI needs fixing to always stringify regardless of DBD
+ my $v = ( length ref $bind->[$i][1] and is_plain_value $bind->[$i][1] )
+ ? "$bind->[$i][1]"
+ : $bind->[$i][1]
+ ;
+
$sth->bind_param(
$i + 1,
- $bind->[$i][1],
+ # The temp-var is CRUCIAL - DO NOT REMOVE IT, breaks older DBD::SQLite RT#79576
+ $v,
$bind_attrs->[$i],
);
}
my @col_range = (0..$#$cols);
+ # FIXME SUBOPTIMAL - DBI needs fixing to always stringify regardless of DBD
+ # For the time being forcibly stringify whatever is stringifiable
+ # ResultSet::populate() hands us a copy - safe to mangle
+ for my $r (0 .. $#$data) {
+ for my $c (0 .. $#{$data->[$r]}) {
+ $data->[$r][$c] = "$data->[$r][$c]"
+ if ( length ref $data->[$r][$c] and is_plain_value $data->[$r][$c] );
+ }
+ }
+
my $colinfos = $source->columns_info($cols);
local $self->{_autoinc_supplied_for_op} =
#) if $orig_attrs->{!args_as_stored_at_the_end_of_this_method!};
my $sql_maker = $self->sql_maker;
- my $alias2source = $self->_resolve_ident_sources ($ident);
my $attrs = {
%$orig_attrs,
select => $select,
from => $ident,
where => $where,
-
- # limit dialects use this stuff
- # yes, some CDBICompat crap does not supply an {alias} >.<
- ( $orig_attrs->{alias} and $alias2source->{$orig_attrs->{alias}} )
- ? ( _rsroot_rsrc => $alias2source->{$orig_attrs->{alias}} )
- : ()
- ,
};
# Sanity check the attributes (SQLMaker does it too, but
$orig_attrs->{_last_sqlmaker_alias_map} = $attrs->{_aliastypes};
###
+ # my $alias2source = $self->_resolve_ident_sources ($ident);
+ #
# This would be the point to deflate anything found in $attrs->{where}
# (and leave $attrs->{bind} intact). Problem is - inflators historically
# expect a result object. And all we have is a resultsource (it is trivial