[Bast-commits] r6595 -
DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Wed Jun 10 12:04:20 GMT 2009
Author: caelum
Date: 2009-06-10 12:04:19 +0000 (Wed, 10 Jun 2009)
New Revision: 6595
Modified:
DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/NoBindVars.pm
Log:
cache rsrc in NoBindVars, use name_sep
Modified: DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/NoBindVars.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/NoBindVars.pm 2009-06-10 11:46:37 UTC (rev 6594)
+++ DBIx-Class/0.08/branches/sybase/lib/DBIx/Class/Storage/DBI/NoBindVars.pm 2009-06-10 12:04:19 UTC (rev 6595)
@@ -50,15 +50,22 @@
my @sql_part = split /\?/, $sql;
my $new_sql;
+ my $result_sources = {};
+
foreach my $bound (@$bind) {
my $col = shift @$bound;
- $col =~ s/^([^.]*)\.//;
+ my $name_sep = $self->_sql_maker_opts->{name_sep} || '.';
+
+ $col =~ s/^([^\Q${name_sep}\E]*)\Q${name_sep}\E//;
my $alias = $1 || 'me';
- my $datatype = $self->_resolve_ident_sources($ident)->{$alias}
- ->column_info($col)->{data_type};
+ $result_sources->{$alias} ||=
+ $self->_resolve_ident_sources($ident)->{$alias};
+ my $rsrc = $result_sources->{$alias};
+ my $datatype = $rsrc->column_info($col)->{data_type};
+
foreach my $data (@$bound) {
if(ref $data) {
$data = ''.$data;
More information about the Bast-commits
mailing list