[Bug Fix] ECPG: could not use set xxx to default statement
| От | Higuchi, Daisuke |
|---|---|
| Тема | [Bug Fix] ECPG: could not use set xxx to default statement |
| Дата | |
| Msg-id | 1803D792815FC24D871C00D17AE95905DB51CE@g01jpexmbkw24 обсуждение исходный текст |
| Ответы |
Re: [Bug Fix] ECPG: could not use set xxx to default statement
|
| Список | pgsql-hackers |
Hi,
I found ECPG's bug which SET xxx = DEFAULT statement could not be used.
[PROBLEM]
When the source code (*.pgc) has "EXEC SQL set xxx = default;", created c program by ECPG has no " = default".
For example, "EXEC SQL set search_path = default;" in *.pgc will be converted to "{ ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,"set search_path", ECPGt_EOIT, ECPGt_EORT);}" in c program.
[Investigation]
gram.y lacks ";" in the end of section "generic_set", so preproc.y's syntax is broken.
src/backend/parser/gram.y
-------------------------------------------
generic_set:
| var_name '=' DEFAULT
{
VariableSetStmt *n = makeNode(VariableSetStmt);
n->kind = VAR_SET_DEFAULT;
n->name = $1;
$$ = n;
}
set_rest_more: /* Generic SET syntaxes: */
-------------------------------------------
src/interfaces/ecpg/preproc/preproc.y
-------------------------------------------
generic_set:
| var_name TO DEFAULT
{
$$ = cat_str(2,$1,mm_strdup("to default"));
}
| var_name '=' DEFAULT set_rest_more:
generic_set
{
$$ = $1;
}
-------------------------------------------
I attached the patch which has ";" in the end of section "generic_set" and regression.
Regards,
Daisuke, Higuchi
Вложения
В списке pgsql-hackers по дате отправления: