diff src/mysql.sml @ 1682:ac141fbb313a

'ORDER BY RANDOM' (based on a patch from Ron de Bruijn)
author Adam Chlipala <adam@chlipala.net>
date Thu, 02 Feb 2012 11:40:10 -0500
parents 3e7c7e200713
children 59b07fdae1ff
line wrap: on
line diff
--- a/src/mysql.sml	Sun Jan 22 20:25:14 2012 -0500
+++ b/src/mysql.sml	Thu Feb 02 11:40:10 2012 -0500
@@ -16,7 +16,7 @@
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
@@ -258,7 +258,7 @@
              string "mysql_free_result(res);",
              newline,
              newline,
-             
+
              string "if (mysql_query(conn->conn, \"",
              string q'',
              string "\")) {",
@@ -503,7 +503,7 @@
                       string "static void uw_db_validate(uw_context ctx) { }"],
              newline,
              newline,
-             
+
              string "static void uw_db_init(uw_context ctx) {",
              newline,
              string "MYSQL *mysql = mysql_init(NULL);",
@@ -829,7 +829,7 @@
                                                    string (Int.toString i),
                                                    string ";",
                                                    newline,
-                                                               
+
                                                    case t of
                                                        Nullable t => buffers t
                                                      | _ => buffers t,
@@ -1123,7 +1123,7 @@
                                                                       string (Int.toString i),
                                                                       string ";",
                                                                       newline]
-                                                                   
+
                                                     | _ => box [string "in[",
                                                                 string (Int.toString i),
                                                                 string "].buffer = &arg",
@@ -1137,7 +1137,7 @@
                                                    string (p_buffer_type t),
                                                    string ";",
                                                    newline,
-                                                               
+
                                                    case t of
                                                        Nullable t => box [string "in[",
                                                                           string (Int.toString i),
@@ -1177,7 +1177,7 @@
                                                                                newline],
                                                                           string "}",
                                                                           newline]
-                                                                          
+
                                                      | _ => buffers t,
                                                    newline]
                                           end) inputs,
@@ -1404,7 +1404,7 @@
                                                                       string (Int.toString i),
                                                                       string ";",
                                                                       newline]
-                                                                   
+
                                                     | _ => box [string "in[",
                                                                 string (Int.toString i),
                                                                 string "].buffer = &arg",
@@ -1425,7 +1425,7 @@
                                                                        string "].is_unsigned = 1;",
                                                                        newline]
                                                      | _ => box [],
-                                                               
+
                                                    case t of
                                                        Nullable t => box [string "in[",
                                                                           string (Int.toString i),
@@ -1465,7 +1465,7 @@
                                                                                newline],
                                                                           string "}",
                                                                           newline]
-                                                                          
+
                                                      | _ => buffers t,
                                                    newline]
                                           end) inputs,
@@ -1529,6 +1529,7 @@
 
 val () = addDbms {name = "mysql",
                   header = Config.msheader,
+                  randomFunction = "RAND",
                   link = "-lmysqlclient",
                   init = init,
                   p_sql_type = p_sql_type,