Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite2fbb88

Browse files
committed
Fix gist_bool_ops to use gbtreekey2
Commit57e3c51 added a new GiST bool opclass, but it used gbtreekey4to store the data, which left two bytes undefined, as reported by skink,our valgrind animal. There was a bit more confusion, because the opclassalso used gbtreekey8 in the definition.Fix by defining a new gbtreekey2 struct, and using it in all the places.Discussion:https://postgr.es/m/CAE2gYzyDKJBZngssR84VGZEN=Ux=V9FV23QfPgo+7-yYnKKg4g@mail.gmail.com
1 parentccf2897 commite2fbb88

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

‎contrib/btree_gist/btree_bool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static const gbtree_ninfo tinfo =
7272
{
7373
gbt_t_bool,
7474
sizeof(bool),
75-
4,/* sizeof(gbtreekey4) */
75+
2,/* sizeof(gbtreekey2) */
7676
gbt_boolgt,
7777
gbt_boolge,
7878
gbt_booleq,

‎contrib/btree_gist/btree_gist--1.6--1.7.sql

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
\echo Use"ALTER EXTENSION btree_gist UPDATE TO '1.7'" to load this file. \quit
55

66
-- This upgrade scripts add support for bool.
7+
CREATEFUNCTIONgbtreekey2_in(cstring)
8+
RETURNS gbtreekey2
9+
AS'MODULE_PATHNAME','gbtreekey_in'
10+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
11+
12+
CREATEFUNCTIONgbtreekey2_out(gbtreekey2)
13+
RETURNS cstring
14+
AS'MODULE_PATHNAME','gbtreekey_out'
15+
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
16+
17+
CREATETYPEgbtreekey2 (
18+
INTERNALLENGTH=2,
19+
INPUT= gbtreekey2_in,
20+
OUTPUT= gbtreekey2_out
21+
);
722

823
-- Define the GiST support methods
924
CREATEFUNCTIONgbt_bool_consistent(internal,bool,int2,oid,internal)
@@ -32,11 +47,11 @@ AS 'MODULE_PATHNAME'
3247
LANGUAGE C IMMUTABLE STRICT;
3348

3449
CREATEFUNCTIONgbt_bool_union(internal, internal)
35-
RETURNSgbtreekey8
50+
RETURNSgbtreekey2
3651
AS'MODULE_PATHNAME'
3752
LANGUAGE C IMMUTABLE STRICT;
3853

39-
CREATEFUNCTIONgbt_bool_same(gbtreekey8, gbtreekey8, internal)
54+
CREATEFUNCTIONgbt_bool_same(gbtreekey2, gbtreekey2, internal)
4055
RETURNS internal
4156
AS'MODULE_PATHNAME'
4257
LANGUAGE C IMMUTABLE STRICT;
@@ -57,6 +72,6 @@ AS
5772
FUNCTION4gbt_decompress (internal),
5873
FUNCTION5gbt_bool_penalty (internal, internal, internal),
5974
FUNCTION6gbt_bool_picksplit (internal, internal),
60-
FUNCTION7gbt_bool_same (gbtreekey8, gbtreekey8, internal),
75+
FUNCTION7gbt_bool_same (gbtreekey2, gbtreekey2, internal),
6176
FUNCTION9 gbt_bool_fetch (internal),
62-
STORAGEgbtreekey8;
77+
STORAGEgbtreekey2;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp