From d6cf82efb05676e198bfde2ca4ea75447e143f54 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 17 Jul 2009 04:30:11 +0000 Subject: [PATCH] +support for BigInt(int8) datatype in postgres, closes #384 --- include/mapnik/global.hpp | 8 ++++++++ plugins/input/postgis/postgisfs.cpp | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/include/mapnik/global.hpp b/include/mapnik/global.hpp index d7a1f276a..1e7c9e89b 100644 --- a/include/mapnik/global.hpp +++ b/include/mapnik/global.hpp @@ -46,6 +46,14 @@ namespace mapnik (((boost::uint32_t) ((boost::uint8_t) (A)[1])) << 16) | \ (((boost::uint32_t) ((boost::uint8_t) (A)[0])) << 24)) +#define int8net(A) (int64_t) (((boost::uint64_t) ((boost::uint8_t) (A)[7])) | \ + (((boost::uint64_t) ((boost::uint8_t) (A)[6])) << 8) | \ + (((boost::uint64_t) ((boost::uint8_t) (A)[5])) << 16) | \ + (((boost::uint64_t) ((boost::uint8_t) (A)[4])) << 24) | \ + (((boost::uint64_t) ((boost::uint8_t) (A)[3])) << 32) | \ + (((boost::uint64_t) ((boost::uint8_t) (A)[2])) << 40) | \ + (((boost::uint64_t) ((boost::uint8_t) (A)[1])) << 48) | \ + (((boost::uint64_t) ((boost::uint8_t) (A)[0])) << 56)) typedef boost::uint8_t byte; #define float8net(V,M) do { double def_temp; \ diff --git a/plugins/input/postgis/postgisfs.cpp b/plugins/input/postgis/postgisfs.cpp index 847d24f13..26344c922 100644 --- a/plugins/input/postgis/postgisfs.cpp +++ b/plugins/input/postgis/postgisfs.cpp @@ -125,6 +125,11 @@ feature_ptr postgis_featureset::next() int val = int2net(buf); boost::put(*feature,name,val); } + else if (oid==20) //int8/BigInt + { + int val = int8net(buf); + boost::put(*feature,name,val); + } else if (oid == 700) // float4 { float val;