[Bast-commits] r6859 - in DBIx-Class/0.08/branches/table_name_ref:
lib/DBIx/Class/Storage/DBI t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Mon Jun 29 22:03:21 GMT 2009
Author: ribasushi
Date: 2009-06-29 22:03:21 +0000 (Mon, 29 Jun 2009)
New Revision: 6859
Modified:
DBIx-Class/0.08/branches/table_name_ref/lib/DBIx/Class/Storage/DBI/Pg.pm
DBIx-Class/0.08/branches/table_name_ref/t/76select.t
Log:
Minor fixes
Modified: DBIx-Class/0.08/branches/table_name_ref/lib/DBIx/Class/Storage/DBI/Pg.pm
===================================================================
--- DBIx-Class/0.08/branches/table_name_ref/lib/DBIx/Class/Storage/DBI/Pg.pm 2009-06-29 21:49:25 UTC (rev 6858)
+++ DBIx-Class/0.08/branches/table_name_ref/lib/DBIx/Class/Storage/DBI/Pg.pm 2009-06-29 22:03:21 UTC (rev 6859)
@@ -51,11 +51,19 @@
sub get_autoinc_seq {
my ($self,$source,$col) = @_;
-
+
my @pri = $source->primary_columns;
- my ($schema,$table) = $source->name =~ /^(.+)\.(.+)$/ ? ($1,$2)
- : (undef,$source->name);
+ my $schema;
+ my $table = $source->name;
+
+ if (ref $table eq 'SCALAR') {
+ $table = $$table;
+ }
+ elsif ($table =~ /^(.+)\.(.+)$/) {
+ ($schema, $table) = ($1, $2);
+ }
+
$self->dbh_do('_dbh_get_autoinc_seq', $schema, $table, @pri);
}
Modified: DBIx-Class/0.08/branches/table_name_ref/t/76select.t
===================================================================
--- DBIx-Class/0.08/branches/table_name_ref/t/76select.t 2009-06-29 21:49:25 UTC (rev 6858)
+++ DBIx-Class/0.08/branches/table_name_ref/t/76select.t 2009-06-29 22:03:21 UTC (rev 6859)
@@ -64,6 +64,7 @@
cmp_ok ($cds->count, '>', 2, 'Initially populated with more than 2 CDs');
my $table = $cds->result_source->name;
+$table = $$table if ref $table eq 'SCALAR';
my $subsel = $cds->search ({}, {
columns => [qw/cdid title/],
from => \ "(SELECT cdid, title FROM $table LIMIT 2) me",
More information about the Bast-commits
mailing list