|
15 | 15 | * |
16 | 16 | * |
17 | 17 | * IDENTIFICATION |
18 | | - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.140 2003/07/17 20:52:36 tgl Exp $ |
| 18 | + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.141 2003/07/1722:20:14 tgl Exp $ |
19 | 19 | * |
20 | 20 | *------------------------------------------------------------------------- |
21 | 21 | */ |
@@ -2700,11 +2700,16 @@ convert_string_datum(Datum value, Oid typid) |
2700 | 2700 | * However, it seems that some versions of Solaris have buggy |
2701 | 2701 | * strxfrm that can write past the specified buffer length in that |
2702 | 2702 | * scenario. So, do it the dumb way for portability. |
| 2703 | + * |
| 2704 | + * Yet other systems (e.g., glibc) sometimes return a smaller value |
| 2705 | + * from the second call than the first; thus the Assert must be <= |
| 2706 | + * not == as you'd expect. Can't any of these people program their |
| 2707 | + * way out of a paper bag? |
2703 | 2708 | */ |
2704 | 2709 | xfrmlen=strxfrm(NULL,val,0); |
2705 | 2710 | xfrmstr= (char*)palloc(xfrmlen+1); |
2706 | 2711 | xfrmlen2=strxfrm(xfrmstr,val,xfrmlen+1); |
2707 | | -Assert(xfrmlen2==xfrmlen); |
| 2712 | +Assert(xfrmlen2<=xfrmlen); |
2708 | 2713 | pfree(val); |
2709 | 2714 | val=xfrmstr; |
2710 | 2715 | } |
|