diff options
| author | Tom Lane | 2006-05-11 19:15:36 +0000 |
|---|---|---|
| committer | Tom Lane | 2006-05-11 19:15:36 +0000 |
| commit | 637028afe17b9616d279d13d9fc5d6df1ecf369b (patch) | |
| tree | 1e95735e0563109cd859edf95e268a5287a97aae /src/backend/parser | |
| parent | 3fdeb189e977ebe29ee658592d07930e016dd031 (diff) | |
Code review for standard_conforming_strings patch. Fix it so it does not
throw warnings for 100%-SQL-standard constructs, clean up some minor
infelicities, try to un-break ecpg to the best of my ability. (It's not clear
how ecpg is going to find out the setting of standard_conforming_strings,
though.) I think pg_dump still needs work, too.
Diffstat (limited to 'src/backend/parser')
| -rw-r--r-- | src/backend/parser/scan.l | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l index 0ac8d346a7b..78a888e02af 100644 --- a/src/backend/parser/scan.l +++ b/src/backend/parser/scan.l @@ -24,7 +24,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.133 2006/03/14 22:48:21 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.134 2006/05/11 19:15:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -51,12 +51,12 @@ static char *dolqstart; /* current $foo$ quote start string */ /* * GUC variables. This is a DIRECT violation of the warning given at the * head of gram.y, ie flex/bison code must not depend on any GUC variables; - * as such, changing its value can induce very unintuitive behavior. + * as such, changing their values can induce very unintuitive behavior. * But we shall have to live with it as a short-term thing until the switch * to SQL-standard string syntax is complete. */ -bool escape_string_warning; -bool standard_conforming_strings; +bool escape_string_warning = true; +bool standard_conforming_strings = false; static bool warn_on_first_escape; @@ -211,8 +211,7 @@ xehexesc [\\]x[0-9A-Fa-f]{1,2} */ xqstart {quote} xqdouble {quote}{quote} -xqinside [^\\']+ -xqbackslash [\\] +xqinside [^']+ /* $foo$ style quotes ("dollar quoting") * The quoted string starts with $foo$ where "foo" is an optional string @@ -443,7 +442,7 @@ other . yylval.str = litbufdup(); return SCONST; } -<xq,xe>{xqdouble} { +<xq,xe>{xqdouble} { addlitchar('\''); } <xq>{xqinside} { @@ -452,10 +451,6 @@ other . <xe>{xeinside} { addlit(yytext, yyleng); } -<xq>{xqbackslash} { - check_string_escape_warning(yytext[1]); - addlitchar('\\'); - } <xe>{xeescape} { check_string_escape_warning(yytext[1]); addlitchar(unescape_single_char(yytext[1])); |
