diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-07-16 13:59:30 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-07-16 13:59:30 -0400 |
commit | 7e10920b75383cd953898468385ae29e76bf184d (patch) | |
tree | ab868a5482914e1edd50ddce3be30c1a02a19de7 /src/mysql.sml | |
parent | 662c635acece462b9a3d8f95f30716f9904b5ad5 (diff) |
MySQL accepts generated demo DDL
Diffstat (limited to 'src/mysql.sml')
-rw-r--r-- | src/mysql.sml | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/mysql.sml b/src/mysql.sml index bada72ed..d8847424 100644 --- a/src/mysql.sml +++ b/src/mysql.sml @@ -1283,18 +1283,18 @@ fun dmlPrepared {loc, id, dml, inputs} = fun nextval _ = box [] fun nextvalPrepared _ = box [] -fun sqlifyString s = "CAST('" ^ String.translate (fn #"'" => "\\'" - | #"\\" => "\\\\" - | ch => - if Char.isPrint ch then - str ch - else - (ErrorMsg.error - "Non-printing character found in SQL string literal"; - "")) - (String.toString s) ^ "' AS longtext)" - -fun p_cast (s, t) = "CAST(" ^ s ^ " AS " ^ p_sql_type t ^ ")" +fun sqlifyString s = "'" ^ String.translate (fn #"'" => "\\'" + | #"\\" => "\\\\" + | ch => + if Char.isPrint ch then + str ch + else + (ErrorMsg.error + "Non-printing character found in SQL string literal"; + "")) + (String.toString s) ^ "'" + +fun p_cast (s, _) = s fun p_blank _ = "?" @@ -1312,6 +1312,8 @@ val () = addDbms {name = "mysql", sqlifyString = sqlifyString, p_cast = p_cast, p_blank = p_blank, - supportsDeleteAs = false} + supportsDeleteAs = false, + createSequence = fn s => "CREATE TABLE " ^ s ^ " (id INTEGER PRIMARY KEY AUTO_INCREMENT)", + textKeysNeedLengths = true} end |