diff src/cjr_print.sml @ 1295:929981850d9d

'tryDml' works with Postgres
author Adam Chlipala <adam@chlipala.net>
date Tue, 07 Sep 2010 09:06:13 -0400
parents b4480a56cab7
children e665527fce1c
line wrap: on
line diff
--- a/src/cjr_print.sml	Tue Sep 07 08:28:07 2010 -0400
+++ b/src/cjr_print.sml	Tue Sep 07 09:06:13 2010 -0400
@@ -1794,10 +1794,7 @@
         end
 
       | EDml {dml, prepared, mode} =>
-        box [case mode of
-                 Settings.Error => box []
-               | Settings.None => string "({const char *uw_errmsg = NULL;",
-             string "(uw_begin_region(ctx), ({",
+        box [string "(uw_begin_region(ctx), ({",
              newline,
              case prepared of
                  NONE => box [string "char *dml = ",
@@ -1838,13 +1835,10 @@
 
              case mode of
                  Settings.Error => string "uw_unit_v;"
-               | Settings.None => string "uw_errmsg ? uw_strdup(ctx, uw_errmsg) : NULL;",
+               | Settings.None => string "uw_dup_and_clear_error_message(ctx);",
 
              newline,
-             string "}))",
-             case mode of
-                 Settings.Error => box []
-               | Settings.None => string ";})"]
+             string "}))"]
 
       | ENextval {seq, prepared} =>
         box [string "({",