]> granicus.if.org Git - postgresql/commitdiff
Use SearchSysCacheTupleCopy() instead of SearchSysCacheTuple() in
authorHiroshi Inoue <inoue@tpf.co.jp>
Fri, 10 Nov 2000 09:38:21 +0000 (09:38 +0000)
committerHiroshi Inoue <inoue@tpf.co.jp>
Fri, 10 Nov 2000 09:38:21 +0000 (09:38 +0000)
order to continue to access the tuple more than now.
This would resolve a segmentation fault error.

src/backend/utils/adt/selfuncs.c

index f68b43badaf35f6833234a217f5348735f2edd92..818bc6ab082f8d83ac07576cf22016c5b846a170 100644 (file)
@@ -15,7 +15,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.80 2000/10/05 19:48:28 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.81 2000/11/10 09:38:21 inoue Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1250,7 +1250,7 @@ getattstatistics(Oid relid,
         * have at hand!  (For example, we might have a '>' operator rather
         * than the '<' operator that will appear in staop.)
         */
-       tuple = SearchSysCacheTuple(STATRELID,
+       tuple = SearchSysCacheTupleCopy(STATRELID,
                                                                ObjectIdGetDatum(relid),
                                                                Int16GetDatum((int16) attnum),
                                                                0,
@@ -1351,6 +1351,7 @@ getattstatistics(Oid relid,
                        pfree(strval);
                }
        }
+       heap_freetuple(tuple);
 
        return true;
 }