forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf0a264a
committed
Fix failure to copy setlocale() return value.
POSIX permits setlocale() calls to invalidate any previous setlocale()return values, but commit5f538adneglected to account for setlocale(LC_CTYPE, NULL) doing so. The effectwas to set the LC_CTYPE environment variable to an unintended value.pg_perm_setlocale() sets this variable to assist PL/Perl; without it,Perl would undo PostgreSQL's locale settings. The known-affectedconfigurations are 32-bit, release builds using Visual Studio 2012 orVisual Studio 2013. Visual Studio 2010 is unaffected, as were allbuildfarm-attested configurations. In principle, this bug could leavethe wrong LC_CTYPE in effect after PL/Perl use, which could in turnfacilitate problems like corrupt tsvector datums. No known platformexperiences that consequence, because PL/Perl on Windows does not usethis environment variable.The bug has been user-visible, as early postmaster failure, on systemswith Windows ANSI code page set to CP936 for "Chinese (Simplified, PRC)"and probably on systems using other multibyte code pages.(SetEnvironmentVariable() rejects values containing character data notvalid under the Windows ANSI code page.) Back-patch to 9.4, where thefaulty commit first appeared.Reported by Didi Hu and 林鹏程. Reviewed by Tom Lane, though this fixstrategy was not his first choice.1 parent1f2a378 commitf0a264a
1 file changed
+6
-0
lines changedLines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
183 | 183 |
| |
184 | 184 |
| |
185 | 185 |
| |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
186 | 192 |
| |
187 | 193 |
| |
188 | 194 |
| |
|
0 commit comments
Comments
(0)