diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-05-27 19:45:52 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-05-27 19:45:52 +0000 |
commit | 4627a8f41975886ddfe4e482d1453cec797415bb (patch) | |
tree | 677fa451e1cc5dab5dc340e1498eae4f4fb0db8c /src | |
parent | 58a2dbc74020d03aa2866ca700f9421827fbb21b (diff) | |
download | postgresql-4627a8f41975886ddfe4e482d1453cec797415bb.tar.gz postgresql-4627a8f41975886ddfe4e482d1453cec797415bb.zip |
Revert ill-considered change to plpgsql: it should not rely on the
current setting of standard_conforming_strings to decide how to quote
strings that will be used later. There is much more to do here but
this particular change breaks the build on Windows, so fix it now.
Diffstat (limited to 'src')
-rw-r--r-- | src/pl/plpgsql/src/gram.y | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/pl/plpgsql/src/gram.y b/src/pl/plpgsql/src/gram.y index dfff1963503..2461deaf328 100644 --- a/src/pl/plpgsql/src/gram.y +++ b/src/pl/plpgsql/src/gram.y @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.89 2006/05/26 23:48:54 momjian Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.90 2006/05/27 19:45:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ #include "plpgsql.h" #include "parser/parser.h" -#include "parser/gramparse.h" + static PLpgSQL_expr *read_sql_construct(int until, int until2, @@ -377,12 +377,16 @@ decl_statement : decl_varname decl_const decl_datatype decl_notnull decl_defval strcpy(buf, "SELECT "); cp1 = new->refname; cp2 = buf + strlen(buf); - if (!standard_conforming_strings && strchr(cp1, '\\') != NULL) + /* + * Don't trust standard_conforming_strings here; + * it might change before we use the string. + */ + if (strchr(cp1, '\\') != NULL) *cp2++ = ESCAPE_STRING_SYNTAX; *cp2++ = '\''; while (*cp1) { - if (SQL_STR_DOUBLE(*cp1, !standard_conforming_strings)) + if (SQL_STR_DOUBLE(*cp1, true)) *cp2++ = *cp1; *cp2++ = *cp1++; } |