module M = Mysql
module P = Mysql.Prepared
let () =
let db = M.quick_connect ~database:"test" () in
let _ = M.exec db "create table if not exists x(f float)" in
let _ = M.exec db "insert into x values(1.2)" in
let stmt = P.create db "select * from x" in
begin match P.fetch (P.execute stmt [||]) with
| Some [| Some f |] -> Printf.printf "%S\n" f
| _ -> assert false
end;
P.close stmt
This snippet prints empty string. Expected to print inserted value 1.2.
Looks like fetching of float values is broken for prepared statements.
This snippet prints empty string. Expected to print inserted value
1.2
.Looks like fetching of float values is broken for prepared statements.