From: Rafael Kitover Date: Thu, 14 Jan 2010 06:44:37 +0000 (+0000) Subject: rewrite _table_columns for Sybase as a join instead of sub-select X-Git-Tag: 0.04999_14~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9a55cbd2347924acadb4fde924a056a93e363dc1;p=dbsrgits%2FDBIx-Class-Schema-Loader.git rewrite _table_columns for Sybase as a join instead of sub-select --- diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm b/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm index cfcd57b..96e2fe5 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Sybase.pm @@ -59,7 +59,12 @@ sub _table_columns { 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; }