Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d838e30

Browse files
committed
Submitted by Openlink, requires -DOPENLINK_PATCHES in Makefile.global
varchar.diff ------------ This patch was necessary for the OpenLink Postgres Database Agent. I think this fixes a bug anyway. The following query demonstrates this bug: create table foo (bar varchar); insert into foo values (''); -- no problem select * from foo where bar = ''; -- fails
1 parent 76145bd commit d838e30

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/backend/utils/adt/varchar.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.1.1.1 1996/07/09 06:22:05 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.2 1996/07/15 19:11:23 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -68,8 +68,13 @@ bpcharin(char *s, int dummy, int typlen)
6868
typlen = len + 4;
6969
}
7070

71+
#ifndef OPENLINK_PATCHES
7172
if (len < 1 || len > 4096)
7273
elog(WARN, "bpcharin: length of char() must be between 1 and 4096");
74+
#else
75+
if (len > 4096)
76+
elog(WARN, "bpcharin: length of char() must be less than 4096");
77+
#endif
7378

7479
result = (char *) palloc(typlen);
7580
*(int32*)result = typlen;
@@ -132,8 +137,13 @@ varcharin(char *s, int dummy, int typlen)
132137
typlen = len + 4;
133138
}
134139

140+
#ifndef OPENLINK_PATCHES
135141
if (len < 1 || len > 4096)
136142
elog(WARN, "bpcharin: length of char() must be between 1 and 4096");
143+
#else
144+
if (len > 4096)
145+
elog(WARN, "varcharin: length of char() must be less than 4096");
146+
#endif
137147

138148
result = (char *) palloc(typlen);
139149
*(int32*)result = typlen;

0 commit comments

Comments
 (0)