Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers

Поиск
Список
Период
Сортировка
От Joshua Yanovski
Тема Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers
Дата
Msg-id CABz-M-G25NEfT3kZMUwkgVcTiCjJqYBHUvKSNjFOO8OJJysUiQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
There is one other thing I noticed in that area of the code--namely, if
NAMEDATALEN is low enough, an identifier can be truncated down to an empty
identifier, since the check for empty identifier length is done before the
call to truncate_identifier.  But I doubt this will ever be a problem in
practice and there may be other compensatory checks elsewhere.


On Thu, Feb 13, 2014 at 9:44 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> pythonesque@gmail.com writes:
> > As in description.  This follows from how these are scanned in scan.l:
>
> >       ident = litbuf_udeescape('\\', yyscanner);
> > if (yyextra->literallen >= NAMEDATALEN)
> > truncate_identifier(ident, yyextra->literallen, true);
>
> Yeah, that's a bug --- yyextra->literallen is not the thing to use here.
> It's just luck that truncate_identifier doesn't fail entirely, since
> we're violating its API contract.  Will fix, thanks for reporting it.
>
>                         regards, tom lane
>



--
Josh

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers
Следующее
От: digoal@126.com
Дата:
Сообщение: BUG #9210: PostgreSQL string store bug? not enforce check with correct characterSET/encoding