Re: Tightening isspace() tests where behavior should match SQL parser
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-hackers@postgresql.org
Date: 2017-05-24T19:34:07Z
Lists: pgsql-hackers
I wrote: > Heikki Linnakangas <hlinnaka@iki.fi> writes: >> +1 for back-patching. If I understand correctly, it would change the >> behavior when you pass a string with non-ASCII leading or trailing >> whitespace characters to those functions. I suppose that can happen, but >> it's only pure luck if the current code happens to work in that case. > Well, it'd work properly for e.g. no-break space in LATINn. Actually, it's dubious that treating no-break space as whitespace is correct at all in these use-cases. The core scanner would think it's an identifier character, so it's not impossible that somebody would consider it cute to write as part of a SQL identifier. If the core scanner accepts that, so must these functions. Hence, applied and back-patched. regards, tom lane
Commits
-
Tighten checks for whitespace in functions that parse identifiers etc.
- a3043d363483 9.4.13 landed
- a047270d5473 9.2.22 landed
- 971a158e67fd 9.3.18 landed
- 2c5e3fab3ef9 9.5.8 landed
- 9ae2661fe1fe 10.0 landed
- 8527132e5278 9.6.4 landed