System.Data.SQLite
Check-in [10fae679b2]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Issue warnings on the trace listners if a column type or type name cannot be mapped properly. See ticket [4bbf851fa5].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 10fae679b23bcf783046285b3733e58c9bad5994
User & Date: mistachkin 2012-02-14 22:12:13
References
2012-02-29
14:54 Closed ticket [4bbf851fa5]: DBConcurrencyException plus 1 other change artifact: 774e22236e user: mistachkin
2012-02-19
12:35 Ticket [4bbf851fa5]: 1 change artifact: d4963672c0 user: mistachkin
12:35 Ticket [4bbf851fa5]: 1 change artifact: f4db9f273a user: mistachkin
2012-02-14
22:21 Ticket [4bbf851fa5]: 1 change artifact: ee5ef28fdb user: mistachkin
Context
2012-02-15
07:51
Version and doc updates in preparation for release 1.0.80.0. check-in: 50276145d8 user: mistachkin tags: trunk
2012-02-14
22:12
Issue warnings on the trace listners if a column type or type name cannot be mapped properly. See ticket [4bbf851fa5]. check-in: 10fae679b2 user: mistachkin tags: trunk
2012-02-13
23:39
Test whitespace style adjustments. check-in: c49c15f654 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteConvert.cs.

     4      4    * 
     5      5    * Released to the public domain, use at your own risk!
     6      6    ********************************************************/
     7      7   
     8      8   namespace System.Data.SQLite
     9      9   {
    10     10     using System;
           11  +
           12  +#if DEBUG
           13  +  using System.Diagnostics;
           14  +#endif
           15  +
    11     16     using System.Runtime.InteropServices;
    12     17     using System.Collections.Generic;
    13     18     using System.Globalization;
    14     19     using System.Text;
    15     20   
    16     21     /// <summary>
    17     22     /// This base class provides datatype conversion services for the SQLite provider.
................................................................................
   690    695       {
   691    696         for (int n = 0; n < _dbtypeNames.Length; n++)
   692    697         {
   693    698           if (_dbtypeNames[n].dataType == typ)
   694    699             return _dbtypeNames[n].typeName;
   695    700         }
   696    701   
   697         -      return String.Empty;
          702  +      string defaultTypeName = String.Empty;
          703  +
          704  +#if DEBUG
          705  +      Trace.WriteLine(String.Format(
          706  +          "WARNING: Type mapping failed, returning default name \"{0}\" for type {1}.",
          707  +          defaultTypeName, typ));
          708  +#endif
          709  +
          710  +      return defaultTypeName;
   698    711       }
   699    712   
   700    713       private static SQLiteTypeNames[] _dbtypeNames = {
   701    714         new SQLiteTypeNames("INTEGER", DbType.Int64),
   702    715         new SQLiteTypeNames("TINYINT", DbType.Byte),
   703    716         new SQLiteTypeNames("INT", DbType.Int32),
   704    717         new SQLiteTypeNames("VARCHAR", DbType.AnsiString),
................................................................................
   876    889           if ((index > 0) &&
   877    890               _typeNames.TryGetValue(Name.Substring(0, index), out value))
   878    891           {
   879    892             return value.dataType;
   880    893           }
   881    894         }
   882    895   
   883         -      return DbType.Object;
          896  +      DbType defaultDbType = DbType.Object;
          897  +
          898  +#if DEBUG
          899  +      Trace.WriteLine(String.Format(
          900  +          "WARNING: Type mapping failed, returning default type {0} for name \"{1}\".",
          901  +          defaultDbType, Name));
          902  +#endif
          903  +
          904  +      return defaultDbType;
   884    905       }
   885    906       #endregion
   886    907   
   887    908       private static object _syncRoot = new object();
   888    909       private static Dictionary<string, SQLiteTypeNames> _typeNames = null;
   889    910     }
   890    911