diff options
| author | Tom Lane | 2016-03-28 05:00:30 +0000 |
|---|---|---|
| committer | Tom Lane | 2016-03-28 05:00:30 +0000 |
| commit | d12e5bb79bb535c2df13b76cd7d01f0bb8dc8e4d (patch) | |
| tree | fffb6e2f681baf125f307fc8519175bc529ecb34 /src/test | |
| parent | 499a50571c72f41bb1365970d55dae5c8afcb6ba (diff) | |
Code and docs review for commit 3187d6de0e5a9e805b27c48437897e8c39071d45.
Fix up check for high-bit-set characters, which provoked "comparison is
always true due to limited range of data type" warnings on some compilers,
and was unlike the way we do it elsewhere anyway. Fix omission of "$"
from the set of valid identifier continuation characters. Get rid of
sanitize_text(), which was utterly inconsistent with any other error report
anywhere in the system, and wasn't even well designed on its own terms
(double-quoting the result string without escaping contained double quotes
doesn't seem very well thought out). Fix up error messages, which didn't
follow the message style guidelines very well, and were overly specific in
situations where the actual mistake might not be what they said. Improve
documentation.
(I started out just intending to fix the compiler warning, but the more
I looked at the patch the less I liked it.)
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/name.out | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/test/regress/expected/name.out b/src/test/regress/expected/name.out index 56139d45efc..acc5ce61939 100644 --- a/src/test/regress/expected/name.out +++ b/src/test/regress/expected/name.out @@ -142,7 +142,7 @@ SELECT parse_ident('foo.boo'); (1 row) SELECT parse_ident('foo.boo[]'); -- should fail -ERROR: identifier contains disallowed characters: "foo.boo[]" +ERROR: string is not a valid identifier: "foo.boo[]" SELECT parse_ident('foo.boo[]', strict => false); -- ok parse_ident ------------- @@ -151,15 +151,17 @@ SELECT parse_ident('foo.boo[]', strict => false); -- ok -- should fail SELECT parse_ident(' '); -ERROR: missing valid identifier: " " +ERROR: string is not a valid identifier: " " SELECT parse_ident(' .aaa'); -ERROR: missing valid identifier before "." symbol: " .aaa" +ERROR: string is not a valid identifier: " .aaa" +DETAIL: No valid identifier before "." symbol. SELECT parse_ident(' aaa . '); -ERROR: missing valid identifier after "." symbol: " aaa . " +ERROR: string is not a valid identifier: " aaa . " +DETAIL: No valid identifier after "." symbol. SELECT parse_ident('aaa.a%b'); -ERROR: identifier contains disallowed characters: "aaa.a%b" +ERROR: string is not a valid identifier: "aaa.a%b" SELECT parse_ident(E'X\rXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); -ERROR: identifier contains disallowed characters: "X\rXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +ERROR: string is not a valid identifier: "X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" SELECT length(a[1]), length(a[2]) from parse_ident('"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy') as a ; length | length --------+-------- @@ -179,14 +181,17 @@ SELECT parse_ident(' first . " second " ." third ". " ' || repeat('x',66) (1 row) SELECT parse_ident(E'"c".X XXXX\002XXXXXX'); -ERROR: identifier contains disallowed characters: ""c".X XXXX\u0002XXXXXX" +ERROR: string is not a valid identifier: ""c".X XXXXXXXXXX" SELECT parse_ident('1020'); -ERROR: missing valid identifier: "1020" +ERROR: string is not a valid identifier: "1020" SELECT parse_ident('10.20'); -ERROR: missing valid identifier: "10.20" +ERROR: string is not a valid identifier: "10.20" SELECT parse_ident('.'); -ERROR: missing valid identifier before "." symbol: "." +ERROR: string is not a valid identifier: "." +DETAIL: No valid identifier before "." symbol. SELECT parse_ident('.1020'); -ERROR: missing valid identifier before "." symbol: ".1020" +ERROR: string is not a valid identifier: ".1020" +DETAIL: No valid identifier before "." symbol. SELECT parse_ident('xxx.1020'); -ERROR: missing valid identifier after "." symbol: "xxx.1020" +ERROR: string is not a valid identifier: "xxx.1020" +DETAIL: No valid identifier after "." symbol. |
