Skip to content

Commit 040dbf9

Browse files
committed
Fix binding negative ints
1 parent 40cd310 commit 040dbf9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/bind.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ let short ?(unsigned = false) b param ~at =
116116
~at
117117

118118
let int ?(unsigned = false) b param ~at =
119-
let p = allocate int param in
119+
let p = allocate llong (Signed.LLong.of_int param) in
120120
bind b
121-
~buffer:(coerce (ptr int) (ptr void) p)
122-
~size:(sizeof int)
121+
~buffer:(coerce (ptr llong) (ptr void) p)
122+
~size:(sizeof llong)
123123
~mysql_type:T.Type.long_long
124124
~unsigned:(if unsigned then yes else no)
125125
~at

0 commit comments

Comments
 (0)