summaryrefslogtreecommitdiff
path: root/src/mysql.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/mysql.sml')
-rw-r--r--src/mysql.sml42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/mysql.sml b/src/mysql.sml
index a8a10da7..0715d253 100644
--- a/src/mysql.sml
+++ b/src/mysql.sml
@@ -83,26 +83,28 @@ fun checkRel (table, checkNullable) (s, xts) =
val q' = String.concat ["SELECT COUNT(*) FROM information_schema.columns WHERE ",
both,
" AND (",
- String.concatWith " OR "
- (map (fn (x, t) =>
- String.concat ["(column_name IN ('uw_",
- CharVector.map
- Char.toLower (ident x),
- "', 'uw_",
- ident x,
- "') AND data_type = '",
- p_sql_type_base t,
- "'",
- if checkNullable then
- (" AND is_nullable = '"
- ^ (if isNotNull t then
- "NO"
- else
- "YES")
- ^ "'")
- else
- "",
- ")"]) xts),
+ case String.concatWith " OR "
+ (map (fn (x, t) =>
+ String.concat ["(column_name IN ('uw_",
+ CharVector.map
+ Char.toLower (ident x),
+ "', 'uw_",
+ ident x,
+ "') AND data_type = '",
+ p_sql_type_base t,
+ "'",
+ if checkNullable then
+ (" AND is_nullable = '"
+ ^ (if isNotNull t then
+ "NO"
+ else
+ "YES")
+ ^ "'")
+ else
+ "",
+ ")"]) xts) of
+ "" => "FALSE"
+ | s => s,
")"]
val q'' = String.concat ["SELECT COUNT(*) FROM information_schema.columns WHERE ",