System.Data.SQLite
Check-in [5ae87a8a66]
Not logged in

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

Overview
Comment:Correct the SQLiteLog output formatting when the message originates from within the System.Data.SQLite library itself.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5ae87a8a66573eb91153c03e38836a3465915b9c
User & Date: mistachkin 2014-05-30 19:36:31
Context
2014-05-30
21:16
Fix DateTime constant handling in the LINQ assembly. Fix for [da9f18d039]. check-in: 4dc462af32 user: mistachkin tags: trunk
19:36
Correct the SQLiteLog output formatting when the message originates from within the System.Data.SQLite library itself. check-in: 5ae87a8a66 user: mistachkin tags: trunk
2014-05-29
04:52
Add the DefaultDbType and DefaultTypeName connection string properties to the SQLiteConnectionStringBuilder class. check-in: 67d18c8ae3 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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

     1      1   /********************************************************
     2      2    * ADO.NET 2.0 Data Provider for SQLite Version 3.X
     3      3    * Written by Robert Simpson (robert@blackcastlesoft.com)
     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     11       using System.Data.Common;
................................................................................
   547    547                   }
   548    548                   else if ((rc == SQLiteErrorCode.Row) ||
   549    549                       (rc == SQLiteErrorCode.Done))
   550    550                   {
   551    551                       type = "data";
   552    552                   }
   553    553               }
          554  +            else if (errorCode == null)
          555  +            {
          556  +                type = "trace";
          557  +            }
   554    558   
   555         -            Trace.WriteLine(String.Format(
   556         -                CultureInfo.CurrentCulture, "SQLite {0} ({1}): {2}",
   557         -                type, errorCode, message));
          559  +            if ((errorCode != null) &&
          560  +                !Object.ReferenceEquals(errorCode, String.Empty))
          561  +            {
          562  +                Trace.WriteLine(String.Format(
          563  +                    CultureInfo.CurrentCulture, "SQLite {0} ({1}): {2}",
          564  +                    type, errorCode, message));
          565  +            }
          566  +            else
          567  +            {
          568  +                Trace.WriteLine(String.Format(
          569  +                    CultureInfo.CurrentCulture, "SQLite {0}: {1}",
          570  +                    type, message));
          571  +            }
   558    572   #endif
   559    573           }
   560    574       }
   561    575   }