IrenejMarc/dpq

Conversion issue

Opened this issue · 0 comments

o3o commented

I try:

unittest {
   Connection conn = Connection(CONN_STRING);
   auto res = conn.exec("SELECT 1::bigint;");
   Row row = res[0];
   Value v = row[0];
   assert(v.as!long == 1L);
}

and:

$ dub test
core.exception.RangeError@/usr/include/dlang/dmd/std/bitmanip.d(3225): Range violation
----------------
??:? _d_arrayboundsp [0xfa3660ba]
??:? pure nothrow @nogc @safe long std.bitmanip.read!(long, 0, const(ubyte)[]).read(ref const(ubyte)[]) [0xfa33f382]
??:? pure @safe long dpq.serialisers.scalar.ScalarSerialiser.deserialise!(long).deserialise(const(ubyte)[]) [0xfa33f351]
??:? pure @safe long dpq.serialisation.fromBytesImpl!(long).fromBytesImpl(const(ubyte)[], ulong) [0xfa33f315]
??:? pure @safe std.typecons.Nullable!(long).Nullable dpq.serialisation.fromBytes!(long).fromBytes(const(ubyte)[], ulong) [0xfa33f2a1]
??:? pure @safe std.typecons.Nullable!(long).Nullable dpq.value.Value.as!(long).as() [0xfa33e90e]
??:? void app.__unittest_app_165_0() [0xfa323072]
??:? void app.__modtest() [0xfa353708]
??:? int core.runtime.runModuleUnitTests().__foreachbody2(object.ModuleInfo*) [0xfa37d5bf]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)).__lambda2(immutable(object.ModuleInfo*)) [0xfa36530e]
??:? int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))).__foreachbody2(ref rt.sections_elf_shared.DSO) [0xfa36d9ed]
??:? int rt.sections_elf_shared.DSO.opApply(scope int delegate(ref rt.sections_elf_shared.DSO)) [0xfa36db80]
??:? int rt.minfo.moduleinfos_apply(scope int delegate(immutable(object.ModuleInfo*))) [0xfa36d979]
??:? int object.ModuleInfo.opApply(scope int delegate(object.ModuleInfo*)) [0xfa3652e5]
??:? runModuleUnitTests [0xfa37d395]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0xfa368cc0]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0xfa368c47]
??:? _d_run_main [0xfa368bb2]
??:? main [0xfa3538d1]
??:? __libc_start_main [0x96556f49]
1/1 unittests FAILED

Thank you