1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +03:00

Implement following item in TODO:

* Reject character sequences those are not valid in their charset
This commit is contained in:
Tatsuo Ishii
2001-09-11 05:18:59 +00:00
parent 95dc7785b5
commit 7e99cea816
2 changed files with 22 additions and 2 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.71 2001/08/13 18:45:35 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.72 2001/09/11 05:18:59 ishii Exp $
*
*-------------------------------------------------------------------------
*/
@ -154,8 +154,17 @@ textin(PG_FUNCTION_ARGS)
char *inputText = PG_GETARG_CSTRING(0);
text *result;
int len;
#ifdef MULTIBYTE
char *ermsg;
#endif
len = strlen(inputText) + VARHDRSZ;
#ifdef MULTIBYTE
if ((ermsg = pg_verifymbstr(inputText, len - VARHDRSZ)))
elog(ERROR,"%s",ermsg);
#endif
result = (text *) palloc(len);
VARATT_SIZEP(result) = len;