Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix comments in the SQLiteException class, including an out-of-order summary end-tag. Make sure the error code of the SQLiteException class gets serialized. Make the test project for the .NET Compact Framework more flexible. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
94c5213e352510706988a172d095d5a1 |
User & Date: | mistachkin 2012-09-12 01:56:02.574 |
Context
2012-09-12
| ||
04:29 | Update SQLite core library to the latest trunk code and add support for the sqlite3_errstr API. check-in: aa7259812f user: mistachkin tags: trunk | |
01:56 | Fix comments in the SQLiteException class, including an out-of-order summary end-tag. Make sure the error code of the SQLiteException class gets serialized. Make the test project for the .NET Compact Framework more flexible. check-in: 94c5213e35 user: mistachkin tags: trunk | |
2012-09-11
| ||
08:15 | Bump all versions to 1.0.83.0. check-in: 45b48f33af user: mistachkin tags: trunk | |
Changes
Changes to Doc/Extra/version.html.
︙ | ︙ | |||
44 45 46 47 48 49 50 51 52 53 54 55 56 57 | <div id="mainBody"> <h1 class="heading">Version History</h1> <p><b>1.0.83.0 - November XX, 2012 <font color="red">(release scheduled)</font></b></p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_14.html">SQLite 3.7.14</a>.</li> <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li> <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li> <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li> <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The ErrorCode field of the LogEventArgs is now an object instead of an integer. <b>** Potentially Incompatible Change **</b></li> <li>The names and messages associated with the SQLiteErrorCode enumeration values have been normalized to match those in the SQLite core library. <b>** Potentially Incompatible Change **</b></li> </ul> <p><b>1.0.82.0 - September 3, 2012</b></p> | > > | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | <div id="mainBody"> <h1 class="heading">Version History</h1> <p><b>1.0.83.0 - November XX, 2012 <font color="red">(release scheduled)</font></b></p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_14.html">SQLite 3.7.14</a>.</li> <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li> <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li> <li>Make sure the error code of the SQLiteException class gets serialized.</li> <li>Make the test project for the .NET Compact Framework more flexible.</li> <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li> <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The ErrorCode field of the LogEventArgs is now an object instead of an integer. <b>** Potentially Incompatible Change **</b></li> <li>The names and messages associated with the SQLiteErrorCode enumeration values have been normalized to match those in the SQLite core library. <b>** Potentially Incompatible Change **</b></li> </ul> <p><b>1.0.82.0 - September 3, 2012</b></p> |
︙ | ︙ |
Changes to System.Data.SQLite/SQLiteException.cs.
︙ | ︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 | namespace System.Data.SQLite { using System; using System.Data.Common; #if !PLATFORM_COMPACTFRAMEWORK using System.Runtime.Serialization; #endif /// <summary> /// SQLite exception class. /// </summary> #if !PLATFORM_COMPACTFRAMEWORK | > | | > > > > > > > > > > | > | > > | > > | > | | | | < > > > > > > > > > > > > > > > > > > > > > > > > > > > | | > | | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | namespace System.Data.SQLite { using System; using System.Data.Common; #if !PLATFORM_COMPACTFRAMEWORK using System.Runtime.Serialization; using System.Security.Permissions; #endif /// <summary> /// SQLite exception class. /// </summary> #if !PLATFORM_COMPACTFRAMEWORK [Serializable()] public sealed class SQLiteException : DbException, ISerializable #else public sealed class SQLiteException : Exception #endif { private SQLiteErrorCode _errorCode; #if !PLATFORM_COMPACTFRAMEWORK /// <summary> /// Private constructor for use with serialization. /// </summary> /// <param name="info"> /// Holds the serialized object data about the exception being thrown. /// </param> /// <param name="context"> /// Contains contextual information about the source or destination. /// </param> private SQLiteException(SerializationInfo info, StreamingContext context) : base(info, context) { _errorCode = (SQLiteErrorCode)info.GetInt32("errorCode"); } #endif /// <summary> /// Public constructor for generating a SQLite exception given the error /// code and message. /// </summary> /// <param name="errorCode"> /// The SQLite return code to report. /// </param> /// <param name="message"> /// Message text to go along with the return code message text. /// </param> public SQLiteException(SQLiteErrorCode errorCode, string message) : base(GetStockErrorMessage(errorCode, message)) { _errorCode = errorCode; } /// <summary> /// Public constructor that uses the base class constructor for the error /// message. /// </summary> /// <param name="message">Error message text.</param> public SQLiteException(string message) : base(message) { } /// <summary> /// Public constructor that uses the default base class constructor. /// </summary> public SQLiteException() { } /// <summary> /// Public constructor that uses the base class constructor for the error /// message and inner exception. /// </summary> /// <param name="message">Error message text.</param> /// <param name="innerException">The original (inner) exception.</param> public SQLiteException(string message, Exception innerException) : base(message, innerException) { } #if !PLATFORM_COMPACTFRAMEWORK /// <summary> /// Adds extra information to the serialized object data specific to this /// class type. This is only used for serialization. /// </summary> /// <param name="info"> /// Holds the serialized object data about the exception being thrown. /// </param> /// <param name="context"> /// Contains contextual information about the source or destination. /// </param> [SecurityPermission( SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public override void GetObjectData( SerializationInfo info, StreamingContext context) { if (info != null) info.AddValue("errorCode", _errorCode); base.GetObjectData(info, context); } #endif /// <summary> /// Gets the underlying SQLite return code for this exception. /// </summary> #if !PLATFORM_COMPACTFRAMEWORK public new SQLiteErrorCode ErrorCode #else public SQLiteErrorCode ErrorCode #endif { get { return _errorCode; } } /// <summary> /// Returns the composite error message based on the SQLite return code /// and the optional detailed error message. /// </summary> /// <param name="errorCode">The SQLite return code.</param> /// <param name="message">Optional detailed error message.</param> /// <returns>Error message text for the return code.</returns> private static string GetStockErrorMessage( SQLiteErrorCode errorCode, string message ) { return String.Format("{0}{1}{2}", SQLiteBase.GetErrorString(errorCode), |
︙ | ︙ |
Changes to Tests/basic.eagle.
︙ | ︙ | |||
1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 | catch {object removecallback threadStart} unset -nocomplain t found i db fileName result directory rename threadStart "" } -constraints {eagle windows monoBug28 command.sql compile.DATA SQLite\ System.Data.SQLite sqlite3_win32_set_directory} -result {Ok Ok True True}} ############################################################################### unset -nocomplain systemDataSQLiteDllFile systemDataSQLiteLinqDllFile \ testExeFile testLinqExeFile northwindEfDbFile testLinqOutFile ############################################################################### | > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 | catch {object removecallback threadStart} unset -nocomplain t found i db fileName result directory rename threadStart "" } -constraints {eagle windows monoBug28 command.sql compile.DATA SQLite\ System.Data.SQLite sqlite3_win32_set_directory} -result {Ok Ok True True}} ############################################################################### runTest {test data-1.34 {serialization of SQLiteException} -body { set serializer [object create -alias \ System.Runtime.Serialization.Formatters.Binary.BinaryFormatter] set stream [object create -alias System.IO.MemoryStream] set exception(1) [object create -alias \ System.Data.SQLite.SQLiteException 14 "this is a test"]; # CantOpen $serializer Serialize $stream $exception(1) $stream Seek 0 Begin set exception(2) [$serializer -alias Deserialize $stream] list [$exception(1) ErrorCode] [$exception(1) Message] \ [$exception(2) ErrorCode] [$exception(2) Message] \ [expr {[$exception(1) ErrorCode] eq [$exception(2) ErrorCode]}] \ [expr {[$exception(1) Message] eq [$exception(2) Message]}] } -cleanup { unset -nocomplain exception stream serializer } -constraints {eagle System.Data.SQLite} -result \ [string map [list \n \r\n] {CantOpen {unable to open database file this is a test} CantOpen {unable to open database file this is a test} True True}]} ############################################################################### unset -nocomplain systemDataSQLiteDllFile systemDataSQLiteLinqDllFile \ testExeFile testLinqExeFile northwindEfDbFile testLinqOutFile ############################################################################### |
︙ | ︙ |
Changes to readme.htm.
︙ | ︙ | |||
189 190 191 192 193 194 195 196 197 198 199 200 201 202 | <p> <b>1.0.83.0 - November XX, 2012</b> </p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_14.html">SQLite 3.7.14</a>.</li> <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li> <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li> <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li> <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The ErrorCode field of the LogEventArgs is now an object instead of an integer. <b>** Potentially Incompatible Change **</b></li> <li>The names and messages associated with the SQLiteErrorCode enumeration values have been normalized to match those in the SQLite core library. <b>** Potentially Incompatible Change **</b></li> </ul> <p> | > > | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | <p> <b>1.0.83.0 - November XX, 2012</b> </p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_14.html">SQLite 3.7.14</a>.</li> <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li> <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li> <li>Make sure the error code of the SQLiteException class gets serialized.</li> <li>Make the test project for the .NET Compact Framework more flexible.</li> <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li> <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The ErrorCode field of the LogEventArgs is now an object instead of an integer. <b>** Potentially Incompatible Change **</b></li> <li>The names and messages associated with the SQLiteErrorCode enumeration values have been normalized to match those in the SQLite core library. <b>** Potentially Incompatible Change **</b></li> </ul> <p> |
︙ | ︙ |
Changes to testce/Program.cs.
1 2 3 4 5 6 7 8 9 10 11 | using System; using System.Data.Common; using System.Data.SQLite; namespace test { class Program { [MTAThread] static void Main() { | > > > > > > > > > > > > > > > > | > | | | | | > > > > > > > > > > | | < | < < | < > | | > > | > | | | > > | > > | > | | < < | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ using System; using System.Data.Common; using System.Data.SQLite; using System.IO; using System.Reflection; using System.Windows.Forms; namespace test { class Program { private static readonly string DefaultConnectionString = "Data Source={DataDirectory}\\test.db;Password=yVXL39etehPX;"; [MTAThread] static void Main() { Assembly assembly = Assembly.GetExecutingAssembly(); AssemblyName assemblyName = assembly.GetName(); string directory = Path.GetDirectoryName(assemblyName.CodeBase); try { File.Delete(directory + "\\test.db"); } catch { } SQLiteFunction.RegisterFunction(typeof(TestFunc)); SQLiteFunction.RegisterFunction(typeof(MyCount)); SQLiteFunction.RegisterFunction(typeof(MySequence)); using (DbConnection cnn = new SQLiteConnection()) { string connectionString = DefaultConnectionString; try { // // NOTE: Attempt to open the configuration file associated with // this test executable. It should contain *EXACTLY* one // line, which will be the connection string to use for // this test run. // using (StreamReader streamReader = File.OpenText( directory + "\\test.cfg")) { connectionString = streamReader.ReadToEnd().Trim(); } } catch { // do nothing. } // // NOTE: If we are unable to obtain a valid connection string // bail out now. // if (connectionString != null) { // // NOTE: Replace the "{DataDirectory}" token, if any, in the // connection string with the actual directory this test // assembly is executing from. // connectionString = connectionString.Replace( "{DataDirectory}", directory); cnn.ConnectionString = connectionString; cnn.Open(); TestCases tests = new TestCases(); tests.Run(cnn); Application.Run(tests.frm); } } } } } |
Changes to testce/TestCases.cs.
︙ | ︙ | |||
75 76 77 78 79 80 81 | internal void Run(DbConnection cnn) { frm = new Form1(); frm.Show(); | > | > > > > > > > > > | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | internal void Run(DbConnection cnn) { frm = new Form1(); frm.Show(); Type type = cnn.GetType(); frm.WriteLine("\r\nBeginning Test on " + type.ToString()); SQLiteConnection cnn2 = cnn as SQLiteConnection; if (cnn2 != null) { cnn2 = null; frm.WriteLine("SQLite v" + SQLiteConnection.SQLiteVersion + " [" + SQLiteConnection.SQLiteSourceId + "]"); } try { CreateTable(cnn); frm.WriteLine("SUCCESS - CreateTable"); } catch (Exception) { frm.WriteLine("FAIL - CreateTable"); } try { DataTypeTest(cnn); frm.WriteLine("SUCCESS - DataType Test"); } catch (Exception) { frm.WriteLine("FAIL - DataType Test"); } try { FullTextTest(cnn); frm.WriteLine("SUCCESS - Full Text Search"); } |
︙ | ︙ |
Added testce/test.cfg.
> | 1 | Data Source={DataDirectory}\test.db; |
Changes to testce/testce.2005.csproj.
︙ | ︙ | |||
87 88 89 90 91 92 93 94 95 96 97 98 99 100 | </ItemGroup> <ItemGroup> <EmbeddedResource Include="Form1.resx"> <DependentUpon>Form1.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> <ItemGroup> <ProjectReference Include="..\System.Data.SQLite\System.Data.SQLite.Compact.2005.csproj"> <Project>{AC139951-261A-4463-B6FA-AEBC25283A66}</Project> <Name>System.Data.SQLite.Compact.2005</Name> </ProjectReference> </ItemGroup> <Import Condition="'$(TargetFrameworkVersion)' == 'v1.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.v1.targets" /> | > > > > > | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | </ItemGroup> <ItemGroup> <EmbeddedResource Include="Form1.resx"> <DependentUpon>Form1.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> <ItemGroup> <Content Include="test.cfg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> <ItemGroup> <ProjectReference Include="..\System.Data.SQLite\System.Data.SQLite.Compact.2005.csproj"> <Project>{AC139951-261A-4463-B6FA-AEBC25283A66}</Project> <Name>System.Data.SQLite.Compact.2005</Name> </ProjectReference> </ItemGroup> <Import Condition="'$(TargetFrameworkVersion)' == 'v1.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.v1.targets" /> |
︙ | ︙ |
Changes to testce/testce.2008.csproj.
︙ | ︙ | |||
88 89 90 91 92 93 94 95 96 97 98 99 100 101 | </ItemGroup> <ItemGroup> <EmbeddedResource Include="Form1.resx"> <DependentUpon>Form1.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> <ItemGroup> <ProjectReference Include="..\System.Data.SQLite\System.Data.SQLite.Compact.2008.csproj"> <Project>{AC139951-261A-4463-B6FA-AEBC25283A66}</Project> <Name>System.Data.SQLite.Compact.2008</Name> </ProjectReference> </ItemGroup> <Import Condition="'$(TargetFrameworkVersion)' == 'v1.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.v1.targets" /> | > > > > > | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | </ItemGroup> <ItemGroup> <EmbeddedResource Include="Form1.resx"> <DependentUpon>Form1.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> <ItemGroup> <Content Include="test.cfg"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> <ItemGroup> <ProjectReference Include="..\System.Data.SQLite\System.Data.SQLite.Compact.2008.csproj"> <Project>{AC139951-261A-4463-B6FA-AEBC25283A66}</Project> <Name>System.Data.SQLite.Compact.2008</Name> </ProjectReference> </ItemGroup> <Import Condition="'$(TargetFrameworkVersion)' == 'v1.0'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.v1.targets" /> |
︙ | ︙ |
Changes to www/news.wiki.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <title>News</title> <b>Version History</b> <p> <b>1.0.83.0 - November XX, 2012 <font color="red">(release scheduled)</font></b> </p> <ul> <li>Updated to [http://www.sqlite.org/releaselog/3_7_14.html|SQLite 3.7.14].</li> <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li> <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li> <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li> <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The ErrorCode field of the LogEventArgs is now an object instead of an integer. <b>** Potentially Incompatible Change **</b></li> <li>The names and messages associated with the SQLiteErrorCode enumeration values have been normalized to match those in the SQLite core library. <b>** Potentially Incompatible Change **</b></li> </ul> <p> | > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <title>News</title> <b>Version History</b> <p> <b>1.0.83.0 - November XX, 2012 <font color="red">(release scheduled)</font></b> </p> <ul> <li>Updated to [http://www.sqlite.org/releaselog/3_7_14.html|SQLite 3.7.14].</li> <li>Add an overload of the SQLiteLog.LogMessage method that takes a single string argument.</li> <li>All applicable calls into the SQLite core library now return a SQLiteErrorCode instead of an integer error code.</li> <li>Make sure the error code of the SQLiteException class gets serialized.</li> <li>Make the test project for the .NET Compact Framework more flexible.</li> <li>When available, the new sqlite3_errstr function from the core library is used to get the error message for a specific return code.</li> <li>The SetMemoryStatus, Shutdown, ResultCode, ExtendedResultCode, and SetAvRetry methods of the SQLiteConnection class now return a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The public constructor for the SQLiteException now takes a SQLiteErrorCode instead of an integer error code. <b>** Potentially Incompatible Change **</b></li> <li>The ErrorCode field of the LogEventArgs is now an object instead of an integer. <b>** Potentially Incompatible Change **</b></li> <li>The names and messages associated with the SQLiteErrorCode enumeration values have been normalized to match those in the SQLite core library. <b>** Potentially Incompatible Change **</b></li> </ul> <p> |
︙ | ︙ |