[Mono-list] Bug (?) in SqliteDataReader

Nikki Locke nikki at trumphurst.com
Mon May 15 12:08:55 EDT 2006


Joshua Tauberer wrote:
> > Joshua Tauberer wrote: 
> >> Nikki Locke wrote: 
> >> > I use the Sqlite database under both Windows and Linux. Under Windows, if I 
> >> > have a date or datetime field, then row data returned from a query on that 
> >> > field is returned as a DateTime. Under Linux, it is returned as a string. 
> >>   
> >> Are you sure you have the same version of mono (esp. 
> >> Mono.Data.SqliteClient) *and* Sqlite (the native library) on both 
> >> systems?   
> > 
> > No. The Windows version is Microsoft, not Mono. 
> > 
> > CentOS comes with sqlite 3 installed, and that is what I have been using. 
>  
> Ok.  Is Sqlite2 present also, tho, on either platform?  The data adapter 
> defaults to Sqlite2 if it's present.  You could try adding "version=3" 
> to the conn string on both platforms (esp. Linux).  And what version of 
> Mono? 

Have version=3 already.

> >> try to turn the value back into a DateTime.   
> > 
> > Where does it try to do that? I can't find the code (and I would really like to, 
> > so I can perhaps make it work more rationally, without recompiling the library). 
>  
> See: 
> mcs/class/Mono.Data.SqliteClient/Mono.Data.SqliteClient/SqliteDataReader.cs: 
>  
> http://svn.myrealbox.com/viewcvs/trunk/mcs/class/Mono.Data.SqliteClient/Mono.Data.SqliteClient/SqliteDataReader.cs?rev=57667&view=auto 

That's 1.1.15 - I was using the stable version, 1.1.13 (although the problem seems to 
still be there in 1.1.15).

> > I enclose a test program as an attachment (please let me know if it doesn't get 
> > through the list). 
>  
> Thunderbird wouldn't render your email at all, actually, at least for me.

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.

Of course, if I could get the Mono debugger working, I might be able to trace 
through the data stuff to see where the DateTime is getting converted to a string :-(

Nikki

-- 
Nikki Locke, Trumphurst Ltd.      PC & Unix consultancy & programming
http://www.trumphurst.com/




More information about the Mono-list mailing list