aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/relcache.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-08-28 03:36:31 +0000
committerBruce Momjian <bruce@momjian.us>1998-08-28 03:36:31 +0000
commita53ea467e10688a62cbf43d7bd9929f22932f9c4 (patch)
tree829b2857d9fbe5adf3cc2d599434f2a8dd4dbd34 /src/backend/utils/cache/relcache.c
parent602ac52d3ee453158c16b655835379c9a110f095 (diff)
downloadpostgresql-a53ea467e10688a62cbf43d7bd9929f22932f9c4.tar.gz
postgresql-a53ea467e10688a62cbf43d7bd9929f22932f9c4.zip
Hi all,
I don't know if this is really related to the initdb problem discussion (haven't followed it enough). But seems so because it fixes a damn problem during index tuple insertion on CREATE TABLE into pg_attribute_relid_attnum_index. Anyway - this bug was really hard to find. During startup the relcache reads in some prepared information about index strategies from a file and then reinitializes the function pointers inside the scanKey data. But for sake it assumed single attribute index tuples (hasn't that changed recently). Thus not all the strategies scanKey entries where initialized properly, resulting in invalid addresses for the btree comparision functions. With the patch at the end the regression tests passed excellent except for the sanity_check that crashed at vacuum and the misc test where the select unique1 from onek2 outputs the two rows in different order. Jan
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r--src/backend/utils/cache/relcache.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 432c65fdf37..5d30836a41f 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.47 1998/08/19 02:03:13 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.48 1998/08/28 03:36:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1982,10 +1982,11 @@ init_irels(void)
#define SMD(i) strat[0].strategyMapData[i].entry[0]
/* have to reinit the function pointers in the strategy maps */
- for (i = 0; i < am->amstrategies; i++)
+ for (i = 0; i < am->amstrategies * relform->relnatts; i++) {
fmgr_info(SMD(i).sk_procedure,
&(SMD(i).sk_func));
- SMD(i).sk_nargs = SMD(i).sk_func.fn_nargs;
+ SMD(i).sk_nargs = SMD(i).sk_func.fn_nargs;
+ }
/*