[Mono-list] Bug (?) in SqliteDataReader

Joshua Tauberer tauberer at for.net
Mon May 15 18:31:21 EDT 2006


Nikki Locke wrote:
> Oh, pity. Try http://www.trumphurst.com/Test.cs.html for the test program.
> I'd be interested to see what results you get? It probably depends on whether
> you are in the US or not.

So, to recap what is happening:

You insert the string '2006-05-11 11:45:00' into a DATE column.

SqliteDataReader sees it's a string in a DATE column and uses
DateTime.Parse() on it, yielding a DateTime.  Since the input is
unambiguous, this is fine in any culture (afaik) and presumably yields
the correct date.

Somewhere in the process of filling the DataTable, the DateTime is
converted back to a string because GetSchemaTable says the column is
string-typed.  The conversion yields a culture-dependent string.  *This*
is where the Windows/Linux difference is because this is the only point
where different code is executing on Windows/Linux.

I don't know anything about DataTables so I'm not the person to be
looking into that, though.

Your patch might be good, but it might just be masking another problem
that should be fixed.  I'm not sure.  (If anyone else reading has some
thoughts...)

-- 
- Joshua Tauberer

http://taubz.for.net

"Unfortunately, we're having this discussion. It's too bad,
because guess who listens to the discussion: the enemy."


More information about the Mono-list mailing list