diff src/monoize.sml @ 874:3c7b48040dcf

MySQL demo/sql succeeds in reading no rows
author Adam Chlipala <adamc@hcoop.net>
date Sun, 12 Jul 2009 15:05:40 -0400
parents 0f7e2cca6d9b
children dae141d911d9
line wrap: on
line diff
--- a/src/monoize.sml	Sun Jul 12 13:16:05 2009 -0400
+++ b/src/monoize.sml	Sun Jul 12 15:05:40 2009 -0400
@@ -1604,10 +1604,16 @@
             in
                 ((L'.EAbs ("tab", s, (L'.TFun (s, s), loc),
                            (L'.EAbs ("e", s, s,
-                                     strcat [sc "DELETE FROM ",
-                                             (L'.ERel 1, loc),
-                                             sc " AS T WHERE ",
-                                             (L'.ERel 0, loc)]), loc)), loc),
+                                     if #supportsDeleteAs (Settings.currentDbms ()) then
+                                         strcat [sc "DELETE FROM ",
+                                                 (L'.ERel 1, loc),
+                                                 sc " AS T WHERE ",
+                                                 (L'.ERel 0, loc)]
+                                     else
+                                         strcat [sc "DELETE FROM ",
+                                                 (L'.ERel 1, loc),
+                                                 sc " WHERE ",
+                                                 (L'.EFfiApp ("Basis", "unAs", [(L'.ERel 0, loc)]), loc)]), loc)), loc),
                  fm)
             end