mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Backpatch: Fix tsvector_out() and tsquery_out() to escape backslesh, add test of that.
Patch by Bruce Momjian <bruce@momjian.us>
This commit is contained in:
@ -550,6 +550,14 @@ tsvector_out(PG_FUNCTION_ARGS)
|
||||
curout = outbuf + pos;
|
||||
*curout++ = '\'';
|
||||
}
|
||||
else if (t_iseq(curin, '\\'))
|
||||
{
|
||||
int4 pos = curout - outbuf;
|
||||
|
||||
outbuf = (char *) repalloc((void *) outbuf, ++lenbuf);
|
||||
curout = outbuf + pos;
|
||||
*curout++ = '\\';
|
||||
}
|
||||
while (len--)
|
||||
*curout++ = *curin++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user