summaryrefslogtreecommitdiff
path: root/src/backend/catalog/genbki.sh
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1996-08-21 04:25:49 +0000
committerMarc G. Fournier <scrappy@hub.org>1996-08-21 04:25:49 +0000
commit5e773a4f70dd07d57e07cfbc856e7822dc6defdc (patch)
treec3f48a6caf8e9130a107c84589f9f6c675c2224e /src/backend/catalog/genbki.sh
parent93ad36fdc2b7ebe3147cb0003e14d9832ef4543e (diff)
downloadpostgresql-5e773a4f70dd07d57e07cfbc856e7822dc6defdc.tar.gz
Here's a patch for Versions 1 and 2 that fixes the following bug:
When you try to do any UPDATE of the catalog class pg_class, such as to change ownership of a class, the backend crashes. This is really two serial bugs: 1) there is a hardcoded copy of the schema of pg_class in the postgres program, and it doesn't match the actual class that initdb creates in the database; 2) Parts of postgres determine whether to pass an attribute value by value or by reference based on the attbyval attribute of the attribute in class pg_attribute. Other parts of postgres have it hardcoded. For the relacl[] attribute in class pg_class, attbyval does not match the hardcoded expectation. The fix is to correct the hardcoded schema for pg_attribute and to change the fetchatt macro so it ignores attbyval for all variable length attributes. The fix also adds a bunch of logic documentation and extends genbki.sh so it allows source files to contain such documentation. -- Bryan Henderson Phone 408-227-6803 San Jose, California
Diffstat (limited to 'src/backend/catalog/genbki.sh')
-rw-r--r--src/backend/catalog/genbki.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/backend/catalog/genbki.sh b/src/backend/catalog/genbki.sh
index d8f5d29025..c42beff980 100644
--- a/src/backend/catalog/genbki.sh
+++ b/src/backend/catalog/genbki.sh
@@ -10,7 +10,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh,v 1.2 1996/08/19 13:52:02 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh,v 1.3 1996/08/21 04:25:44 scrappy Exp $
#
# NOTES
# non-essential whitespace is removed from the generated file.
@@ -58,8 +58,11 @@ done
cat $SYSFILES | \
sed -e 's/\/\*.*\*\///g' \
-e 's/;[ ]*$//g' \
+ -e 's/^[ ]*//g' \
-e 's/\ Oid/\ oid/g' \
-e 's/\ NameData/\ name/g' \
+ -e 's/^Oid/oid/g' \
+ -e 's/^NameData/\name/g' \
-e 's/(NameData/(name/g' \
-e 's/(Oid/(oid/g' | \
gawk '
@@ -78,9 +81,22 @@ BEGIN {
bootstrap = 0;
nc = 0;
reln_open = 0;
+ comment_level = 0;
}
# ----------------
+# Anything in a /* .. */ block should be ignored.
+# Blank lines also go.
+# Note that any /* */ comment on a line by itself was removed from the line
+# by the sed above.
+# ----------------
+/^\/\*/ { comment_level += 1; next; }
+/^*\// { comment_level -= 1; next; }
+comment_level > 0 { next; }
+
+/^[ ]*$/ { next; }
+
+# ----------------
# anything in a BKI_BEGIN .. BKI_END block should be passed
# along without interpretation.
# ----------------