System.Data.SQLite
Check-in [8d08bc1cf9]
Not logged in

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

Overview
Comment:Compilation fixes for .NET Compact Framework with custom compile options.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8d08bc1cf9665fc6c54fe1adbd1dea682de8a498
User & Date: mistachkin 2015-08-12 17:53:07
Context
2015-08-12
19:59
Revise and extend compilation fixes from the previous check-in. check-in: 9582604b8d user: mistachkin tags: trunk
17:53
Compilation fixes for .NET Compact Framework with custom compile options. check-in: 8d08bc1cf9 user: mistachkin tags: trunk
2015-08-08
01:28
Prevent encrypted connections from being used with the connection pool. Pursuant to [89d3a159f1]. check-in: 661e488237 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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

    39     39   
    40     40       static SQLiteFactory()
    41     41       {
    42     42   #if (SQLITE_STANDARD || USE_INTEROP_DLL || PLATFORM_COMPACTFRAMEWORK) && PRELOAD_NATIVE_LIBRARY
    43     43           UnsafeNativeMethods.Initialize();
    44     44   #endif
    45     45   
    46         -#if INTEROP_LOG
           46  +#if USE_INTEROP_DLL && INTEROP_LOG
    47     47           if (UnsafeNativeMethods.sqlite3_config_log_interop() == SQLiteErrorCode.Ok)
    48     48           {
    49     49               UnsafeNativeMethods.sqlite3_log(
    50     50                   SQLiteErrorCode.Ok, SQLiteConvert.ToUTF8("logging initialized."));
    51     51           }
    52     52   #endif
    53     53   

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

  1531   1531           }
  1532   1532   
  1533   1533   #if !PLATFORM_COMPACTFRAMEWORK
  1534   1534           SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_double(handle, index, value);
  1535   1535   #elif !SQLITE_STANDARD
  1536   1536           SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_double_interop(handle, index, ref value);
  1537   1537   #else
         1538  +        SQLiteErrorCode n = SQLiteErrorCode.Ok;
  1538   1539           throw new NotImplementedException();
  1539   1540   #endif
  1540   1541           if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError());
  1541   1542       }
  1542   1543   
  1543   1544       internal override void Bind_Int32(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, int value)
  1544   1545       {
................................................................................
  1595   1596               LogBind(handle, index, value);
  1596   1597           }
  1597   1598   
  1598   1599           SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_int64(handle, index, value);
  1599   1600   #elif !SQLITE_STANDARD
  1600   1601           SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_int64_interop(handle, index, ref value);
  1601   1602   #else
         1603  +        SQLiteErrorCode n = SQLiteErrorCode.Ok;
  1602   1604           throw new NotImplementedException();
  1603   1605   #endif
  1604   1606           if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError());
  1605   1607       }
  1606   1608   
  1607   1609       internal override void Bind_UInt64(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, ulong value)
  1608   1610       {
................................................................................
  1614   1616               LogBind(handle, index, value);
  1615   1617           }
  1616   1618   
  1617   1619           SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_uint64(handle, index, value);
  1618   1620   #elif !SQLITE_STANDARD
  1619   1621           SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_uint64_interop(handle, index, ref value);
  1620   1622   #else
         1623  +        SQLiteErrorCode n = SQLiteErrorCode.Ok;
  1621   1624           throw new NotImplementedException();
  1622   1625   #endif
  1623   1626           if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError());
  1624   1627       }
  1625   1628   
  1626   1629       internal override void Bind_Text(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, string value)
  1627   1630       {
................................................................................
  1683   1686                           LogBind(handle, index, value);
  1684   1687                       }
  1685   1688   
  1686   1689                       SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_int64(handle, index, value);
  1687   1690   #elif !SQLITE_STANDARD
  1688   1691                       SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_int64_interop(handle, index, ref value);
  1689   1692   #else
         1693  +                    SQLiteErrorCode n = SQLiteErrorCode.Ok;
  1690   1694                       throw new NotImplementedException();
  1691   1695   #endif
  1692   1696                       if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError());
  1693   1697                       break;
  1694   1698                   }
  1695   1699               case SQLiteDateFormats.JulianDay:
  1696   1700                   {
................................................................................
  1702   1706                           LogBind(handle, index, value);
  1703   1707                       }
  1704   1708   
  1705   1709                       SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_double(handle, index, value);
  1706   1710   #elif !SQLITE_STANDARD
  1707   1711                       SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_double_interop(handle, index, ref value);
  1708   1712   #else
         1713  +                    SQLiteErrorCode n = SQLiteErrorCode.Ok;
  1709   1714                       throw new NotImplementedException();
  1710   1715   #endif
  1711   1716                       if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError());
  1712   1717                       break;
  1713   1718                   }
  1714   1719               case SQLiteDateFormats.UnixEpoch:
  1715   1720                   {
................................................................................
  1721   1726                           LogBind(handle, index, value);
  1722   1727                       }
  1723   1728   
  1724   1729                       SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_int64(handle, index, value);
  1725   1730   #elif !SQLITE_STANDARD
  1726   1731                       SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_bind_int64_interop(handle, index, ref value);
  1727   1732   #else
         1733  +                    SQLiteErrorCode n = SQLiteErrorCode.Ok;
  1728   1734                       throw new NotImplementedException();
  1729   1735   #endif
  1730   1736                       if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError());
  1731   1737                       break;
  1732   1738                   }
  1733   1739               default:
  1734   1740                   {

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

   877    877   
   878    878                 if (_versionNumber >= 3007014)
   879    879                     SQLiteConnectionHandle.closeConnection = SQLiteBase.CloseConnectionV2;
   880    880             }
   881    881         }
   882    882   #endif
   883    883   
   884         -#if INTEROP_LOG
          884  +#if USE_INTEROP_DLL && INTEROP_LOG
   885    885         if (UnsafeNativeMethods.sqlite3_config_log_interop() == SQLiteErrorCode.Ok)
   886    886         {
   887    887             UnsafeNativeMethods.sqlite3_log(
   888    888                 SQLiteErrorCode.Ok, SQLiteConvert.ToUTF8("logging initialized."));
   889    889         }
   890    890   #endif
   891    891   

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

   100    100           /// <summary>
   101    101           /// The default log event handler.
   102    102           /// </summary>
   103    103           private static SQLiteLogEventHandler _defaultHandler;
   104    104   
   105    105           ///////////////////////////////////////////////////////////////////////
   106    106   
   107         -#if !INTEROP_LOG
          107  +#if !USE_INTEROP_DLL || !INTEROP_LOG
   108    108           /// <summary>
   109    109           /// The log callback passed to native SQLite engine.  This must live
   110    110           /// as long as the SQLite library has a pointer to it.
   111    111           /// </summary>
   112    112           private static SQLiteLogCallback _callback;
   113    113   
   114    114           ///////////////////////////////////////////////////////////////////////
................................................................................
   174    174                   if (_domainUnload == null)
   175    175                   {
   176    176                       _domainUnload = new EventHandler(DomainUnload);
   177    177                       AppDomain.CurrentDomain.DomainUnload += _domainUnload;
   178    178                   }
   179    179   #endif
   180    180   
   181         -#if !INTEROP_LOG
          181  +#if !USE_INTEROP_DLL || !INTEROP_LOG
   182    182                   //
   183    183                   // NOTE: Create an instance of the SQLite wrapper class.
   184    184                   //
   185    185                   if (_sql == null)
   186    186                   {
   187    187                       _sql = new SQLite3(
   188    188                           SQLiteDateFormats.Default, DateTimeKind.Unspecified,
................................................................................
   241    241   
   242    242                   //
   243    243                   // NOTE: Disable logging.  If necessary, it can be re-enabled
   244    244                   //       later by the Initialize method.
   245    245                   //
   246    246                   _enabled = false;
   247    247   
   248         -#if !INTEROP_LOG
          248  +#if !USE_INTEROP_DLL || !INTEROP_LOG
   249    249                   //
   250    250                   // BUGBUG: This will cause serious problems if other AppDomains
   251    251                   //         have any open SQLite connections; however, there is
   252    252                   //         currently no way around this limitation.
   253    253                   //
   254    254                   if (_sql != null)
   255    255                   {

Changes to test/TestCases.cs.

    19     19     {
    20     20       private const int NumThreads = 8;
    21     21       private const int ThreadTimeout = 60000;
    22     22   
    23     23       private List<string> droptables = new List<string>();
    24     24       private List<string> maydroptable = new List<string>();
    25     25   
    26         -#if !INTEROP_LOG
           26  +#if !USE_INTEROP_DLL || !INTEROP_LOG
    27     27       private long logevents = 0;
    28     28   #endif
    29     29   
    30     30       internal TestCases()
    31     31       {
    32     32       }
    33     33   
................................................................................
  1636   1636           SQLiteErrorCode rc = cnn.ResultCode();
  1637   1637           SQLiteErrorCode xrc = cnn.ExtendedResultCode();
  1638   1638   
  1639   1639           cnn.Close();
  1640   1640         }
  1641   1641       }
  1642   1642   
  1643         -#if !INTEROP_LOG
         1643  +#if !USE_INTEROP_DLL || !INTEROP_LOG
  1644   1644       //Logging EventHandler
  1645   1645       public void OnLogEvent(object sender, LogEventArgs logEvent)
  1646   1646       {
  1647   1647           object errorCode = logEvent.ErrorCode;
  1648   1648           string err_msg = logEvent.Message;
  1649   1649           logevents++;
  1650   1650       }