Author: turnstep
Date: Mon Feb  4 19:46:04 2008
New Revision: 10689

Modified:
   DBD-Pg/trunk/Pg.pm

Log:
Account for multiple same-named tables in last_insert_id.
Write more tests to flush out that case and exercise pg_cache a bit.


Modified: DBD-Pg/trunk/Pg.pm
==============================================================================
--- DBD-Pg/trunk/Pg.pm  (original)
+++ DBD-Pg/trunk/Pg.pm  Mon Feb  4 19:46:04 2008
@@ -278,6 +278,9 @@
                                push @args, $schema;
                        }
                        $SQL = "SELECT c.oid FROM pg_catalog.pg_class c 
$schemajoin\n WHERE relname = ?$schemawhere";
+                       if (! length $schema) {
+                               $SQL .= " AND 
pg_catalog.pg_table_is_visible(c.oid)";
+                       }
                        $sth = $dbh->prepare_cached($SQL);
                        $count = $sth->execute(@args);
                        if (!defined $count or $count eq '0E0') {

Reply via email to