Fix a crash bug when SQLProcedureColumns() handles satisfies_hash_partition(). The...
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Thu, 26 Sep 2019 11:58:28 +0000 (20:58 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Fri, 4 Oct 2019 05:53:54 +0000 (14:53 +0900)
info.c
pgtypes.c
pgtypes.h

diff --git a/info.c b/info.c
index 307e2dd7490a55f93189b7e3f60c978b870926c9..f19032147ee1794e9685e7bc88293df6769c49c9 100644 (file)
--- a/info.c
+++ b/info.c
@@ -5111,33 +5111,33 @@ MYLOG(0, "atttypid=%s\n", atttypid ? atttypid : "(null)");
                set_tuplefield_int4(&tuple[PROCOLS_ORDINAL_POSITION], 0);
                set_tuplefield_string(&tuple[PROCOLS_IS_NULLABLE], NULL_STRING);
            }
+           paramcount = 0;
+           params = NULL;
            if (proargmodes)
            {
                const char *p;
 
-               paramcount = 0;
                for (p = proargmodes; *p; p++)
                {
                    if (',' == (*p))
                        paramcount++;
                }
                paramcount++;
-               params = QR_get_value_backend_text(tres, i, ext_pos + 2);
+               params = QR_get_value_backend_text(tres, i, ext_pos + 2); // proallargtypes - oidarray
                if ('{' == *proargmodes)
                    proargmodes++;
-               if ('{' == *params)
-                   params++;
            }
-           else
-           {
+           if (0 == paramcount)
                paramcount = QR_get_value_backend_int(tres, i, 3, NULL);
-               params = QR_get_value_backend_text(tres, i, 4);
-           }
+           if (0 < paramcount && NULL == params)
+               params = QR_get_value_backend_text(tres, i, 4); // proargtypes - oidvector
            if (proargnames)
            {
                if ('{' == *proargnames)
                    proargnames++;
            }
+           if (params && '{' == *params)
+               params++;
            /* PARAMETERS info */
            for (j = 0; j < paramcount; j++)
            {
index 5f49137ded57d142625f92e507b36f2f955808f2..bee10ecbbf9a29d19ba409004f0821189d310322 100644 (file)
--- a/pgtypes.c
+++ b/pgtypes.c
@@ -840,6 +840,14 @@ MYLOG(DETAIL_LOG_LEVEL, "pgtype_to_name int4\n");
            return "cidr";
        case PG_TYPE_UUID:
            return "uuid";
+       case PG_TYPE_VOID:
+           return "void";
+       case PG_TYPE_INT2VECTOR:
+           return "int2vector";
+       case PG_TYPE_OIDVECTOR:
+           return "oidvector";
+       case PG_TYPE_ANY:
+           return "any";
        case PG_TYPE_INTERVAL:
            get_interval_type(atttypmod, &tname);
            return tname;
index 2b120bd138c90821966e00105f35ba7d4e2cb4df..894b6d67ea1257c1a11df0bb9f81d982b8632921 100644 (file)
--- a/pgtypes.h
+++ b/pgtypes.h
@@ -61,6 +61,7 @@
 #define PG_TYPE_NUMERIC            1700
 #define PG_TYPE_REFCURSOR      1790
 #define PG_TYPE_RECORD         2249
+#define PG_TYPE_ANY            2276
 #define PG_TYPE_VOID           2278
 #define PG_TYPE_UUID           2950
 #define INTERNAL_ASIS_TYPE     (-9999)