I've added some tests in this PR related to integer encoding, to demonstrate the range of values supported, and to start a discussion on how to support 64-bit integer encoding.
As you can see from the tests, the current maximun supported value is Int32.max_int. Trying to insert e.g a Unsigned.UInt32.max_int value to an integer unsigned column or a Int.max_int to a bigint column fails.
((2024-10-29 16:15:29.793594000+01:00)
("unhandled exception"
((monitor.ml.Error
(Failure "field 'CAST(sum(i) AS integer)' is not an integer")
("Raised at Stdlib.failwith in file \"stdlib.ml\", line 29, characters 17-33"
"Called from Nonblocking_testsuite.Make.test_txn.(fun) in file \"tests/nonblocking/nonblocking_testsuite.ml\", line 199, characters 36-55"
"Called from Async_kernel__Deferred0.bind.(fun) in file \"src/deferred0.ml\", line 54, characters 64-69"
"Called from Async_kernel__Job_queue.run_jobs in file \"src/job_queue.ml\", line 180, characters 6-47"
"Caught by monitor main"))
test_many_select
Parameter (609520357 : int) came back as (609520357 : int64).
I don't know much about the low level C code, but from an end user perspective I'd say that:
This is based on https://github.com/ocaml-community/ocaml-mariadb/pull/60
I've added some tests in this PR related to
integer
encoding, to demonstrate the range of values supported, and to start a discussion on how to support 64-bit integer encoding.As you can see from the tests, the current maximun supported value is
Int32.max_int
. Trying to insert e.g aUnsigned.UInt32.max_int
value to aninteger unsigned
column or aInt.max_int
to abigint
column fails.I ran the same tests (in this branch) where I included https://github.com/ocaml-community/ocaml-mariadb/pull/54. In this case, the maximum value is
Int.max_int
and both examples above works fine. It still doesn't support 64 bits integer though.So I finally tested it against https://github.com/ocaml-community/ocaml-mariadb/pull/43. I was able to insert (and read back) both
Int64.max_int
andUnsigned.UInt64.max_int
(see commit). Unfortunately, it breaks two other tests:test_txn
test_many_select
I don't know much about the low level C code, but from an end user perspective I'd say that:
integer unsigned
columnsint64