Author: REHSACK
Date: Fri Oct  5 04:11:54 2012
New Revision: 15424

Modified:
   dbi/branches/sqlengine/Changes
   dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm
   dbi/branches/sqlengine/t/49dbd_file.t
   dbi/branches/sqlengine/t/50dbm_simple.t

Log:
Fix RT#72343 and add patches for it (Martin Evans, Jens Rehsack)


Modified: dbi/branches/sqlengine/Changes
==============================================================================
--- dbi/branches/sqlengine/Changes      (original)
+++ dbi/branches/sqlengine/Changes      Fri Oct  5 04:11:54 2012
@@ -24,6 +24,8 @@
   DBD::File Plugin-Support for table names and data sources
     (Jens Rehsack, #dbi Team)
 
+  Fix RT#72343 and add patches for it (Martin Evans, Jens Rehsack)
+
 =head2 Changes in DBI 1.622 (svn r15327) 6th June 2012
 
   Fixed lack of =encoding in non-ASCII pod docs. RT#77588

Modified: dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm
==============================================================================
--- dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm     (original)
+++ dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm     Fri Oct  5 04:11:54 2012
@@ -901,7 +901,8 @@
                                      NAME => $names,
                                   }
                                 );
-        $sth or $dbh->set_err( $DBI::stderr, $dbh2->errstr );
+        $sth or return $dbh->set_err( $DBI::stderr, $dbh2->errstr );
+       $sth->execute or return;
         return $sth;
     }    # table_info
 }

Modified: dbi/branches/sqlengine/t/49dbd_file.t
==============================================================================
--- dbi/branches/sqlengine/t/49dbd_file.t       (original)
+++ dbi/branches/sqlengine/t/49dbd_file.t       Fri Oct  5 04:11:54 2012
@@ -125,6 +125,10 @@
 my @tables = $dbh->func( "list_tables" );
 is_deeply( \@tables, ["000_just_testing", $tbl], "Listing tables gives test 
table" );
 
+ok ($sth = $dbh->table_info(), "table_info");
+@tables = $sth->fetchall_arrayref;
+is_deeply( \@tables, [ [ map { [ undef, undef, $_, 'TABLE', 'FILE' ] } 
("000_just_testing", $tbl) ] ], "table_info gives test table" );
+
 SKIP: {
     $using_dbd_gofer and skip "modifying meta data doesn't work with 
Gofer-AutoProxy", 4;
     ok ($dbh->f_set_meta ($tbl, "f_dir", $dir), "set single meta datum");

Modified: dbi/branches/sqlengine/t/50dbm_simple.t
==============================================================================
--- dbi/branches/sqlengine/t/50dbm_simple.t     (original)
+++ dbi/branches/sqlengine/t/50dbm_simple.t     Fri Oct  5 04:11:54 2012
@@ -258,6 +258,12 @@
        is( $sth->rows, scalar( @{$expected_rows} ), $sql );
        is_deeply( $allrows, $expected_rows, 'SELECT results' );
     }
+
+    my $sth = $dbh->table_info();
+    ok ($sth, "prepare table_info (without tables)");
+    my @tables = $sth->fetchall_arrayref;
+    is_deeply( \@tables, [ [] ], "No tables delivered by table_info" );
+
     $dbh->disconnect;
     return 1;
 }

Reply via email to