gen_guc_tables.pl: Validate required GUC fields before code generation

Поиск
Список
Период
Сортировка
От Chao Li
Тема gen_guc_tables.pl: Validate required GUC fields before code generation
Дата
Msg-id CAEoWx2=oP4LgHi771_OKhPPUS7B-CTqCs==uQcNXWrwBoAm5Vg@mail.gmail.com
обсуждение исходный текст
Ответы Re: gen_guc_tables.pl: Validate required GUC fields before code generation
Список pgsql-hackers
Hi Hacker,

While working on the other patch and editing guc_parameters.dat, I mistakenly deleted a “max” value line, then I got the following error during build:

```
'/opt/homebrew/bin/perl' ../../../src/backend/utils/misc/gen_guc_tables.pl ../../../src/backend/utils/misc/guc_parameters.dat guc_tables.inc.c
Use of uninitialized value in printf at ../../../src/backend/utils/misc/gen_guc_tables.pl line 78.
make[2]: *** [guc_tables.inc.c] Error 25
```

The error message is unclear and is not helpful to identify the real issue.

I am not an expert of perl, but I tried to make an enhancement that will print an error message like:

```
'/opt/homebrew/bin/perl' ../../../src/backend/utils/misc/gen_guc_tables.pl ../../../src/backend/utils/misc/guc_parameters.dat guc_tables.inc.c
error: guc_parameters.data: 'max_index_keys' of type 'int' is missing required field 'max'
```

I got the “required_common” and “required_by_type” by reading the function “print_table”.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/




Вложения

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