Fix for length in libpq from Tom Lane.
authorBruce Momjian
Thu, 10 Sep 1998 15:18:06 +0000 (15:18 +0000)
committerBruce Momjian
Thu, 10 Sep 1998 15:18:06 +0000 (15:18 +0000)
src/interfaces/libpq/fe-exec.c
src/tools/backend/flow.fig
src/tools/backend/flow.jpg

index be563e24e606c1a332416a8e775a533ab325b7ed..5f889414e19752f15178ca7ae414b9451a800825 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.67 1998/09/04 05:03:02 momjian Exp $
+ *   $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.68 1998/09/10 15:18:02 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -541,6 +541,16 @@ getRowDescriptions(PGconn *conn)
            PQclear(result);
            return EOF;
        }
+       /*
+        * Since pqGetInt treats 2-byte integers as unsigned, we need to
+        * coerce the special value "-1" to signed form.  (-1 is sent for
+        * variable-length fields.)  Formerly, libpq effectively did a
+        * sign-extension on the 2-byte value by storing it in a signed short.
+        * Now we only coerce the single value 65535 == -1; values
+        * 32768..65534 are taken as valid field lengths.
+        */
+       if (typlen == 0xFFFF)
+           typlen = -1;
        result->attDescs[i].name = strdup(typName);
        result->attDescs[i].typid = typid;
        result->attDescs[i].typlen = typlen;
@@ -1488,7 +1498,7 @@ PQoidStatus(PGresult *res)
    if (strncmp(res->cmdStatus, "INSERT ", 7) != 0)
        return "";
 
-   /*
+   /*----------
     * The cmdStatus string looks like
     *     INSERT oid count\0
     * In order to be able to return an ordinary C string without
@@ -1498,6 +1508,7 @@ PQoidStatus(PGresult *res)
     *     INSERT oid count\0oid\0
     *                       ^ our return value points here
     * Pretty klugy eh?  This routine should've just returned an Oid value.
+    *----------
     */
 
    slen = strlen(res->cmdStatus);
index 013f11744d53f85b2df5483d0f73b3c05c4d3288..8840cedbbe3c01e355c105f007ffcc9e21585b05 100644 (file)
@@ -1,7 +1,11 @@
-#FIG 3.1
+#FIG 3.2
 Landscape
 Center
 Inches
+Letter  
+100.00
+Single
+-2
 1200 2
 2 1 0 2 29 7 0 0 -1 0.000 0 0 -1 1 1 2
    0 0 2.00 150.00 180.00
@@ -95,16 +99,16 @@ Inches
    0 0 2.00 150.00 150.00
     1350 9375 1050 9375 825 9000 825 4425 1050 4050 1500 3975
     2250 3975 2400 4275
+    0.000 1.000 1.000 1.000 1.000 1.000 1.000 0.000
 3 0 0 2 8 7 0 0 -1 0.000 0 1 0 7
    0 0 2.00 150.00 150.00
     7650 5775 8250 5475 8250 4575 7725 3975 3525 3975 2850 3975
     2700 4275
+    0.000 1.000 1.000 1.000 1.000 1.000 0.000
 3 2 2 2 20 7 0 0 -1 6.000 1 1 0 5
    0 0 2.00 150.00 180.00
     2550 2175 3225 2475 5400 2550 6225 2625 6450 2775
-    0.00 0.00 2927.81 2370.42 3096.56 2445.42 3729.54 2591.19
-    4904.72 2518.98 5588.53 2561.81 6033.83 2557.52 6271.80 2641.52
-    6328.05 2679.02 0.00 0.00
+    0.000 -1.000 -1.000 -1.000 0.000
 4 1 -1 0 0 16 18 0.0000 4 210 900 1560 11190 Utilities\001
 4 1 -1 0 0 16 18 0.0000 4 270 2265 7965 11190 Storage Managers\001
 4 1 -1 0 0 16 18 0.0000 4 270 960 4725 11175 Catalog\001
index 3976df866c6b9b335bdb214e0e8622e7443c325a..1152edfdf6e3eba2f5623024d83ba675a6ac485a 100644 (file)
Binary files a/src/tools/backend/flow.jpg and b/src/tools/backend/flow.jpg differ