|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * 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 $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -256,20 +256,13 @@ textlen(PG_FUNCTION_ARGS)
|
256 | 256 | * textoctetlen -
|
257 | 257 | * returns the physical length of a text*
|
258 | 258 | * (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 ... |
263 | 259 | */
|
264 | 260 | Datum
|
265 | 261 | textoctetlen(PG_FUNCTION_ARGS)
|
266 | 262 | {
|
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); |
271 | 264 |
|
272 |
| -PG_RETURN_INT32(t->va_content.va_external.va_extsize); |
| 265 | +PG_RETURN_INT32(VARSIZE(arg)-VARHDRSZ); |
273 | 266 | }
|
274 | 267 |
|
275 | 268 | /*
|
|