[Bast-commits] r8734 - DBIx-Class/0.08/branches/oracle_quotes/lib/DBIx/Class/Storage/DBI/Oracle

faxm0dem at dev.catalyst.perl.org faxm0dem at dev.catalyst.perl.org
Wed Feb 17 17:54:45 GMT 2010


Author: faxm0dem
Date: 2010-02-17 17:54:45 +0000 (Wed, 17 Feb 2010)
New Revision: 8734

Modified:
   DBIx-Class/0.08/branches/oracle_quotes/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
Log:
still need to uc source_name if quotes off

Modified: DBIx-Class/0.08/branches/oracle_quotes/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm
===================================================================
--- DBIx-Class/0.08/branches/oracle_quotes/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm	2010-02-17 16:17:26 UTC (rev 8733)
+++ DBIx-Class/0.08/branches/oracle_quotes/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm	2010-02-17 17:54:45 UTC (rev 8734)
@@ -33,15 +33,15 @@
   my ($schema, $type, $version, $dir, $sqltargs, @rest) = @_;
 
   $sqltargs ||= {};
-	my $quote_char = $self->schema->storage->{'_sql_maker_opts'}->{'quote_char'};
-	$sqltargs->{quote_table_names} = 0 unless $quote_char;
-	$sqltargs->{quote_field_names} = 0 unless $quote_char;
+  my $quote_char = $self->schema->storage->{'_sql_maker_opts'}->{'quote_char'};
+  $sqltargs->{quote_table_names} = 0 unless $quote_char;
+  $sqltargs->{quote_field_names} = 0 unless $quote_char;
 
-	my $oracle_version = eval { $self->_get_dbh->get_info(18) };
+  my $oracle_version = eval { $self->_get_dbh->get_info(18) };
 
   $sqltargs->{producer_args}{oracle_version} = $oracle_version;
 
-	$self->next::method($schema, $type, $version, $dir, $sqltargs, @rest);
+  $self->next::method($schema, $type, $version, $dir, $sqltargs, @rest);
 }
 
 sub _dbh_last_insert_id {
@@ -58,9 +58,6 @@
 sub _dbh_get_autoinc_seq {
   my ($self, $dbh, $source, $col) = @_;
 
-	# check if quoting is on
-	my $quote_char = $self->schema->storage->{'_sql_maker_opts'}->{'quote_char'};
-
   # look up the correct sequence automatically
   my $sql = q{
     SELECT trigger_body FROM ALL_TRIGGERS t
@@ -81,8 +78,11 @@
   else {
       $source_name = ${$source->name};
   }
-	$source_name = uc($source_name) unless $quote_char;
 
+  unless ($self->schema->storage->{'_sql_maker_opts'}->{'quote_char'}) {
+    $source_name =  uc($source_name);
+  }
+
   # check for fully-qualified name (eg. SCHEMA.TABLENAME)
   if ( my ( $schema, $table ) = $source_name =~ /(\w+)\.(\w+)/ ) {
     $sql = q{
@@ -92,9 +92,8 @@
       AND t.status = 'ENABLED'
     };
     $sth = $dbh->prepare($sql);
-		my $table_name = $self -> sql_maker -> _quote($table);
-		#my $schema_name = $self -> sql_maker -> _quote($schema);
-		my $schema_name = uc($schema);
+  	my $table_name  = $self -> sql_maker -> _quote($table);
+  	my $schema_name = $self -> sql_maker -> _quote($schema);
 
     $sth->execute( $schema_name, $table_name );
   }




More information about the Bast-commits mailing list