[Bast-commits] r6665 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sat Jun 13 17:31:56 GMT 2009
Author: ribasushi
Date: 2009-06-13 17:31:55 +0000 (Sat, 13 Jun 2009)
New Revision: 6665
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
Log:
really local()ize for as the author intended
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2009-06-13 16:13:54 UTC (rev 6664)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2009-06-13 17:31:55 UTC (rev 6665)
@@ -1191,13 +1191,25 @@
sub _select {
my $self = shift;
+
+ # localization is neccessary as
+ # 1) there is no infrastructure to pass this around (easy to do, but will wait)
+ # 2) _select_args sets it and _prep_for_execute consumes it
my $sql_maker = $self->sql_maker;
+ local $sql_maker->{for};
+
return $self->_execute($self->_select_args(@_));
}
sub _select_args_to_query {
my $self = shift;
+ # localization is neccessary as
+ # 1) there is no infrastructure to pass this around (easy to do, but will wait)
+ # 2) _select_args sets it and _prep_for_execute consumes it
+ my $sql_maker = $self->sql_maker;
+ local $sql_maker->{for};
+
# my ($op, $bind, $ident, $bind_attrs, $select, $cond, $order, $rows, $offset)
# = $self->_select_args($ident, $select, $cond, $attrs);
my ($op, $bind, $ident, $bind_attrs, @args) =
@@ -1212,11 +1224,9 @@
sub _select_args {
my ($self, $ident, $select, $condition, $attrs) = @_;
- my $for = delete $attrs->{for};
my $sql_maker = $self->sql_maker;
+ $sql_maker->{for} = delete $attrs->{for};
- local $sql_maker->{for} = $for;
-
my $order = { map
{ $attrs->{$_} ? ( $_ => $attrs->{$_} ) : () }
(qw/order_by group_by having _virtual_order_by/ )
More information about the Bast-commits
mailing list