[Bast-commits] r6864 - in
branches/DBIx-Class-Schema-Loader/mssql_tweaks:
lib/DBIx/Class/Schema/Loader t
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Tue Jun 30 00:39:46 GMT 2009
Author: caelum
Date: 2009-06-30 00:39:46 +0000 (Tue, 30 Jun 2009)
New Revision: 6864
Modified:
branches/DBIx-Class-Schema-Loader/mssql_tweaks/lib/DBIx/Class/Schema/Loader/Base.pm
branches/DBIx-Class-Schema-Loader/mssql_tweaks/t/17mssql_odbc_dot_in_table_name.t
Log:
quote table names that include name_sep
Modified: branches/DBIx-Class-Schema-Loader/mssql_tweaks/lib/DBIx/Class/Schema/Loader/Base.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/mssql_tweaks/lib/DBIx/Class/Schema/Loader/Base.pm 2009-06-30 00:18:30 UTC (rev 6863)
+++ branches/DBIx-Class-Schema-Loader/mssql_tweaks/lib/DBIx/Class/Schema/Loader/Base.pm 2009-06-30 00:39:46 UTC (rev 6864)
@@ -672,8 +672,15 @@
my $table_class = $self->classes->{$table};
my $table_moniker = $self->monikers->{$table};
- $self->_dbic_stmt($table_class,'table',$table);
+ my $table_name = $table;
+ my $name_sep = $self->schema->storage->sql_maker->name_sep;
+ if ($table_name =~ /\Q$name_sep\E/) {
+ $table_name = \ $self->_quote_table_name($table_name);
+ }
+
+ $self->_dbic_stmt($table_class,'table',$table_name);
+
my $cols = $self->_table_columns($table);
my $col_info;
eval { $col_info = $self->_columns_info_for($table) };
Modified: branches/DBIx-Class-Schema-Loader/mssql_tweaks/t/17mssql_odbc_dot_in_table_name.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/mssql_tweaks/t/17mssql_odbc_dot_in_table_name.t 2009-06-30 00:18:30 UTC (rev 6863)
+++ branches/DBIx-Class-Schema-Loader/mssql_tweaks/t/17mssql_odbc_dot_in_table_name.t 2009-06-30 00:39:46 UTC (rev 6864)
@@ -48,13 +48,10 @@
ok !$@, 'table name with . parsed correctly';
diag $@ if $@;
-## this doesn't work either
-system qq{$^X -pi -e 's/"test\.dot"/\\\\"[test.dot]"/' t/_common_dump/TestSL/Schema/Result/TestDot.pm};
-
+#system qq{$^X -pi -e 's/"test\.dot"/\\\\"[test.dot]"/' t/_common_dump/TestSL/Schema/Result/TestDot.pm};
#diag do { local ($/, @ARGV) = (undef, "t/_common_dump/TestSL/Schema/Result/TestDot.pm"); <> };
+#do "t/_common_dump/TestSL/Schema/Result/TestDot.pm";
-do "t/_common_dump/TestSL/Schema/Result/TestDot.pm";
-
eval 'use TestSL::Schema';
ok !$@, 'loaded schema';
diag $@ if $@;
@@ -74,6 +71,6 @@
diag $@ if $@;
}
-#rmtree $DUMP_DIR;
+rmtree $DUMP_DIR;
$dbh->do('DROP TABLE [test.dot]');
More information about the Bast-commits
mailing list