Author: rfm
Date: Wed Sep 10 10:45:58 2014
New Revision: 38068

URL: http://svn.gna.org/viewcvs/gnustep?rev=38068&view=rev
Log:
fixup for warnings about escapes

Modified:
    libs/sqlclient/trunk/Postgres.m

Modified: libs/sqlclient/trunk/Postgres.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/Postgres.m?rev=38068&r1=38067&r2=38068&view=diff
==============================================================================
--- libs/sqlclient/trunk/Postgres.m     (original)
+++ libs/sqlclient/trunk/Postgres.m     Wed Sep 10 10:45:58 2014
@@ -201,19 +201,21 @@
              p = PQparameterStatus(connection, "standard_conforming_strings");
               if (p != 0)
                 {
+                  /* The standard conforming strings setting exists,
+                   * so the E'...' syntax must exist and we can use
+                   * it for byte arrays.
+                   */
                   escapeStrings = YES;
+
+                  /* If the escape_string_warning setting is on,
+                   * the server will warn about backslashes even
+                   * in properly quoted strings, so turn it off.
+                   */
+                  [self execute: @"SET escape_string_warning=off", nil];
                 }
               else
                 {
-                  p = PQparameterStatus(connection, "escape_string_warning");
-                  if (p != 0)
-                    {
-                      escapeStrings = YES;
-                    }
-                  else
-                    {
-                      escapeStrings = NO;
-                    }
+                  escapeStrings = NO;
                 }
 
              if ([self debugging] > 0)


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to