ocaml-community / ocaml-mariadb

OCaml bindings to MariaDB, supporting the nonblocking API
55 stars 18 forks source link

Prepare of CREATE TABLE and INSERT fails without error details #1

Closed paurkedal closed 7 years ago

paurkedal commented 7 years ago

The command

OCAML_MARIADB_QUERY='CREATE TABLE test (i INTEGER)' ./blocking_example.native

gives

Fatal error: exception Failure("prepare: (0) ")

The query INSERT INTO test VALUES (1) gives the same error, so it's probably related to statements returning empty results.

andrenth commented 7 years ago

Hi.

Thanks for the report. I've pushed a fix to the master branch that I believe fixes this. Could you try it out?

It required an API change (execute returns an Res.t option result to account for an Ok case with no results).

paurkedal commented 7 years ago

It works, thanks!

andrenth commented 7 years ago

I've published a new version, 0.6.0. It should be available on OPAM soon.

Cheers!

On Tue, Dec 13, 2016 at 5:29 AM, Petter Urkedal notifications@github.com wrote:

It works, thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/andrenth/ocaml-mariadb/issues/1#issuecomment-266666528, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB2BYqPcmYaK5KnAVZDeeibfA8VFvSbks5rHklDgaJpZM4LJ6qW .