Content-Length: 275865 | pFad | https://github.com/postgrespro/postgres/commit/aa0d3504560d40f4300a3d49d1c6c3bfc3b894e5

02 Improve description of keys in tsvector · postgrespro/postgres@aa0d350 · GitHub
Skip to content

Commit aa0d350

Browse files
committed
Improve description of keys in tsvector
If all the bits of a key in a tsvector are true (marked with ALLISTRUE), gtsvectorout() would show the following description: "0 true bits, 0 false bits" This is confusing, as all the bits are true, but this would be equivalent to the information if siglen is 0. This commit improves the output so as "all true bits" show instead in this case. Alexander has proposed a regression test for pageinspect, not included here as it is rather expensive compared to its coverage value. Author: Alexander Lakhin Discussion: https://postgr.es/m/17950-6c80a8d2b94ec695@postgresql.org
1 parent ae10dbb commit aa0d350

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/backend/utils/adt/tsgistidx.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,15 @@ gtsvectorout(PG_FUNCTION_ARGS)
115115
sprintf(outbuf, ARROUTSTR, (int) ARRNELEM(key));
116116
else
117117
{
118-
int siglen = GETSIGLEN(key);
119-
int cnttrue = (ISALLTRUE(key)) ? SIGLENBIT(siglen) : sizebitvec(GETSIGN(key), siglen);
118+
if (ISALLTRUE(key))
119+
sprintf(outbuf, "all true bits");
120+
else
121+
{
122+
int siglen = GETSIGLEN(key);
123+
int cnttrue = sizebitvec(GETSIGN(key), siglen);
120124

121-
sprintf(outbuf, SINGOUTSTR, cnttrue, (int) SIGLENBIT(siglen) - cnttrue);
125+
sprintf(outbuf, SINGOUTSTR, cnttrue, (int) SIGLENBIT(siglen) - cnttrue);
126+
}
122127
}
123128

124129
PG_FREE_IF_COPY(key, 0);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/postgrespro/postgres/commit/aa0d3504560d40f4300a3d49d1c6c3bfc3b894e5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy