Skip to content

Commit 44c923c

Browse files
authored
Merge pull request #54 from ahrefs/fix-negative-ints
Fix binding negative ints
2 parents 374a49c + 8a23403 commit 44c923c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/bind.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ 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)
123-
~mysql_type:T.Type.long
121+
~buffer:(coerce (ptr llong) (ptr void) p)
122+
~size:(sizeof llong)
123+
~mysql_type:T.Type.long_long
124124
~unsigned:(if unsigned then yes else no)
125125
~at
126126

0 commit comments

Comments
 (0)