Kevin L. Kane [Tue, 18 Nov 2014 13:02:33 +0000 (08:02 -0500)]
The genric _dbi_attrs_for_bind caches the attribute hashrefs by data
type, so we can't modify them directly with column-specific data.
Instead, copy it and add the ora_field attribute to the copy.
(cherry pick of
3d02b69a)
jshirley: J. Shirley <jshirley@gmail.com>
kaare: Kaare Rasmussen
kd: Kieren Diment <diment@gmail.com>
+kkane: Kevin L. Kane <kevin.kane@gmail.com>
konobi: Scott McWhirter <konobi@cpan.org>
lejeunerenard: Sean Zellmer <sean@lejeunerenard.com>
littlesavage: Alexey Illarionov <littlesavage@orionet.ru>
- Relax the 'self_result_object' argument check in the relationship
resolution codepath, restoring exotic uses of inflate_result
http://lists.scsys.co.uk/pipermail/dbix-class/2015-January/011876.html
+ - Fix updating multiple CLOB/BLOB columns on Oracle
* Misc
- Remove warning about potential side effects of RT#79576 (scheduled)
my $attrs = $self->next::method($ident, $bind);
- for my $i (0 .. $#$attrs) {
- if (keys %{$attrs->[$i]||{}} and my $col = $bind->[$i][0]{dbic_colname}) {
- $attrs->[$i]{ora_field} = $col;
- }
- }
+ # Push the column name into all bind attrs, make sure to *NOT* write into
+ # the existing $attrs->[$idx]{..} hashref, as it is cached by the call to
+ # next::method above.
+ $attrs->[$_]
+ and
+ keys %{ $attrs->[$_] }
+ and
+ $bind->[$_][0]{dbic_colname}
+ and
+ $attrs->[$_] = { %{$attrs->[$_]}, ora_field => $bind->[$_][0]{dbic_colname} }
+ for 0 .. $#$attrs;
$attrs;
}