diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-04-22 20:19:58 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-04-22 20:19:58 -0400 |
commit | bb850306307d3d6ebb611c4039ae127236eb1699 (patch) | |
tree | 94888ee1b7835594e86d26864a4f87b4d03d6fbf /contrib/btree_gist/btree_utils_var.h | |
parent | ae20bf1740c53494e15fadfd8c2c6444032a3441 (diff) | |
download | postgresql-bb850306307d3d6ebb611c4039ae127236eb1699.tar.gz postgresql-bb850306307d3d6ebb611c4039ae127236eb1699.zip |
Fix contrib/btree_gist to handle collations properly.
Make use of the collation attached to the index column, instead of
hard-wiring DEFAULT_COLLATION_OID. (Note: in theory this could require
reindexing btree_gist indexes on textual columns, but I rather doubt anyone
has one with a non-default declared collation as yet.)
Diffstat (limited to 'contrib/btree_gist/btree_utils_var.h')
-rw-r--r-- | contrib/btree_gist/btree_utils_var.h | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/contrib/btree_gist/btree_utils_var.h b/contrib/btree_gist/btree_utils_var.h index 2c1012f3235..fe91d122e67 100644 --- a/contrib/btree_gist/btree_utils_var.h +++ b/contrib/btree_gist/btree_utils_var.h @@ -18,18 +18,9 @@ typedef struct *upper; } GBT_VARKEY_R; -/* used for key sorting */ -typedef struct -{ - int i; - GBT_VARKEY *t; -} Vsrt; - /* - type description -*/ - - + * type description + */ typedef struct { @@ -42,12 +33,12 @@ typedef struct /* Methods */ - bool (*f_gt) (const void *, const void *); /* greater then */ - bool (*f_ge) (const void *, const void *); /* greater equal */ - bool (*f_eq) (const void *, const void *); /* equal */ - bool (*f_le) (const void *, const void *); /* less equal */ - bool (*f_lt) (const void *, const void *); /* less then */ - int32 (*f_cmp) (const bytea *, const bytea *); /* node compare */ + bool (*f_gt) (const void *, const void *, Oid); /* greater than */ + bool (*f_ge) (const void *, const void *, Oid); /* greater equal */ + bool (*f_eq) (const void *, const void *, Oid); /* equal */ + bool (*f_le) (const void *, const void *, Oid); /* less equal */ + bool (*f_lt) (const void *, const void *, Oid); /* less than */ + int32 (*f_cmp) (const void *, const void *, Oid); /* compare */ GBT_VARKEY *(*f_l2n) (GBT_VARKEY *); /* convert leaf to node */ } gbtree_vinfo; @@ -60,21 +51,22 @@ extern GBT_VARKEY *gbt_var_key_copy(const GBT_VARKEY_R *u, bool force_node); extern GISTENTRY *gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo); extern GBT_VARKEY *gbt_var_union(const GistEntryVector *entryvec, int32 *size, - const gbtree_vinfo *tinfo); + Oid collation, const gbtree_vinfo *tinfo); -extern bool gbt_var_same(bool *result, const Datum d1, const Datum d2, +extern bool gbt_var_same(Datum d1, Datum d2, Oid collation, const gbtree_vinfo *tinfo); extern float *gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n, - const gbtree_vinfo *tinfo); + Oid collation, const gbtree_vinfo *tinfo); extern bool gbt_var_consistent(GBT_VARKEY_R *key, const void *query, - const StrategyNumber *strategy, bool is_leaf, + StrategyNumber strategy, Oid collation, bool is_leaf, const gbtree_vinfo *tinfo); extern GIST_SPLITVEC *gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, - const gbtree_vinfo *tinfo); -extern void gbt_var_bin_union(Datum *u, GBT_VARKEY *e, + Oid collation, const gbtree_vinfo *tinfo); + +extern void gbt_var_bin_union(Datum *u, GBT_VARKEY *e, Oid collation, const gbtree_vinfo *tinfo); #endif |