Specifying encoding on database creation
[hcoop/domtool2.git] / src / plugins / mysql.sml
index 3cfa94f..a10fbbc 100644 (file)
@@ -43,9 +43,12 @@ fun passwd {user, passwd} =
     else
        SOME "Password contains characters besides letters, digits, and !.-_"
 
-fun createdb {user, dbname} =
-    Option.map (fn s => "Error executing CREATE DATABASE script:\n" ^ s)
-              (Slave.shellOutput [Config.MySQL.createdb, user, " ", dbname])
+fun createdb {user, dbname, encoding} =
+    case encoding of
+       SOME _ => SOME "MySQL doesn't support specifying encodings"
+      | NONE =>
+       Option.map (fn s => "Error executing CREATE DATABASE script:\n" ^ s)
+                  (Slave.shellOutput [Config.MySQL.createdb, user, " ", dbname])
 
 fun dropdb {user, dbname} =
     Option.map (fn s => "Error executing DROP DATABASE script:\n" ^ s)