Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepared statements cannot fetch FLOAT values #3

Open
everiq opened this issue Jul 24, 2015 · 1 comment
Open

Prepared statements cannot fetch FLOAT values #3

everiq opened this issue Jul 24, 2015 · 1 comment

Comments

@everiq
Copy link

everiq commented Jul 24, 2015

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.

@darioteixeira
Copy link

The same problem occurs with type double, btw...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants