mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03:00
Change logic slightly to avoid one unnecessary calculation. No big deal.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.13 1997/12/16 15:59:09 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.14 1997/12/23 19:24:43 thomas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -54,7 +54,7 @@ bpcharin(char *s, int dummy, int typlen)
|
||||
{
|
||||
char *result,
|
||||
*r;
|
||||
int len = typlen - VARHDRSZ;
|
||||
int len;
|
||||
int i;
|
||||
|
||||
if (s == NULL)
|
||||
@ -69,6 +69,10 @@ bpcharin(char *s, int dummy, int typlen)
|
||||
len = strlen(s);
|
||||
typlen = len + VARHDRSZ;
|
||||
}
|
||||
else
|
||||
{
|
||||
len = typlen - VARHDRSZ;
|
||||
}
|
||||
|
||||
if (len > 4096)
|
||||
elog(WARN, "bpcharin: length of char() must be less than 4096");
|
||||
|
Reference in New Issue
Block a user