From 9c22d5d75decf6583fbe965bc1f695a4475e7724 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Fri, 11 May 2012 22:55:36 +0000 Subject: [PATCH] Improve the handling of ARRAY type. --- pgtypes.c | 8 ++++++++ pgtypes.h | 1 + version.h | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pgtypes.c b/pgtypes.c index c06b2b0..a80f26a 100644 --- a/pgtypes.c +++ b/pgtypes.c @@ -310,6 +310,12 @@ inolog("!!! catalog_result=%d\n", handle_unknown_size_as); return adtsize_or_longestlen; return maxsize; } + if (TYPE_MAY_BE_ARRAY(type)) + { + if (adtsize_or_longestlen > 0) + return adtsize_or_longestlen; + return maxsize; + } inolog("!!! adtsize_or_logngest=%d\n", adtsize_or_longestlen); p = adtsize_or_longestlen; /* longest */ @@ -1618,6 +1624,7 @@ getNumericColumnSize(const StatementClass *stmt, OID type, int col) } } +#ifdef NOT_USED Int4 getCharColumnSize(const StatementClass *stmt, OID type, int col, int handle_unknown_size_as) { @@ -1737,6 +1744,7 @@ getCharColumnSize(const StatementClass *stmt, OID type, int col, int handle_unkn maxsize = p; return maxsize; } +#endif /* NOT_USED */ static SQLSMALLINT getTimestampDecimalDigits(const StatementClass *stmt, OID type, int col) diff --git a/pgtypes.h b/pgtypes.h index 7897b5c..f8911cb 100644 --- a/pgtypes.h +++ b/pgtypes.h @@ -80,6 +80,7 @@ #define PG_TYPE_UUID 2950 #define INTERNAL_ASIS_TYPE (-9999) +#define TYPE_MAY_BE_ARRAY(type) ((type) == PG_TYPE_XMLARRAY || ((type) >= 1000 && (type) <= 1041)) /* extern Int4 pgtypes_defined[]; */ extern SQLSMALLINT sqlTypes[]; diff --git a/version.h b/version.h index 6beda47..4bc40bf 100644 --- a/version.h +++ b/version.h @@ -12,6 +12,6 @@ #define POSTGRESDRIVERVERSION "09.01.0101" #define POSTGRES_RESOURCE_VERSION "09.01.0101\0" #define PG_DRVFILE_VERSION 9,1,01,01 -#define PG_BUILD_VERSION "201205120002" +#define PG_BUILD_VERSION "201205120003" #endif -- 2.39.5