r38061 - in /trunk/libdbix-class-perl: Changes META.yml debian/changelog lib/DBIx/Class.pm lib/DBIx/Class/Manual/Cookbook.pod lib/DBIx/Class/ResultSet.pm lib/DBIx/Class/Storage/DBI.pm t/60core.t t/95sql_maker.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Fri Jun 12 14:38:34 UTC 2009
Author: jawnsy-guest
Date: Fri Jun 12 14:38:27 2009
New Revision: 38061
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=38061
Log:
-> This version fixes core regressions, which is a subtle bug because
the module just starts to return bad data... Recommend upgrade
immediately.
Modified:
trunk/libdbix-class-perl/Changes
trunk/libdbix-class-perl/META.yml
trunk/libdbix-class-perl/debian/changelog
trunk/libdbix-class-perl/lib/DBIx/Class.pm
trunk/libdbix-class-perl/lib/DBIx/Class/Manual/Cookbook.pod
trunk/libdbix-class-perl/lib/DBIx/Class/ResultSet.pm
trunk/libdbix-class-perl/lib/DBIx/Class/Storage/DBI.pm
trunk/libdbix-class-perl/t/60core.t
trunk/libdbix-class-perl/t/95sql_maker.t
Modified: trunk/libdbix-class-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-class-perl/Changes?rev=38061&op=diff
==============================================================================
--- trunk/libdbix-class-perl/Changes (original)
+++ trunk/libdbix-class-perl/Changes Fri Jun 12 14:38:27 2009
@@ -1,4 +1,9 @@
Revision history for DBIx::Class
+
+0.08106 2009-06-11 21:42:00 (UTC)
+ - Switched SQLite storage driver to DateTime::Format::SQLite
+ (proper timezone handling)
+ - Fix more test problems
0.08105 2009-06-11 19:04:00 (UTC)
- Update of numeric columns now properly uses != to determine
Modified: trunk/libdbix-class-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-class-perl/META.yml?rev=38061&op=diff
==============================================================================
--- trunk/libdbix-class-perl/META.yml (original)
+++ trunk/libdbix-class-perl/META.yml Fri Jun 12 14:38:27 2009
@@ -50,4 +50,4 @@
MailingList: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
license: http://dev.perl.org/licenses/
repository: http://dev.catalyst.perl.org/svnweb/bast/browse/DBIx-Class/
-version: 0.08105
+version: 0.08106
Modified: trunk/libdbix-class-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-class-perl/debian/changelog?rev=38061&op=diff
==============================================================================
--- trunk/libdbix-class-perl/debian/changelog (original)
+++ trunk/libdbix-class-perl/debian/changelog Fri Jun 12 14:38:27 2009
@@ -1,7 +1,10 @@
-libdbix-class-perl (0.08105-1) unstable; urgency=low
+libdbix-class-perl (0.08106-1) unstable; urgency=low
[ Jonathan Yu ]
* New upstream release (many bugfixes, no feature changes)
+ -> This version fixes core regressions, which is a subtle bug because
+ the module just starts to return bad data... Recommend upgrade
+ immediately.
* Added /me to uploaders & copyright
* Updated M::I information
Modified: trunk/libdbix-class-perl/lib/DBIx/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-class-perl/lib/DBIx/Class.pm?rev=38061&op=diff
==============================================================================
--- trunk/libdbix-class-perl/lib/DBIx/Class.pm (original)
+++ trunk/libdbix-class-perl/lib/DBIx/Class.pm Fri Jun 12 14:38:27 2009
@@ -24,7 +24,7 @@
# 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.08105';
+$VERSION = '0.08106';
$VERSION = eval $VERSION; # numify for warning-free dev releases
Modified: trunk/libdbix-class-perl/lib/DBIx/Class/Manual/Cookbook.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-class-perl/lib/DBIx/Class/Manual/Cookbook.pod?rev=38061&op=diff
==============================================================================
--- trunk/libdbix-class-perl/lib/DBIx/Class/Manual/Cookbook.pod (original)
+++ trunk/libdbix-class-perl/lib/DBIx/Class/Manual/Cookbook.pod Fri Jun 12 14:38:27 2009
@@ -279,7 +279,7 @@
my $count = $rs->count;
# Equivalent SQL:
- # SELECT COUNT( DISTINCT( me.name ) ) FROM artist me
+ # SELECT COUNT( * ) FROM (SELECT me.name FROM artist me GROUP BY me.name) count_subq:
=head2 Grouping results
Modified: trunk/libdbix-class-perl/lib/DBIx/Class/ResultSet.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-class-perl/lib/DBIx/Class/ResultSet.pm?rev=38061&op=diff
==============================================================================
--- trunk/libdbix-class-perl/lib/DBIx/Class/ResultSet.pm (original)
+++ trunk/libdbix-class-perl/lib/DBIx/Class/ResultSet.pm Fri Jun 12 14:38:27 2009
@@ -1927,7 +1927,13 @@
sub as_query {
my $self = shift;
- return $self->result_source->storage->as_query($self->_resolved_attrs);
+
+ my $attrs = $self->_resolved_attrs_copy;
+
+ my ($sqlbind, $bind_attrs) = $self->result_source->storage
+ ->_select_args_to_query ($attrs->{from}, $attrs->{select}, $attrs->{where}, $attrs);
+
+ return $sqlbind;
}
=head2 find_or_new
Modified: trunk/libdbix-class-perl/lib/DBIx/Class/Storage/DBI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-class-perl/lib/DBIx/Class/Storage/DBI.pm?rev=38061&op=diff
==============================================================================
--- trunk/libdbix-class-perl/lib/DBIx/Class/Storage/DBI.pm (original)
+++ trunk/libdbix-class-perl/lib/DBIx/Class/Storage/DBI.pm Fri Jun 12 14:38:27 2009
@@ -910,37 +910,6 @@
return ($sql, \@bind);
}
-=head2 as_query
-
-=over 4
-
-=item Arguments: $rs_attrs
-
-=item Return Value: \[ $sql, @bind ]
-
-=back
-
-Returns the SQL statement and bind vars that would result from the given
-ResultSet attributes (does not actually run a query)
-
-=cut
-
-sub as_query {
- my ($self, $rs_attr) = @_;
-
- my $sql_maker = $self->sql_maker;
- local $sql_maker->{for};
-
- # my ($op, $bind, $ident, $bind_attrs, $select, $cond, $order, $rows, $offset) = $self->_select_args(...);
- my @args = $self->_select_args($rs_attr->{from}, $rs_attr->{select}, $rs_attr->{where}, $rs_attr);
-
- # my ($sql, $bind) = $self->_prep_for_execute($op, $bind, $ident, [ $select, $cond, $order, $rows, $offset ]);
- my ($sql, $bind) = $self->_prep_for_execute(
- @args[0 .. 2],
- [ @args[4 .. $#args] ],
- );
- return \[ "($sql)", @{ $bind || [] }];
-}
sub _fix_bind_params {
my ($self, @bind) = @_;
@@ -1225,6 +1194,23 @@
my $sql_maker = $self->sql_maker;
local $sql_maker->{for};
return $self->_execute($self->_select_args(@_));
+}
+
+sub _select_args_to_query {
+ my $self = shift;
+
+ 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) =
+ $self->_select_args(@_);
+
+ # my ($sql, $bind) = $self->_prep_for_execute($op, $bind, $ident, [ $select, $cond, $order, $rows, $offset ]);
+ my ($sql, $prepared_bind) = $self->_prep_for_execute($op, $bind, $ident, \@args);
+
+ return \[ "($sql)", @{ $prepared_bind || [] }];
}
sub _select_args {
Modified: trunk/libdbix-class-perl/t/60core.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-class-perl/t/60core.t?rev=38061&op=diff
==============================================================================
--- trunk/libdbix-class-perl/t/60core.t (original)
+++ trunk/libdbix-class-perl/t/60core.t Fri Jun 12 14:38:27 2009
@@ -11,7 +11,7 @@
plan tests => 106;
-eval { require DateTime::Format::MySQL };
+eval { require DateTime::Format::SQLite };
my $NO_DTFM = $@ ? 1 : 0;
my @art = $schema->resultset("Artist")->search({ }, { order_by => 'name DESC'});
@@ -195,7 +195,7 @@
# get_inflated_columns w/relation and accessor alias
SKIP: {
- skip "This test requires DateTime::Format::MySQL", 8 if $NO_DTFM;
+ skip "This test requires DateTime::Format::SQLite", 8 if $NO_DTFM;
isa_ok($new->updated_date, 'DateTime', 'have inflated object via accessor');
my %tdata = $new->get_inflated_columns;
@@ -389,7 +389,7 @@
# test get_inflated_columns with objects
SKIP: {
- skip "This test requires DateTime::Format::MySQL", 5 if $NO_DTFM;
+ skip "This test requires DateTime::Format::SQLite", 5 if $NO_DTFM;
my $event = $schema->resultset('Event')->search->first;
my %edata = $event->get_inflated_columns;
is($edata{'id'}, $event->id, 'got id');
Modified: trunk/libdbix-class-perl/t/95sql_maker.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdbix-class-perl/t/95sql_maker.t?rev=38061&op=diff
==============================================================================
--- trunk/libdbix-class-perl/t/95sql_maker.t (original)
+++ trunk/libdbix-class-perl/t/95sql_maker.t Fri Jun 12 14:38:27 2009
@@ -51,6 +51,7 @@
# Make sure the carp/croak override in SQLA works (via SQLAHacks)
my $file = __FILE__;
+$file = "\Q$file\E";
throws_ok (sub {
$schema->resultset ('Artist')->search ({}, { order_by => { -asc => 'stuff', -desc => 'staff' } } )->as_query;
}, qr/$file/, 'Exception correctly croak()ed');
More information about the Pkg-perl-cvs-commits
mailing list