Committed by =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <[email protected]>

Subject: [DBD::Pg 1/2] Use correct SQL_BIGINT constant for int8

SQL_BIGINT has been exported by DBI since version 1.54, so bump the
version requirement and use that instead of the incorrect SQL_DOUBLE.
---
 Makefile.PL | 2 +-
 Pg.pm       | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Makefile.PL b/Makefile.PL
index 1510ea2..e462846 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -204,7 +204,7 @@ my %opts =
      ABSTRACT       => 'PostgreSQL database driver for the DBI module',
      PREREQ_PM      => {
                         'ExtUtils::MakeMaker' => '6.11',
-                        'DBI'                 => '1.52',
+                        'DBI'                 => '1.54',
                         'Test::More'          => '0.61',
                         'Time::HiRes'         => '0',
                         'version'             => '0',
diff --git a/Pg.pm b/Pg.pm
index c620d21..da2b308 100644
--- a/Pg.pm
+++ b/Pg.pm
@@ -1345,8 +1345,8 @@ use 5.006001;
              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_DOUBLE,        20,   $UN,$UN,   $UN,  1,0,2, 0,0,0,   
'LONGINT',   0,0,
-             SQL_DOUBLE,                                                       
            $UN, $UN, $UN ],
+['int8',     SQL_BIGINT,        20,   $UN,$UN,   $UN,  1,0,2, 0,0,0,   
'LONGINT',   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 ],
 ['tinterval',SQL_TIME,          18,   q{'},q{'}, $UN,  1,0,2, $UN,0,0, 
'TINTERVAL', 0,6,
@@ -1386,7 +1386,7 @@ use 5.006001;
 
        # Set up lookup for SQL types we don't want to escape.
        my %no_escape = map { $_ => 1 }
-               DBI::SQL_INTEGER, DBI::SQL_SMALLINT, DBI::SQL_DECIMAL,
+               DBI::SQL_INTEGER, DBI::SQL_SMALLINT, DBI::SQL_BIGINT, 
DBI::SQL_DECIMAL,
                DBI::SQL_FLOAT, DBI::SQL_REAL, DBI::SQL_DOUBLE, 
DBI::SQL_NUMERIC;
 
        sub get_info {
@@ -3006,7 +3006,7 @@ according to the following table:
   | varchar       | VARCHAR(n)                         |
   | int2          | SMALLINT                           |
   | int4          | INT                                |
-  | int8          | /                                  |
+  | int8          | BIGINT                             |
   | money         | /                                  |
   | float4        | FLOAT(p)   p<7=float4, p<16=float8 |
   | float8        | REAL                               |
-- 
1.8.4

Reply via email to