pgsql: Rewrite tab completion's previous-word fetching for more sanity.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Rewrite tab completion's previous-word fetching for more sanity.
Дата
Msg-id E1RGyXX-0002rw-Cg@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Rewrite tab completion's previous-word fetching for more sanity.

Make it return empty strings when there are no more words to the left of
the current position, instead of sometimes returning NULL and other times
returning copies of the leftmost word.  Also, fetch the words in one scan,
rather than the previous wasteful approach of starting from scratch for
each word.  Make the code a bit harder to break when someone decides we
need more words of context, too.  (There was actually a memory leak here,
because whoever added prev6_wd neglected to free it.)

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/dce92c6d6abe302c58fd4e4221efed54913aefdb

Modified Files
--------------
src/bin/psql/tab-complete.c |  142 +++++++++++++++++++++++--------------------
1 files changed, 76 insertions(+), 66 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix memory leak in tab completion.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Simplify and improve ProcessStandbyHSFeedbackMessage logic.