Re: [BUG FIX]Connection fails with whitespace after keepalives parameter value
От | Fujii Masao |
---|---|
Тема | Re: [BUG FIX]Connection fails with whitespace after keepalives parameter value |
Дата | |
Msg-id | 464ea63f-9a73-4684-951e-a2cdf1bbcc24@oss.nttdata.com обсуждение исходный текст |
Ответы |
Re: [BUG FIX]Connection fails with whitespace after keepalives parameter value
|
Список | pgsql-hackers |
On 2024/10/01 14:11, Yuto Sasaki (Fujitsu) wrote: > Hi hackers, > I've discovered a bug in ECPG that causes database connection failures. This issue > appears to stem from libpq layer. > Found bug: The EXEC SQL CONNECT TO statement fails to connect to the database. > Specifically, the following code: > ```c > EXEC SQL CONNECT TO tcp:postgresql://localhost:5432/postgres?keepalives=1 > &keepalives_idle=1 USER yuto; > ``` > When precompiled and executed, this code fails to connect to the database. > Error message: > ``` > failed: keepalives parameter must be an integer > ``` > Steps to reproduce: The issue can be reproduced using the attached pgc file. > Root cause: The method for parsing the keepalives parameter in the useKeepalives > function of the libpq library is not appropriate. Specifically, it doesn't > account for whitespace following the numeric value. Is a connection URL with whitespace, like "tcp:postgresql://localhost:5432/postgres?keepalives=1 & ...", considered valid? If not, the issue seems to be that ecpg adds unnecessary whitespace to the connection URL, especially after the "&" character. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION
В списке pgsql-hackers по дате отправления: