- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit6cddecd
committed
Avoid breaking SJIS encoding while de-backslashing Windows paths.
When running on Windows, canonicalize_path() converts '\' to '/'to prevent confusing the Windows command processor. It wasdoing that in a non-encoding-aware fashion; but in SJIS thereare valid two-byte characters whose second byte matches '\'.So encoding corruption ensues if such a character is used inthe path.We can fairly easily fix this if we know which encoding isin use, but a lot of our utilities don't have much of a clueabout that. After some discussion we decided we'd settle forfixing this only in psql, and assuming that its value ofclient_encoding matches what the user is typing.It seems hopeless to get the server to deal with the problematiccharacters in database path names, so we'll just declare thatcase to be unsupported. That means nothing need be done inthe server, nor in utility programs whose only contact withfile path names is for database paths. But psql frequentlydeals with client-side file paths, so it'd be good if itdidn't mess those up.Bug: #18735Reported-by: Koichi Suzuki <koichi.suzuki@enterprisedb.com>Author: Tom Lane <tgl@sss.pgh.pa.us>Reviewed-by: Koichi Suzuki <koichi.suzuki@enterprisedb.com>Discussion:https://postgr.es/m/18735-4acdb3998bb9f2b1@postgresql.orgBackpatch-through: 131 parentf6ff75f commit6cddecd
4 files changed
+97
-19
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1224 | 1224 |
| |
1225 | 1225 |
| |
1226 | 1226 |
| |
1227 |
| - | |
| 1227 | + | |
1228 | 1228 |
| |
1229 | 1229 |
| |
1230 | 1230 |
| |
| |||
2864 | 2864 |
| |
2865 | 2865 |
| |
2866 | 2866 |
| |
2867 |
| - | |
| 2867 | + | |
2868 | 2868 |
| |
2869 | 2869 |
| |
2870 | 2870 |
| |
| |||
4479 | 4479 |
| |
4480 | 4480 |
| |
4481 | 4481 |
| |
4482 |
| - | |
| 4482 | + | |
4483 | 4483 |
| |
4484 | 4484 |
| |
4485 | 4485 |
| |
| |||
4493 | 4493 |
| |
4494 | 4494 |
| |
4495 | 4495 |
| |
4496 |
| - | |
| 4496 | + | |
4497 | 4497 |
| |
4498 | 4498 |
| |
4499 | 4499 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
280 | 280 |
| |
281 | 281 |
| |
282 | 282 |
| |
283 |
| - | |
| 283 | + | |
284 | 284 |
| |
285 | 285 |
| |
286 | 286 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
| 56 | + | |
56 | 57 |
| |
57 | 58 |
| |
58 | 59 |
| |
|
Lines changed: 91 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
| 39 | + | |
39 | 40 |
| |
40 | 41 |
| |
41 | 42 |
| |
| |||
45 | 46 |
| |
46 | 47 |
| |
47 | 48 |
| |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 |
| |
49 | 54 |
| |
50 | 55 |
| |
| |||
149 | 154 |
| |
150 | 155 |
| |
151 | 156 |
| |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
152 | 193 |
| |
153 |
| - | |
| 194 | + | |
154 | 195 |
| |
155 |
| - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
156 | 224 |
| |
157 | 225 |
| |
158 | 226 |
| |
| |||
182 | 250 |
| |
183 | 251 |
| |
184 | 252 |
| |
| 253 | + | |
| 254 | + | |
| 255 | + | |
185 | 256 |
| |
186 | 257 |
| |
187 | 258 |
| |
188 | 259 |
| |
189 | 260 |
| |
190 |
| - | |
191 |
| - | |
192 | 261 |
| |
193 | 262 |
| |
194 | 263 |
| |
| |||
198 | 267 |
| |
199 | 268 |
| |
200 | 269 |
| |
201 |
| - | |
202 |
| - | |
203 |
| - | |
204 |
| - | |
205 |
| - | |
| 270 | + | |
| 271 | + | |
206 | 272 |
| |
207 | 273 |
| |
208 | 274 |
| |
| |||
253 | 319 |
| |
254 | 320 |
| |
255 | 321 |
| |
| 322 | + | |
| 323 | + | |
256 | 324 |
| |
257 | 325 |
| |
258 | 326 |
| |
259 | 327 |
| |
260 | 328 |
| |
261 | 329 |
| |
262 | 330 |
| |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
263 | 335 |
| |
264 | 336 |
| |
265 | 337 |
| |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
266 | 345 |
| |
267 | 346 |
| |
268 | 347 |
| |
| |||
278 | 357 |
| |
279 | 358 |
| |
280 | 359 |
| |
| 360 | + | |
281 | 361 |
| |
282 |
| - | |
283 |
| - | |
284 |
| - | |
285 |
| - | |
286 |
| - | |
| 362 | + | |
287 | 363 |
| |
288 | 364 |
| |
289 | 365 |
| |
290 | 366 |
| |
291 | 367 |
| |
| 368 | + | |
292 | 369 |
| |
293 | 370 |
| |
294 | 371 |
| |
|
0 commit comments
Comments
(0)