]> granicus.if.org Git - postgresql/commitdiff
Remove unnecessary pg_verifymbstr() calls from tsvector/query in functions.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 14 May 2012 11:30:32 +0000 (14:30 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 14 May 2012 11:30:32 +0000 (14:30 +0300)
The input should've been validated well before it hits the input function.
Doing so again is a waste of cycles.

src/backend/utils/adt/tsquery.c
src/backend/utils/adt/tsvector.c

index 2473f0df729c474c17b8b662880b12f0711835e6..6e1f8cfdb0deb34e826f0ac8d0a71f4c10324931 100644 (file)
@@ -570,8 +570,6 @@ tsqueryin(PG_FUNCTION_ARGS)
 {
        char       *in = PG_GETARG_CSTRING(0);
 
-       pg_verifymbstr(in, strlen(in), false);
-
        PG_RETURN_TSQUERY(parse_tsquery(in, pushval_asis, PointerGetDatum(NULL), false));
 }
 
index 4262ea9e91ea252e22743261042544637cb56ce9..8a81f3d8295f85bb9e36898d0ea326a171549890 100644 (file)
@@ -198,8 +198,6 @@ tsvectorin(PG_FUNCTION_ARGS)
        char       *cur;
        int                     buflen = 256;   /* allocated size of tmpbuf */
 
-       pg_verifymbstr(buf, strlen(buf), false);
-
        state = init_tsvector_parser(buf, false, false);
 
        arrlen = 64;