[Bast-commits] r8237 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Tue Jan 5 14:27:40 GMT 2010


Author: caelum
Date: 2010-01-05 14:27:40 +0000 (Tue, 05 Jan 2010)
New Revision: 8237

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
Log:
minor change: use more of the hash if possible for oracle table alias shortening

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm	2010-01-05 12:56:38 UTC (rev 8236)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm	2010-01-05 14:27:40 UTC (rev 8237)
@@ -305,9 +305,12 @@
 
   # truncate and prepend to truncated relname without vowels
   (my $devoweled = $relname) =~ s/[aeiou]//g;
-  my $res = substr($devoweled, 0, 18) . '_' . substr($md5, 0, 11);
+  my $shortened = substr($devoweled, 0, 18);
 
-  return $res;
+  my $new_alias =
+    $shortened . '_' . substr($md5, 0, 30 - length($shortened) - 1);
+
+  return $new_alias;
 }
 
 =head1 AUTHOR




More information about the Bast-commits mailing list