fetched wrong column lengths
Status: Inactive
Brought to you by:
mummy81
hi,
fyi, i found that mysql c-api's long equals to c#'s int
public static ulong [] FetchLengths(IntPtr result)
{
int n = NumFields(result);
IntPtr lengths = FetchLengthsInternal(result);
if (lengths == IntPtr.Zero)
return null;
//int size =
System.Runtime.InteropServices.Marshal.SizeOf(typeof
(ulong));
ulong [] results = new ulong[n];
unsafe
{
//ulong * ptr = (ulong)lengths;
int * ptr = (int)lengths;
for (int i = 0; i < n; i ++)
{
//results[i] = ptr[i];
results[i] = (ulong) ptr[i];
}
}
return results;
}
thomas