BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers
| От | pythonesque@gmail.com |
|---|---|
| Тема | BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers |
| Дата | |
| Msg-id | 20140213024415.2708.54432@wrigleys.postgresql.org обсуждение исходный текст |
| Ответы |
Re: BUG #9204: truncate_identifier may be called unnecessarily on escaped quoted identifiers
|
| Список | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 9204
Logged by: Joshua Yanovski
Email address: pythonesque@gmail.com
PostgreSQL version: 9.3.2
Operating system: Ubuntu 12.0.4
Description:
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);
Because literallen is the length of the original string, this does
unnecessary work (and reports a misleading notice) if the resulting string
is shorter.
psql -v 'VERBOSITY=verbose' -c "select
U&\"abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcd\\3737\"
FROM dummy"
NOTICE: 42622: identifier
"abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdã·" will be
truncated to
"abcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdefghabcdã·"
LOCATION: truncate_identifier, scansup.c:195
It is a pretty borderline edge case and doesn't have any serious
consequences, but it does seem like it should be easy to fix without a huge
hit to efficiency, considering that the length can be calculated in constant
time from known information in litbuf_udeescape.
В списке pgsql-bugs по дате отправления: