pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: ecpglib: call newlocale() once per process. 7+ messages / 1 participants [nested] [flat]
* pgsql: ecpglib: call newlocale() once per process. @ 2022-07-02 20:02 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 7+ messages in thread From: Noah Misch @ 2022-07-02 20:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org ecpglib: call newlocale() once per process. ecpglib has been calling it once per SQL query and once per EXEC SQL GET DESCRIPTOR. Instead, if newlocale() has not succeeded before, call it while establishing a connection. This mitigates three problems: - If newlocale() failed in EXEC SQL GET DESCRIPTOR, the command silently proceeded without the intended locale change. - On AIX, each newlocale()+freelocale() cycle leaked memory. - newlocale() CPU usage may have been nontrivial. Fail the connection attempt if newlocale() fails. Rearrange ecpg_do_prologue() to validate the connection before its uselocale(). The sort of program that may regress is one running in an environment where newlocale() fails. If that program establishes connections without running SQL statements, it will stop working in response to this change. I'm betting against the importance of such an ECPG use case. Most SQL execution (any using ECPGdo()) has long required newlocale() success, so there's little a connection could do without newlocale(). Back-patch to v10 (all supported versions). Reviewed by Tom Lane. Reported by Guillaume Lelarge. Discussion: https://postgr.es/m/20220101074055.GA54621@rfd.leadboat.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/5633836ef306aa4d2be44821b601494054b479d7 Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 40 ++++++++++++++++++++++++++++ src/interfaces/ecpg/ecpglib/descriptor.c | 15 +++++++---- src/interfaces/ecpg/ecpglib/ecpglib_extern.h | 5 +++- src/interfaces/ecpg/ecpglib/execute.c | 40 ++++++++++++---------------- 4 files changed, 71 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: ecpglib: call newlocale() once per process. @ 2022-07-02 20:02 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 7+ messages in thread From: Noah Misch @ 2022-07-02 20:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org ecpglib: call newlocale() once per process. ecpglib has been calling it once per SQL query and once per EXEC SQL GET DESCRIPTOR. Instead, if newlocale() has not succeeded before, call it while establishing a connection. This mitigates three problems: - If newlocale() failed in EXEC SQL GET DESCRIPTOR, the command silently proceeded without the intended locale change. - On AIX, each newlocale()+freelocale() cycle leaked memory. - newlocale() CPU usage may have been nontrivial. Fail the connection attempt if newlocale() fails. Rearrange ecpg_do_prologue() to validate the connection before its uselocale(). The sort of program that may regress is one running in an environment where newlocale() fails. If that program establishes connections without running SQL statements, it will stop working in response to this change. I'm betting against the importance of such an ECPG use case. Most SQL execution (any using ECPGdo()) has long required newlocale() success, so there's little a connection could do without newlocale(). Back-patch to v10 (all supported versions). Reviewed by Tom Lane. Reported by Guillaume Lelarge. Discussion: https://postgr.es/m/20220101074055.GA54621@rfd.leadboat.com Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7a28f7cb09bffaa24d8c573cee0c99ab5c14795d Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 40 ++++++++++++++++++++++++++++ src/interfaces/ecpg/ecpglib/descriptor.c | 15 +++++++---- src/interfaces/ecpg/ecpglib/ecpglib_extern.h | 5 +++- src/interfaces/ecpg/ecpglib/execute.c | 40 ++++++++++++---------------- 4 files changed, 71 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: ecpglib: call newlocale() once per process. @ 2022-07-02 20:02 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 7+ messages in thread From: Noah Misch @ 2022-07-02 20:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org ecpglib: call newlocale() once per process. ecpglib has been calling it once per SQL query and once per EXEC SQL GET DESCRIPTOR. Instead, if newlocale() has not succeeded before, call it while establishing a connection. This mitigates three problems: - If newlocale() failed in EXEC SQL GET DESCRIPTOR, the command silently proceeded without the intended locale change. - On AIX, each newlocale()+freelocale() cycle leaked memory. - newlocale() CPU usage may have been nontrivial. Fail the connection attempt if newlocale() fails. Rearrange ecpg_do_prologue() to validate the connection before its uselocale(). The sort of program that may regress is one running in an environment where newlocale() fails. If that program establishes connections without running SQL statements, it will stop working in response to this change. I'm betting against the importance of such an ECPG use case. Most SQL execution (any using ECPGdo()) has long required newlocale() success, so there's little a connection could do without newlocale(). Back-patch to v10 (all supported versions). Reviewed by Tom Lane. Reported by Guillaume Lelarge. Discussion: https://postgr.es/m/20220101074055.GA54621@rfd.leadboat.com Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5b94e2bd4d5430f5ea4e965a32727a6006972a55 Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 40 ++++++++++++++++++++++++++++ src/interfaces/ecpg/ecpglib/descriptor.c | 15 +++++++---- src/interfaces/ecpg/ecpglib/ecpglib_extern.h | 5 +++- src/interfaces/ecpg/ecpglib/execute.c | 40 ++++++++++++---------------- 4 files changed, 71 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: ecpglib: call newlocale() once per process. @ 2022-07-02 20:02 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 7+ messages in thread From: Noah Misch @ 2022-07-02 20:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org ecpglib: call newlocale() once per process. ecpglib has been calling it once per SQL query and once per EXEC SQL GET DESCRIPTOR. Instead, if newlocale() has not succeeded before, call it while establishing a connection. This mitigates three problems: - If newlocale() failed in EXEC SQL GET DESCRIPTOR, the command silently proceeded without the intended locale change. - On AIX, each newlocale()+freelocale() cycle leaked memory. - newlocale() CPU usage may have been nontrivial. Fail the connection attempt if newlocale() fails. Rearrange ecpg_do_prologue() to validate the connection before its uselocale(). The sort of program that may regress is one running in an environment where newlocale() fails. If that program establishes connections without running SQL statements, it will stop working in response to this change. I'm betting against the importance of such an ECPG use case. Most SQL execution (any using ECPGdo()) has long required newlocale() success, so there's little a connection could do without newlocale(). Back-patch to v10 (all supported versions). Reviewed by Tom Lane. Reported by Guillaume Lelarge. Discussion: https://postgr.es/m/20220101074055.GA54621@rfd.leadboat.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b4d7e92bd5354c78c0d0405d08d85b73d20f50f7 Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 40 ++++++++++++++++++++++++++++ src/interfaces/ecpg/ecpglib/descriptor.c | 15 +++++++---- src/interfaces/ecpg/ecpglib/ecpglib_extern.h | 5 +++- src/interfaces/ecpg/ecpglib/execute.c | 40 ++++++++++++---------------- 4 files changed, 71 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: ecpglib: call newlocale() once per process. @ 2022-07-02 20:02 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 7+ messages in thread From: Noah Misch @ 2022-07-02 20:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org ecpglib: call newlocale() once per process. ecpglib has been calling it once per SQL query and once per EXEC SQL GET DESCRIPTOR. Instead, if newlocale() has not succeeded before, call it while establishing a connection. This mitigates three problems: - If newlocale() failed in EXEC SQL GET DESCRIPTOR, the command silently proceeded without the intended locale change. - On AIX, each newlocale()+freelocale() cycle leaked memory. - newlocale() CPU usage may have been nontrivial. Fail the connection attempt if newlocale() fails. Rearrange ecpg_do_prologue() to validate the connection before its uselocale(). The sort of program that may regress is one running in an environment where newlocale() fails. If that program establishes connections without running SQL statements, it will stop working in response to this change. I'm betting against the importance of such an ECPG use case. Most SQL execution (any using ECPGdo()) has long required newlocale() success, so there's little a connection could do without newlocale(). Back-patch to v10 (all supported versions). Reviewed by Tom Lane. Reported by Guillaume Lelarge. Discussion: https://postgr.es/m/20220101074055.GA54621@rfd.leadboat.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5e0b8f3f4f87739b3187c2d3f7e6e3d2bc6a55d6 Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 40 ++++++++++++++++++++++++++++ src/interfaces/ecpg/ecpglib/descriptor.c | 15 +++++++---- src/interfaces/ecpg/ecpglib/ecpglib_extern.h | 5 +++- src/interfaces/ecpg/ecpglib/execute.c | 40 ++++++++++++---------------- 4 files changed, 71 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: ecpglib: call newlocale() once per process. @ 2022-07-02 20:02 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 7+ messages in thread From: Noah Misch @ 2022-07-02 20:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org ecpglib: call newlocale() once per process. ecpglib has been calling it once per SQL query and once per EXEC SQL GET DESCRIPTOR. Instead, if newlocale() has not succeeded before, call it while establishing a connection. This mitigates three problems: - If newlocale() failed in EXEC SQL GET DESCRIPTOR, the command silently proceeded without the intended locale change. - On AIX, each newlocale()+freelocale() cycle leaked memory. - newlocale() CPU usage may have been nontrivial. Fail the connection attempt if newlocale() fails. Rearrange ecpg_do_prologue() to validate the connection before its uselocale(). The sort of program that may regress is one running in an environment where newlocale() fails. If that program establishes connections without running SQL statements, it will stop working in response to this change. I'm betting against the importance of such an ECPG use case. Most SQL execution (any using ECPGdo()) has long required newlocale() success, so there's little a connection could do without newlocale(). Back-patch to v10 (all supported versions). Reviewed by Tom Lane. Reported by Guillaume Lelarge. Discussion: https://postgr.es/m/20220101074055.GA54621@rfd.leadboat.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d68b731a15046bca043d086de3eb695cb6236b12 Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 40 ++++++++++++++++++++++++++++++++ src/interfaces/ecpg/ecpglib/descriptor.c | 15 ++++++++---- src/interfaces/ecpg/ecpglib/execute.c | 40 ++++++++++++++------------------ src/interfaces/ecpg/ecpglib/extern.h | 5 +++- 4 files changed, 71 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: ecpglib: call newlocale() once per process. @ 2022-07-02 20:02 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 7+ messages in thread From: Noah Misch @ 2022-07-02 20:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org ecpglib: call newlocale() once per process. ecpglib has been calling it once per SQL query and once per EXEC SQL GET DESCRIPTOR. Instead, if newlocale() has not succeeded before, call it while establishing a connection. This mitigates three problems: - If newlocale() failed in EXEC SQL GET DESCRIPTOR, the command silently proceeded without the intended locale change. - On AIX, each newlocale()+freelocale() cycle leaked memory. - newlocale() CPU usage may have been nontrivial. Fail the connection attempt if newlocale() fails. Rearrange ecpg_do_prologue() to validate the connection before its uselocale(). The sort of program that may regress is one running in an environment where newlocale() fails. If that program establishes connections without running SQL statements, it will stop working in response to this change. I'm betting against the importance of such an ECPG use case. Most SQL execution (any using ECPGdo()) has long required newlocale() success, so there's little a connection could do without newlocale(). Back-patch to v10 (all supported versions). Reviewed by Tom Lane. Reported by Guillaume Lelarge. Discussion: https://postgr.es/m/20220101074055.GA54621@rfd.leadboat.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/12b2a2369debca1fa0c61a7db2a50152668e64dc Modified Files -------------- src/interfaces/ecpg/ecpglib/connect.c | 40 ++++++++++++++++++++++++++++++++ src/interfaces/ecpg/ecpglib/descriptor.c | 15 ++++++++---- src/interfaces/ecpg/ecpglib/execute.c | 40 ++++++++++++++------------------ src/interfaces/ecpg/ecpglib/extern.h | 5 +++- 4 files changed, 71 insertions(+), 29 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2022-07-02 20:02 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2022-07-02 20:02 pgsql: ecpglib: call newlocale() once per process. Noah Misch <noah@leadboat.com> 2022-07-02 20:02 pgsql: ecpglib: call newlocale() once per process. Noah Misch <noah@leadboat.com> 2022-07-02 20:02 pgsql: ecpglib: call newlocale() once per process. Noah Misch <noah@leadboat.com> 2022-07-02 20:02 pgsql: ecpglib: call newlocale() once per process. Noah Misch <noah@leadboat.com> 2022-07-02 20:02 pgsql: ecpglib: call newlocale() once per process. Noah Misch <noah@leadboat.com> 2022-07-02 20:02 pgsql: ecpglib: call newlocale() once per process. Noah Misch <noah@leadboat.com> 2022-07-02 20:02 pgsql: ecpglib: call newlocale() once per process. Noah Misch <noah@leadboat.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox