From: Clinton Ebadi Date: Tue, 25 Feb 2014 11:01:27 +0000 (-0500) Subject: Fix string escaping X-Git-Url: https://git.hcoop.net/hcoop/smlsql.git/commitdiff_plain/refs/heads/master Fix string escaping * Postgresql has strict SQL conformance on by default as of 9.1; use the E'' string format instead of standard escaped strings. --- diff --git a/libpq/pg.sml b/libpq/pg.sml index 1b99da2..09c761a 100644 --- a/libpq/pg.sml +++ b/libpq/pg.sml @@ -158,7 +158,7 @@ struct | xch #"\r" = "\\r" | xch c = str c in - foldl (fn (c, s) => s ^ xch c) "'" (String.explode s) ^ "'" + foldl (fn (c, s) => s ^ xch c) "E'" (String.explode s) ^ "'" end val stringFromSql = valueOf @@ -284,4 +284,4 @@ struct fun boolFromSql v = boolFromSql' (valueOf v) end -structure PgClient = SqlClient(PgDriver) \ No newline at end of file +structure PgClient = SqlClient(PgDriver)