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

Commitd838e30

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 parent76145bd commitd838e30

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
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+
#ifndefOPENLINK_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+
#ifndefOPENLINK_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)

[8]ページ先頭

©2009-2025 Movatter.jp