# HG changeset patch # User Adam Chlipala # Date 1256245477 14400 # Node ID d9483301ff0ec6ebaaf7ac911a1998507c46e3c2 # Parent 32dbb5636ae75470d7d5b9800e3b529610437bb2 Get char working with MySQL diff -r 32dbb5636ae7 -r d9483301ff0e src/mysql.sml --- a/src/mysql.sml Thu Oct 22 16:25:31 2009 -0400 +++ b/src/mysql.sml Thu Oct 22 17:04:37 2009 -0400 @@ -49,7 +49,7 @@ Int => "MYSQL_TYPE_LONGLONG" | Float => "MYSQL_TYPE_DOUBLE" | String => "MYSQL_TYPE_STRING" - | Char => "MYSQL_TYPE_TINY" + | Char => "MYSQL_TYPE_STRING" | Bool => "MYSQL_TYPE_LONG" | Time => "MYSQL_TYPE_TIMESTAMP" | Blob => "MYSQL_TYPE_BLOB" @@ -790,6 +790,16 @@ string (Int.toString i), string ";", newline] + | Char => box [string "out[", + string (Int.toString i), + string "].buffer_length = 1;", + newline, + string "out[", + string (Int.toString i), + string "].buffer = &buffer", + string (Int.toString i), + string ";", + newline] | Blob => box [string "out[", string (Int.toString i), string "].length = &length", @@ -927,7 +937,8 @@ newline] | Time => box [string "MYSQL_TIME in_buffer", string (Int.toString i), - string ";", newline] + string ";", + newline] | _ => box [] in box [case t of @@ -1023,6 +1034,16 @@ string (Int.toString i), string ";", newline] + | Char => box [string "in[", + string (Int.toString i), + string "].buffer = &arg", + string (Int.toString (i + 1)), + string ";", + newline, + string "in[", + string (Int.toString i), + string "].buffer_length = 1;", + newline] | Blob => box [string "in[", string (Int.toString i), string "].buffer = arg", @@ -1185,7 +1206,7 @@ fun dml loc = box [string "uw_conn *conn = uw_get_db(ctx);", newline, - string "MYSQL_stmt *stmt = mysql_stmt_init(conn->conn);", + string "MYSQL_STMT *stmt = mysql_stmt_init(conn->conn);", newline, string "if (stmt == NULL) uw_error(ctx, FATAL, \"", string (ErrorMsg.spanToString loc),