Critical bug inserting PgSqlArray of doubles (data loss)
Posted: Tue 20 Apr 2010 15:01
Hi,
Surprinsing as it may seem, using the code bellow to insert a PgSqlArray of 10 doubles using PgSqlLoader, on my machine, actually results in 20 doubles being inserted.
If binary mode is used, however, the correct number of elements, 10, is inserted.
Hint: I live in continental Europe.
This is at least the fifth trivially reproducible bug I found.
Cool, huh?
BTW, what happened to the beta version that was available before and is not longer there?
Miguel
Surprinsing as it may seem, using the code bellow to insert a PgSqlArray of 10 doubles using PgSqlLoader, on my machine, actually results in 20 doubles being inserted.
If binary mode is used, however, the correct number of elements, 10, is inserted.
Hint: I live in continental Europe.
Code: Select all
object[] a = { 1e-1, 2e-1, 3e-2, 4e-2, 5e-2, 6e-2, 7e-2, 8e-2, 9e-2, 1e-1 };
PgSqlLoader loader = new PgSqlLoader("public.abc", conn);
loader.Columns.Add("arraycolumn", PgSqlType.Array, 0, 0, 0);
loader.Open();
loader.SetValue(0, new PgSqlArray(a, PgSqlType.Double, 1, a.Length));
loader.NextRow();
loader.Close();
Cool, huh?
BTW, what happened to the beta version that was available before and is not longer there?
Miguel