Re: BUG #18310: Some SQL commands fail to process duplicate objects with error: tuple already updated by self
От | Yongtao Huang |
---|---|
Тема | Re: BUG #18310: Some SQL commands fail to process duplicate objects with error: tuple already updated by self |
Дата | |
Msg-id | CAOe1Go1N1XHYMXOq6+0=Awcpngmc9ei+3Jou2Om6o=giW+3pvw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #18310: Some SQL commands fail to process duplicate objects with error: tuple already updated by self (Tender Wang <tndrwang@gmail.com>) |
Ответы |
Re: BUG #18310: Some SQL commands fail to process duplicate objects with error: tuple already updated by self
|
Список | pgsql-bugs |
Hi Tender Wang,
I think your code changes LGTM. Thanks for your contribution.
But I meet these errors when I git apply your patch, so I do some tiny formate modification.
``` bash
$ git apply 0001-Fix-reporting-error-when-process-duplicate-token-typ.patch
0001-Fix-reporting-error-when-process-duplicate-token-typ.patch:38: indent with spaces.
List *tokennames = stmt->tokentype;
0001-Fix-reporting-error-when-process-duplicate-token-typ.patch:73: indent with spaces.
{
0001-Fix-reporting-error-when-process-duplicate-token-typ.patch:74: indent with spaces.
if (!stmt->missing_ok)
0001-Fix-reporting-error-when-process-duplicate-token-typ.patch:75: indent with spaces.
ereport(ERROR,
0001-Fix-reporting-error-when-process-duplicate-token-typ.patch:76: indent with spaces.
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
warning: squelched 9 whitespace errors
warning: 14 lines add whitespace errors.
```
I think your code changes LGTM. Thanks for your contribution.
But I meet these errors when I git apply your patch, so I do some tiny formate modification.
Please refer to the patch which is still authored by you.
``` bash
$ git apply 0001-Fix-reporting-error-when-process-duplicate-token-typ.patch
0001-Fix-reporting-error-when-process-duplicate-token-typ.patch:38: indent with spaces.
List *tokennames = stmt->tokentype;
0001-Fix-reporting-error-when-process-duplicate-token-typ.patch:73: indent with spaces.
{
0001-Fix-reporting-error-when-process-duplicate-token-typ.patch:74: indent with spaces.
if (!stmt->missing_ok)
0001-Fix-reporting-error-when-process-duplicate-token-typ.patch:75: indent with spaces.
ereport(ERROR,
0001-Fix-reporting-error-when-process-duplicate-token-typ.patch:76: indent with spaces.
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
warning: squelched 9 whitespace errors
warning: 14 lines add whitespace errors.
```
Regrads
Yongtao Huang
Broadcom Greenplum
Tender Wang <tndrwang@gmail.com> 于2024年1月26日周五 14:21写道:
Tender Wang <tndrwang@gmail.com> 于2024年1月26日周五 12:54写道:Michael Paquier <michael@paquier.xyz> 于2024年1月26日周五 11:41写道:On Fri, Jan 26, 2024 at 11:33:24AM +0800, Tender Wang wrote:
> How about using list *res replace int *res in getTokenTypes(), so we can
> use list_append_unique().
> In outer function, use list *tokens to replace int *tokens, and ntokens =
> list_length(tokens) not list_length(stmt->tokentype).
Yeah, I was wondering about this code path. If you feel strongly
about that, would you like to write a patch?Ok, I try to fix it.As I said before, return List looks like not complicated to solve this issue.I found another problem, it didn't report NOTICE if SQL has IF EXISTS, for example:postgres=# alter text search configuration ispell_tst drop mapping if exists for test;
ERROR: token type "test" does not existSo I change the func getTokenTypes() interface and remove DropConfigurationMapping() error report into getTokenTypes().--Tender WangOpenPie: https://en.openpie.com/
Вложения
В списке pgsql-bugs по дате отправления: