Recent Work on Datatypes

Developers
2004-12-18
2013-04-15
  • Robert Foster
    Robert Foster
    2004-12-18

    Following is a transcript of my discussions with Alexander:

    Hi Alexander,
    Thanks for that, I'll leave it at the current implementation.  What I have done, apart from fix a few bugs that I'd already fixed in my own local version, is change the code to use Int64 for all INT fields (except SMALLINT).  I've also fallen back to using sqlite3_column_type() if
    sqlite3_column_decltype() returns a null.  At least with this we can get a sane data type based on the Storage Classes.  The only thing is that Null values will still get a type of String, regardless of the original field type.

    This has fixed my problem, as I rely on types to determine how to format the data into a DateTime field in the custom datagridtextcolumn.

    I'm thinking that we should examine the actual sql statement, retrieve the schema for any VIEWs, and get the field types from that somehow?  Or maybe that would create too much overhead :(

    I'm also thinking that we need a dev mailing list, so other developers can get in on the discussions.

    Rob.

    -----Original Message-----
    From: Alexander Gavrilov [mailto:xxxxx]
    Sent: Saturday, 18 December 2004 2:48 AM
    To: 'Robert Foster'
    Subject: RE: DateTime issues in SQLite.Net

    Hi Robert!

    The SQLite source code is unified for the Windows and WinCE development. I'm using the modified code from http://sqlite-wince.sourceforge.net/. But if the user is using the precompiled binary of SQLite.NET.DLL, he can just use the latest binary from SQLite site itself.

    Alexander

    -----Original Message-----
    From: Robert Foster [mailto:xxxxx]
    Sent: Friday, December 17, 2004 2:46 AM
    To: 'Alexander Gavrilov'
    Subject: RE: DateTime issues in SQLite.Net

    Hi Alexander,
    Quick question about the SQLite v3 source code... Did you do any modifications to it, or can I just replace it with the latest version?

    Thanks,
    Rob.

    -----Original Message-----
    From: Alexander Gavrilov [mailto:xxxxx]
    Sent: Friday, 17 December 2004 6:45 PM
    To: 'Robert Foster'
    Subject: RE: DateTime issues in SQLite.Net

    Hi Robert!

    Thank you for the offering of help. I'm extremely busy right now and can not tackle with SQLite.NET. I can add to the project as a developer if you like.

    DateTime and Int64 bugs are related. Right now CLR types are determined by the column definitions of the table in the query. But if there is no table in the query, we're in trouble. See the function SQLiteDataReader.SQLType2Type for the implementation. I believe for SQLite 3, CLR types must be based on storage classes (http://www.sqlite.org/datatype3.html). So, if the storage class is INTEGER, GetObject from DataReader must return Int64. If the storage class is REAL, GetObject must return Double and so on.

    Alexander

    -----Original Message-----
    From: Nobody [mailto:nobody@sourceforge.net] On Behalf Of Robert Foster
    Sent: Thursday, December 16, 2004 11:15 PM
    To: xxxxx
    Cc: xxxxx
    Subject: DateTime issues in SQLite.Net

    Message body follows:

    Hi Alexander,
    I'm guessing you don't have much time at the moment to be working on this stuff, but if there's anything I can do to help address the Datetime issues with SQLite 3.x, please, let me know what can be done... I'll have to tackle these problems sooner or later, and I'd rather not go back to v.2 :-/

    Also, how did you go with the Int64 problems (bug #1036755 - Int64 not correctly handled) is that resolved yet?

    Thanks,
    Rob.

     
    • Looks good from the description. Did you commit your changes to CVS? Did you create unit tests for bugs you fixed? Also, did you run all unit tests with your changes applied? FYI, I'm using FullFrameworkUnitTest.nunit together NUnit-Gui to run unit tests.

       
      • Robert Foster
        Robert Foster
        2004-12-18

        I've still got to commit the main work, but I'll make sure I  do the Unit tests before I do (and run them, of course).

         
    • Robert Foster
      Robert Foster
      2004-12-18

      All work checked in and Tests created and ran successfully. :)

       
      • Great job!

        I've adjusted unit tests to Compact Framework. Exceptions in CF do not have StackTrace property so I had to remove them.

        I ran unit tests on my iPAQ and they ran fine except DataAdapterTests. All methods from DataAdapterTests throw TypeLoadException. I didn't have time to understand what's going on. Robert, can you give me some ideas what could cause this exception?

        Keep up a good work!

        Alexander

         
        • Forgot to mention that I commited my changes in unit test to CVS.

           
          • Robert Foster
            Robert Foster
            2004-12-18

            Hmm.. I'll probably pull me old iPaq out of the dust... Can you give me a rundown on the toolset I need to test all this on my iPaq (H3970)?

             
            • I'm using following tools:
              1. Embedded Visual C++ 4.0 (eVC++) to bulld SQLite. It is free download from microsoft. See http://msdn.microsoft.com/mobility/windowsmobile/downloads/default.aspx. Make sure you installed the latest service pack (SP4) for it.
              2. Visual Studio .NET 2003 to build SQLite.NET. I guess you already have it :-)
              3. CFNunitBridge to run unit tests on Pocket PC. http://cfnunitbridge.tigris.org/. You have to build from sources. I think the project supplied with sources is missing reference to nunit.framework.dll. Just add this rreference manually. The DLL itself is supplied with sources.

              After you build everything, you have to copy all EXE and DLLs somewhere into PocketPC and run CFUnitBridge. Then you load UnitTests.dll and run tests.

              That's it.

               
              • Robert Foster
                Robert Foster
                2004-12-19

                Hmm... I'll have to order the ppc2003 upgrade for my ipaq... Don't think SQLite ce supports 2002 :(

                 
              • Robert Foster
                Robert Foster
                2004-12-21

                I'm out of luck here, I only have a H3970, with PPC2002.  I'd have to spend about $110 AUS to upgrade it to PPC2003, so I can't run the tests, and I don't have the time atm to try and backport the SQLite to PPC2002 :(

                 
                • Wel, I guess I'll try to fix it by myself. Thank you for your support.