System.Data.SQLite
Check-in [133b025301]
Not logged in

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

Overview
Comment:Fix some harmless compiler warnings and make sure the String.Format wrapper method is used in the new SQLiteFunction methods.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | delegateFunction
Files: files | file ages | folders
SHA1: 133b025301264043b8de1e873e208b22db7af6c0
User & Date: mistachkin 2015-08-15 23:00:52
Context
2015-08-15
23:07
Merge trunk. check-in: deb2fdb0c9 user: mistachkin tags: delegateFunction
23:00
Fix some harmless compiler warnings and make sure the String.Format wrapper method is used in the new SQLiteFunction methods. check-in: 133b025301 user: mistachkin tags: delegateFunction
22:03
Update version history docs. check-in: 430d13b350 user: mistachkin tags: delegateFunction
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Setup/build.bat.

   267    267     ECHO Could not change directory to "%ROOT%".
   268    268     GOTO errors
   269    269   )
   270    270   
   271    271   SET PATH=%BUILDTOOLDIR%;%PATH%
   272    272   
   273    273   %_VECHO% Path = '%PATH%'
          274  +
          275  +IF NOT DEFINED SOLUTION (
          276  +  IF DEFINED COREONLY (
          277  +    %_AECHO% Building core managed project...
          278  +    SET SOLUTION=.\System.Data.SQLite\System.Data.SQLite.%YEAR%.csproj
          279  +  )
          280  +)
   274    281   
   275    282   IF NOT DEFINED SOLUTION (
   276    283     %_AECHO% Building all projects...
   277    284     SET SOLUTION=.\SQLite.NET.%YEAR%.MSBuild.sln
   278    285   )
   279    286   
   280    287   IF NOT EXIST "%SOLUTION%" (

Changes to System.Data.SQLite/LINQ/SQLiteFactory_Linq.cs.

    56     56           string version =
    57     57   #if NET_40 || NET_45 || NET_451 || NET_46
    58     58               "4.0.0.0";
    59     59   #else
    60     60               "3.5.0.0";
    61     61   #endif
    62     62   
    63         -        _dbProviderServicesType = Type.GetType(String.Format(CultureInfo.InvariantCulture, "System.Data.Common.DbProviderServices, System.Data.Entity, Version={0}, Culture=neutral, PublicKeyToken=b77a5c561934e089", version), false);
           63  +        _dbProviderServicesType = Type.GetType(UnsafeNativeMethods.StringFormat(CultureInfo.InvariantCulture, "System.Data.Common.DbProviderServices, System.Data.Entity, Version={0}, Culture=neutral, PublicKeyToken=b77a5c561934e089", version), false);
    64     64       }
    65     65   
    66     66       /// <summary>
    67     67       /// Will provide a <see cref="IServiceProvider" /> object in .NET 3.5.
    68     68       /// </summary>
    69     69       /// <param name="serviceType">The class or interface type to query for.</param>
    70     70       /// <returns></returns>

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

    46     46           if (disposed)
    47     47               throw new ObjectDisposedException(typeof(SQLiteCommandBuilder).Name);
    48     48   #endif
    49     49       }
    50     50   
    51     51       ///////////////////////////////////////////////////////////////////////////////////////////////
    52     52   
           53  +    /// <summary>
           54  +    /// Cleans up resources (native and managed) associated with the current instance.
           55  +    /// </summary>
           56  +    /// <param name="disposing">
           57  +    /// Zero when being disposed via garbage collection; otherwise, non-zero.
           58  +    /// </param>
    53     59       protected override void Dispose(bool disposing)
    54     60       {
    55     61           try
    56     62           {
    57     63               if (!disposed)
    58     64               {
    59     65                   //if (disposing)

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

  1630   1630           if (disposed)
  1631   1631               throw new ObjectDisposedException(typeof(SQLiteConnection).Name);
  1632   1632   #endif
  1633   1633       }
  1634   1634   
  1635   1635       ///////////////////////////////////////////////////////////////////////////////////////////////
  1636   1636   
         1637  +    /// <summary>
         1638  +    /// Cleans up resources (native and managed) associated with the current instance.
         1639  +    /// </summary>
         1640  +    /// <param name="disposing">
         1641  +    /// Zero when being disposed via garbage collection; otherwise, non-zero.
         1642  +    /// </param>
  1637   1643       protected override void Dispose(bool disposing)
  1638   1644       {
  1639   1645   #if !NET_COMPACT_20 && TRACE_WARNING
  1640   1646           if ((_flags & SQLiteConnectionFlags.TraceWarning) == SQLiteConnectionFlags.TraceWarning)
  1641   1647           {
  1642   1648               if (_noDispose)
  1643   1649               {
................................................................................
  3281   3287       /// The size of the largest committed free block in the heap, in bytes.
  3282   3288       /// This value will be zero unless heap compaction is enabled.
  3283   3289       /// </param>
  3284   3290       /// <returns>
  3285   3291       /// A standard SQLite return code (i.e. zero for success and non-zero
  3286   3292       /// for failure).
  3287   3293       /// </returns>
         3294  +    #pragma warning disable 3001
  3288   3295       public static SQLiteErrorCode ReleaseMemory(
  3289   3296           int nBytes,
  3290   3297           bool reset,
  3291   3298           bool compact,
  3292   3299           ref int nFree,
  3293   3300           ref bool resetOk,
  3294   3301           ref uint nLargest
  3295   3302           )
  3296   3303       {
  3297   3304           return SQLite3.StaticReleaseMemory(
  3298   3305               nBytes, reset, compact, ref nFree, ref resetOk, ref nLargest);
  3299   3306       }
         3307  +    #pragma warning restore 3001
  3300   3308   
  3301   3309       /// <summary>
  3302   3310       /// Sets the status of the memory usage tracking subsystem in the SQLite core library.  By default, this is enabled.
  3303   3311       /// If this is disabled, memory usage tracking will not be performed.  This is not really a per-connection value, it is
  3304   3312       /// global to the process.
  3305   3313       /// </summary>
  3306   3314       /// <param name="value">Non-zero to enable memory usage tracking, zero otherwise.</param>
................................................................................
  5532   5540       int totalPages,
  5533   5541       bool retry
  5534   5542     );
  5535   5543     #endregion
  5536   5544   
  5537   5545     ///////////////////////////////////////////////////////////////////////////////////////////////
  5538   5546   
         5547  +  /// <summary>
         5548  +  /// The event data associated with progress reporting events.
         5549  +  /// </summary>
  5539   5550     public class ProgressEventArgs : EventArgs
  5540   5551     {
  5541   5552         /// <summary>
  5542   5553         /// The user-defined native data associated with this event.  Currently,
  5543   5554         /// this will always contain the value of <see cref="IntPtr.Zero" />.
  5544   5555         /// </summary>
  5545   5556         public readonly IntPtr UserData;

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

   135    135           if (disposed)
   136    136               throw new ObjectDisposedException(typeof(SQLiteDataAdapter).Name);
   137    137   #endif
   138    138       }
   139    139   
   140    140       ///////////////////////////////////////////////////////////////////////////////////////////////
   141    141   
          142  +    /// <summary>
          143  +    /// Cleans up resources (native and managed) associated with the current instance.
          144  +    /// </summary>
          145  +    /// <param name="disposing">
          146  +    /// Zero when being disposed via garbage collection; otherwise, non-zero.
          147  +    /// </param>
   142    148       protected override void Dispose(bool disposing)
   143    149       {
   144    150           try
   145    151           {
   146    152               if (!disposed)
   147    153               {
   148    154                   if (disposing)

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

    26     26           //       been moved to the new SQLiteLog static class.
    27     27           //
    28     28       }
    29     29   
    30     30       ///////////////////////////////////////////////////////////////////////////////////////////////
    31     31   
    32     32       #region IDisposable Members
           33  +    /// <summary>
           34  +    /// Cleans up resources (native and managed) associated with the current instance.
           35  +    /// </summary>
    33     36       public void Dispose()
    34     37       {
    35     38           Dispose(true);
    36     39           GC.SuppressFinalize(this);
    37     40       }
    38     41       #endregion
    39     42   
................................................................................
    70     73           }
    71     74       }
    72     75       #endregion
    73     76   
    74     77       ///////////////////////////////////////////////////////////////////////////////////////////////
    75     78   
    76     79       #region Destructor
           80  +    /// <summary>
           81  +    /// Cleans up resources associated with the current instance.
           82  +    /// </summary>
    77     83       ~SQLiteFactory()
    78     84       {
    79     85           Dispose(false);
    80     86       }
    81     87       #endregion
    82     88   
    83     89       ///////////////////////////////////////////////////////////////////////////////////////////////

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

   197    197           }
   198    198       }
   199    199       #endregion
   200    200   
   201    201       ///////////////////////////////////////////////////////////////////////////////////////////////
   202    202   
   203    203       #region Destructor
          204  +    /// <summary>
          205  +    /// Cleans up resources associated with the current instance.
          206  +    /// </summary>
   204    207       ~SQLiteFunction()
   205    208       {
   206    209           Dispose(false);
   207    210       }
   208    211       #endregion
   209    212   
   210    213       ///////////////////////////////////////////////////////////////////////////////////////////////
................................................................................
  1483   1486         /// </returns>
  1484   1487         public override object Invoke(
  1485   1488             object[] args /* in */
  1486   1489             )
  1487   1490         {
  1488   1491             if (callback1 == null)
  1489   1492             {
  1490         -              throw new InvalidOperationException(String.Format(
         1493  +              throw new InvalidOperationException(
         1494  +                  UnsafeNativeMethods.StringFormat(
         1495  +                  CultureInfo.CurrentCulture,
  1491   1496                     NoCallbackError, "Invoke"));
  1492   1497             }
  1493   1498   
  1494   1499             SQLiteInvokeDelegate invokeDelegate =
  1495   1500                 callback1 as SQLiteInvokeDelegate;
  1496   1501   
  1497   1502             if (invokeDelegate != null)
................................................................................
  1527   1532             object[] args,         /* in */
  1528   1533             int stepNumber,        /* in */
  1529   1534             ref object contextData /* in, out */
  1530   1535             )
  1531   1536         {
  1532   1537             if (callback1 == null)
  1533   1538             {
  1534         -              throw new InvalidOperationException(String.Format(
         1539  +              throw new InvalidOperationException(
         1540  +                  UnsafeNativeMethods.StringFormat(
         1541  +                  CultureInfo.CurrentCulture,
  1535   1542                     NoCallbackError, "Step"));
  1536   1543             }
  1537   1544   
  1538   1545             SQLiteStepDelegate stepDelegate = callback1 as SQLiteStepDelegate;
  1539   1546   
  1540   1547             if (stepDelegate != null)
  1541   1548             {
................................................................................
  1570   1577         /// </returns>
  1571   1578         public override object Final(
  1572   1579             object contextData /* in */
  1573   1580             )
  1574   1581         {
  1575   1582             if (callback2 == null)
  1576   1583             {
  1577         -              throw new InvalidOperationException(String.Format(
         1584  +              throw new InvalidOperationException(
         1585  +                  UnsafeNativeMethods.StringFormat(
         1586  +                  CultureInfo.CurrentCulture,
  1578   1587                     NoCallbackError, "Final"));
  1579   1588             }
  1580   1589   
  1581   1590             SQLiteFinalDelegate finalDelegate = callback2 as SQLiteFinalDelegate;
  1582   1591   
  1583   1592             if (finalDelegate != null)
  1584   1593             {
................................................................................
  1614   1623         public override int Compare(
  1615   1624             string param1, /* in */
  1616   1625             string param2  /* in */
  1617   1626             )
  1618   1627         {
  1619   1628             if (callback1 == null)
  1620   1629             {
  1621         -              throw new InvalidOperationException(String.Format(
         1630  +              throw new InvalidOperationException(
         1631  +                  UnsafeNativeMethods.StringFormat(
         1632  +                  CultureInfo.CurrentCulture,
  1622   1633                     NoCallbackError, "Compare"));
  1623   1634             }
  1624   1635   
  1625   1636             SQLiteCompareDelegate compareDelegate =
  1626   1637                 callback1 as SQLiteCompareDelegate;
  1627   1638   
  1628   1639             if (compareDelegate != null)
................................................................................
  1634   1645             {
  1635   1646                 object result = callback1.DynamicInvoke(GetCompareArgs(
  1636   1647                     param1, param2, false)); /* throw */
  1637   1648   
  1638   1649                 if (result is int)
  1639   1650                     return (int)result;
  1640   1651   
  1641         -              throw new InvalidOperationException(String.Format(
         1652  +              throw new InvalidOperationException(
         1653  +                  UnsafeNativeMethods.StringFormat(
         1654  +                  CultureInfo.CurrentCulture,
  1642   1655                     ResultInt32Error, "Compare"));
  1643   1656             }
  1644   1657         }
  1645   1658         #endregion
  1646   1659     }
  1647   1660   
  1648   1661     /////////////////////////////////////////////////////////////////////////////
................................................................................
  1674   1687           if (disposed)
  1675   1688               throw new ObjectDisposedException(typeof(SQLiteFunctionEx).Name);
  1676   1689   #endif
  1677   1690       }
  1678   1691   
  1679   1692       ///////////////////////////////////////////////////////////////////////////////////////////////
  1680   1693   
         1694  +    /// <summary>
         1695  +    /// Cleans up resources (native and managed) associated with the current instance.
         1696  +    /// </summary>
         1697  +    /// <param name="disposing">
         1698  +    /// Zero when being disposed via garbage collection; otherwise, non-zero.
         1699  +    /// </param>
  1681   1700       protected override void Dispose(bool disposing)
  1682   1701       {
  1683   1702           try
  1684   1703           {
  1685   1704               if (!disposed)
  1686   1705               {
  1687   1706                   //if (disposing)