Committed by Greg Sabino Mullane <[email protected]>

Subject: [DBD::Pg 2/2] Internal name should be INT8, not LONGINT

---
 Pg.pm         |  2 +-
 testme.tmp.pl | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/Pg.pm b/Pg.pm
index 1a6b49b..bf50d7e 100644
--- a/Pg.pm
+++ b/Pg.pm
@@ -1373,7 +1373,7 @@ use 5.008001;
              SQL_FLOAT,                                                        
            $UN, $UN, $UN ],
 ['float8',   SQL_REAL,          15,   $UN,$UN,   $PS,  1,0,2, 0,0,0,   'REAL', 
     0,15,
              SQL_REAL,                                                         
            $UN, $UN, $UN ],
-['int8',     SQL_BIGINT,        20,   $UN,$UN,   $UN,  1,0,2, 0,0,0,   
'LONGINT',   0,0,
+['int8',     SQL_BIGINT,        20,   $UN,$UN,   $UN,  1,0,2, 0,0,0,   'INT8', 
  0,0,
              SQL_BIGINT,                                                       
            $UN, $UN, $UN ],
 ['date',     SQL_DATE,          10,   q{'},q{'}, $UN,  1,0,2, $UN,0,0, 'DATE', 
     0,0,
              SQL_DATE,                                                         
            $UN, $UN, $UN ],
diff --git a/testme.tmp.pl b/testme.tmp.pl
index 1b76eb4..a0a6e2e 100755
--- a/testme.tmp.pl
+++ b/testme.tmp.pl
@@ -41,7 +41,34 @@ sub user_arrays {
 
 print "User arrays!\n";
 
+print Dumper $dbh->type_info(-5);
 
+$dbh->do ("create table xx_test (c_test bigint)");
+my $sth = $dbh->prepare ("select * from xx_test");
+$sth->execute;
+DDumper ($sth->{TYPE}[0], $dbh->type_info ($sth->{TYPE}[0]));
+$dbh->do ("drop table xx_test");
+
+exit;
+
+$dbh->do('drop table if exists domodomo');
+$dbh->do('create domain domo as int[][]');
+$dbh->do('create table domodomo (id serial, foo domo)');
+$SQL = 'INSERT INTO domodomo(foo) VALUES (?)';
+$sth = $dbh->prepare($SQL);
+$sth->execute(q!{{1},{2}}!);
+
+$SQL = 'SELECT foo FROM domodomo';
+my $f = $dbh->prepare($SQL);
+$f->execute();
+my $res = $f->fetchall_arrayref();
+print Dumper $res;
+print $res->[0];
+
+$dbh->do("CREATE TYPE customint AS ENUM('1','2')");
+my $q2 = $dbh->prepare("SELECT '{1,2}'::customint[]");
+$q2->execute();
+print Dumper $q2->fetchrow_array(); # prints "{1,2}", not an array
 
 
 exit;
-- 
1.8.4

Reply via email to