[svn:dbi] r14131 - dbi/trunk/t

[email protected]
Newsgroups perl.dbi.changes
Message-ID <[email protected]>
Author: REHSACK
Date: Thu Jun 10 04:20:18 2010
New Revision: 14131

Modified:
   dbi/trunk/t/51dbm_file.t

Log:
Add test workaround for Gofer limitation


Modified: dbi/trunk/t/51dbm_file.t
==============================================================================
--- dbi/trunk/t/51dbm_file.t	(original)
+++ dbi/trunk/t/51dbm_file.t	Thu Jun 10 04:20:18 2010
@@ -29,12 +29,23 @@
 rmtree $dir;
 mkpath $dir;
 
-$dbh->dbm_clear_meta( 'fred' ); # otherwise the col_names are still known!
-
-$dbh->{sql_identifier_case} = 2 unless ($using_dbd_gofer); # SQL_IC_LOWER
+if( $using_dbd_gofer )
+{
+    # can't modify attributes when connect through a Gofer instance
+    $dbh->disconnect();
+    $dbh = DBI->connect('dbi:DBM:', undef, undef, {
+	f_dir => $dir,
+	sql_identifier_case => 2, # SQL_IC_LOWER
+    } ); 
+}
+else
+{
+    $dbh->dbm_clear_meta( 'fred' ); # otherwise the col_names are still known!
+    $dbh->{sql_identifier_case} = 2; # SQL_IC_LOWER
+}
 
 $dbh->do(q/create table FRED (a integer, b integer)/);
-ok(-f File::Spec->catfile( $dir, "fred.dir" ), "fred.dir exists") unless $using_dbd_gofer;
+ok(-f File::Spec->catfile( $dir, "fred.dir" ), "fred.dir exists");
 
 ok($dbh->do(q/insert into fRED (a,b) values(1,2)/));
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.