[svn:dbi] r14106 - dbi/trunk/lib/DBD

[email protected]
Newsgroups perl.dbi.changes
Message-ID <[email protected]>
Author: REHSACK
Date: Fri Jun  4 07:54:05 2010
New Revision: 14106

Modified:
   dbi/trunk/lib/DBD/File.pm

Log:
Prevent double initialization for already known table but different spelling

Modified: dbi/trunk/lib/DBD/File.pm
==============================================================================
--- dbi/trunk/lib/DBD/File.pm	(original)
+++ dbi/trunk/lib/DBD/File.pm	Fri Jun  4 07:54:05 2010
@@ -956,10 +956,16 @@
 	    $table = $meta->{table_name};
 	    }
 
-	# XXX check $dbh->{f_meta}{ $meta->{table_name} }
-	$self->init_table_meta ($dbh, $meta, $table);
-	$meta->{initialized} = 1;
-	$dbh->{f_meta}{$table} = $meta;
+	# now we know a bit more - let's check if user can't use consequent spelling
+	# XXX add know issue about reset sql_identifier_case here ...
+	if( exists( $dbh->{f_meta}{$table} ) ) {
+	    $meta = $dbh->{f_meta}{$table};
+	    }
+	else {
+	    $self->init_table_meta ($dbh, $meta, $table);
+	    $meta->{initialized} = 1;
+	    $dbh->{f_meta}{$table} = $meta;
+	    }
 	}
 
     return ($table, $meta);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.