From: Matt S Trout Date: Wed, 25 Oct 2006 05:20:32 +0000 (+0000) Subject: Merge 'trunk' into 'DBIx-Class-current' X-Git-Tag: v0.08010~150^2~139 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=672c8df5fcf20b4c0894ccd3763702522a9f829d;p=dbsrgits%2FDBIx-Class.git Merge 'trunk' into 'DBIx-Class-current' r32855@cain (orig r2845): willert | 2006-10-18 20:33:43 +0000 Add myself to the contributors list r32856@cain (orig r2846): willert | 2006-10-18 20:37:23 +0000 Changed DBIC::Schema->load_classes to be taint-safe even when Module::Find is used to fetch the classes to import. Added a testfile for this behavior and any further taint related issues. r32857@cain (orig r2847): willert | 2006-10-18 20:40:15 +0000 Cosmetics: Changed DBIx::Class to fit into the global 2-space-indent convention r32858@cain (orig r2848): konobi | 2006-10-18 22:07:55 +0000 Hide documentation for deprecated modules from PAUSE. r32859@cain (orig r2849): matthewt | 2006-10-21 03:16:47 +0000 I hate you all. r33013@cain (orig r2850): matthewt | 2006-10-25 05:19:21 +0000 because this actually works --- 672c8df5fcf20b4c0894ccd3763702522a9f829d diff --cc lib/DBIx/Class.pm index 1639428,941739b..89a97bb --- a/lib/DBIx/Class.pm +++ b/lib/DBIx/Class.pm @@@ -13,14 -13,14 +13,14 @@@ sub component_base_class { 'DBIx::Class # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports # brain damage and presumably various other packaging systems too -$VERSION = '0.07002'; +$VERSION = '0.07999_01'; sub MODIFY_CODE_ATTRIBUTES { - my ($class,$code,@attrs) = @_; - $class->mk_classdata('__attr_cache' => {}) - unless $class->can('__attr_cache'); - $class->__attr_cache->{$code} = [@attrs]; - return (); + my ($class,$code,@attrs) = @_; + $class->mk_classdata('__attr_cache' => {}) + unless $class->can('__attr_cache'); + $class->__attr_cache->{$code} = [@attrs]; + return (); } sub _attr_cache { diff --cc lib/DBIx/Class/Storage/DBI/NoBindVars.pm index b965053,09a45f6..2877ee2 --- a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm +++ b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm @@@ -36,13 -34,41 +36,13 @@@ Manually subs in the values for the usu =cut -sub _execute { - my ($self, $op, $extra_bind, $ident, @args) = @_; - my ($sql, @bind) = $self->sql_maker->$op($ident, @args); - unshift(@bind, @$extra_bind) if $extra_bind; - if ($self->debug) { - my @debug_bind = map { defined $_ ? qq{'$_'} : q{'NULL'} } @bind; - $self->debugobj->query_start($sql, @debug_bind); - } - - $sql =~ s/\?/shift(@bind)/eg; - - my $sth = eval { $self->sth($sql,$op) }; - - if (!$sth || $@) { - $self->throw_exception( - 'no sth generated via sql (' . ($@ || $self->_dbh->errstr) . "): $sql" - ); - } - - my $rv; - if ($sth) { - my $time = time(); - $rv = eval { $sth->execute }; - - if ($@ || !$rv) { - $self->throw_exception("Error executing '$sql': ".($@ || $sth->errstr)); - } - } else { - $self->throw_exception("'$sql' did not generate a statement."); - } - if ($self->debug) { - my @debug_bind = map { defined $_ ? qq{`$_'} : q{`NULL'} } @bind; - $self->debugobj->query_end($sql, @debug_bind); - } - return (wantarray ? ($rv, $sth, @bind) : $rv); +sub _prep_for_execute { + my $self = shift; + my ($sql, @bind) = $self->next::method(@_); + - $sql =~ s/\?/$self->_dbh->quote($_)/e for (@bind); ++ $sql =~ s/\?/$self->_dbh->quote(shift(@bind))/eg; + + return ($sql); } =head1 AUTHORS