[Bast-commits] r8304 -
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Thu Jan 14 06:44:37 GMT 2010
Author: caelum
Date: 2010-01-14 06:44:37 +0000 (Thu, 14 Jan 2010)
New Revision: 8304
Modified:
branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm
Log:
rewrite _table_columns for Sybase as a join instead of sub-select
Modified: branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm 2010-01-14 05:35:11 UTC (rev 8303)
+++ branches/DBIx-Class-Schema-Loader/current/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm 2010-01-14 06:44:37 UTC (rev 8304)
@@ -59,7 +59,12 @@
my ($self, $table) = @_;
my $dbh = $self->schema->storage->dbh;
- my $columns = $dbh->selectcol_arrayref(qq{SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name = @{[ $dbh->quote($table) ]} AND type = 'U')});
+ my $columns = $dbh->selectcol_arrayref(qq{
+SELECT c.name
+FROM syscolumns c JOIN sysobjects o
+ON c.id = o.id
+WHERE o.name = @{[ $dbh->quote($table) ]} AND o.type = 'U'
+});
return $columns;
}
More information about the Bast-commits
mailing list