Fix test case to work with standards_conforming_strings=off.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 23 Jan 2015 17:04:21 +0000 (19:04 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 23 Jan 2015 17:04:21 +0000 (19:04 +0200)
test/src/result-conversions-test.c

index fd058a2157d71427f4dd1eb39a8cb0c1158ca928..e753720bab05e945c681a6b28bb3405e96963a33 100644 (file)
@@ -421,8 +421,13 @@ test_conversion(const char *pgtype, const char *pgvalue, int sqltype, const char
        exit(1);
    }
 
+   /*
+    * Use dollar-quotes to make the test case insensitive to
+    * standards_conforming_strings. Some of the test values we use contain
+    * backslashes.
+    */
    snprintf(sql, sizeof(sql),
-            "SELECT '%s'::%s AS %s_col /* convert to %s */",
+            "SELECT $$%s$$::%s AS %s_col /* convert to %s */",
             pgvalue, pgtype, pgtype, sqltypestr);
 
    rc = SQLExecDirect(hstmt, (SQLCHAR *) sql, SQL_NTS);