OSDN Git Service

Avoid duplicate warning on nonstandard escaping of strings
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Tue, 6 Jun 2017 07:25:01 +0000 (16:25 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Tue, 6 Jun 2017 08:34:58 +0000 (17:34 +0900)
pg_store_plans emits duplicate warning with core parser for each
nonstandard string escape in expressions of a query. This commit stops
that.

pgsp_json.c

index c39931f..9de20b0 100644 (file)
@@ -442,6 +442,13 @@ normalize_expr(char *expr, bool preserve_space)
                                                         ScanKeywords,
                                                         NumScanKeywords);
 
+       /*
+        * The warnings about nonstandard escape strings is already emitted in the
+        * core. Just silence them here.
+        */
+#if PG_VERSION_NUM >= 90500
+       yyextra.escape_string_warning = false;
+#endif
        lasttok = 0;
        lastloc = -1;