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

Commit6f65678

Browse files
committed
Make text octet_length() return non-compressed length to be consistent
with other data types, per disucssion. Encoding issue still open.
1 parent9473f8d commit6f65678

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

‎src/backend/utils/adt/varlena.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.76 2001/11/1909:05:02 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.77 2001/11/1918:21:10 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -256,20 +256,13 @@ textlen(PG_FUNCTION_ARGS)
256256
* textoctetlen -
257257
* returns the physical length of a text*
258258
* (which is less than the VARSIZE of the text*)
259-
*
260-
* XXX is it actually appropriate to return the compressed length
261-
* when the value is compressed? It's not at all clear to me that
262-
* this is what SQL92 has in mind ...
263259
*/
264260
Datum
265261
textoctetlen(PG_FUNCTION_ARGS)
266262
{
267-
structvarattrib*t= (structvarattrib*)PG_GETARG_RAW_VARLENA_P(0);
268-
269-
if (!VARATT_IS_EXTERNAL(t))
270-
PG_RETURN_INT32(VARATT_SIZE(t)-VARHDRSZ);
263+
text*arg=PG_GETARG_VARCHAR_P(0);
271264

272-
PG_RETURN_INT32(t->va_content.va_external.va_extsize);
265+
PG_RETURN_INT32(VARSIZE(arg)-VARHDRSZ);
273266
}
274267

275268
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp