Index: System.Data.SQLite/SQLiteConnection.cs ================================================================== --- System.Data.SQLite/SQLiteConnection.cs +++ System.Data.SQLite/SQLiteConnection.cs @@ -1439,10 +1439,18 @@ /// /// The connection string /// private string _connectionString; + /// + /// This string will contain enough information to identify this connection, + /// e.g. the database file name, original thread, etc. It is not currently + /// exposed via the public interface as it is intended for use only when + /// debugging this library. + /// + private string _debugString; + /// /// Nesting level of the transactions open on the connection /// internal int _transactionLevel; @@ -2648,11 +2656,11 @@ if (_noDispose) { System.Diagnostics.Trace.WriteLine(HelperMethods.StringFormat( CultureInfo.CurrentCulture, "WARNING: Disposing of connection \"{0}\" with the no-dispose flag set.", - _connectionString)); + _debugString)); } } #endif _disposing = true; @@ -4192,10 +4200,15 @@ OnStateChange(ConnectionState.Open, ref eventArgs); OnChanged(this, new ConnectionEventArgs( SQLiteConnectionEventType.Opened, eventArgs, null, null, null, null, _connectionString, new object[] { opts })); + + _debugString = HelperMethods.StringFormat( + CultureInfo.InvariantCulture, + "threadId = {0}, connectionString = {1}", + HelperMethods.GetThreadId(), _connectionString); } catch { _connectionState = oldstate; throw; Index: System.Data.SQLite/UnsafeNativeMethods.cs ================================================================== --- System.Data.SQLite/UnsafeNativeMethods.cs +++ System.Data.SQLite/UnsafeNativeMethods.cs @@ -539,10 +539,27 @@ { debuggerBreak = false; } } } + + ///////////////////////////////////////////////////////////////////////// + + /// + /// Determines the ID of the current thread. Only used for debugging. + /// + /// + /// The ID of the current thread -OR- zero if it cannot be determined. + /// + internal static int GetThreadId() + { +#if !PLATFORM_COMPACTFRAMEWORK + return AppDomain.GetCurrentThreadId(); +#else + return 0; +#endif + } ///////////////////////////////////////////////////////////////////////// /// /// Determines if preparing a query should be logged. Index: Tests/backup.eagle ================================================================== --- Tests/backup.eagle +++ Tests/backup.eagle @@ -145,11 +145,11 @@ Interpreter interpreter, SQLiteConnection source ) { using (SQLiteConnection destination = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { destination.Open(); int pages = ${pages}; Index: Tests/basic.eagle ================================================================== --- Tests/basic.eagle +++ Tests/basic.eagle @@ -179,11 +179,11 @@ public static class Test${id} { public static DataTable GetReservedWords() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); return connection.GetSchema("ReservedWords"); } @@ -241,11 +241,11 @@ public static class Test${id} { public static DataRowCollection GetForeignKeys() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); return connection.GetSchema("ForeignKeys").Rows; } @@ -322,11 +322,11 @@ ref int count, ref int interval ) { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); // // NOTE: Set the requested retry parameter values. @@ -426,11 +426,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = new SQLiteCommand("${sql}", connection)) @@ -482,11 +482,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = new SQLiteCommand("${sql}", connection)) @@ -542,11 +542,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = new SQLiteCommand("${sql}", connection)) @@ -1176,11 +1176,11 @@ public static void Main() { SQLiteFunction.RegisterFunction(typeof(Test${id})); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteTransaction transaction = connection.BeginTransaction()) @@ -1258,11 +1258,11 @@ public static int Main() { SQLiteFunction.RegisterFunction(typeof(Test${id})); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteTransaction transaction = connection.BeginTransaction()) @@ -2549,11 +2549,11 @@ /////////////////////////////////////////////////////////////////////// public static object DoTest(bool bindFunction) { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); if (bindFunction) { @@ -3311,11 +3311,11 @@ } if (connection == null) { connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]"); + "Data Source=${dataSource};[getTestProperties]"); connection.Open(); } } @@ -3468,11 +3468,11 @@ if (connection == null) { connection = new SQLiteConnection( "Data Source=${dataSource};Pooling=True;" + - "[getFlagsProperty UnbindFunctionsOnClose]"); + "[getTestProperties UnbindFunctionsOnClose]"); connection.Open(); } } @@ -4291,11 +4291,11 @@ } if (connection == null) { connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]"); + "Data Source=${dataSource};[getTestProperties]"); connection.Open(); } } Index: Tests/progress.eagle ================================================================== --- Tests/progress.eagle +++ Tests/progress.eagle @@ -59,11 +59,11 @@ /////////////////////////////////////////////////////////////////////// public static int Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Progress += MyProgressHandler; connection.Open(); using (SQLiteCommand command = new SQLiteCommand("${sql}", @@ -134,11 +134,11 @@ /////////////////////////////////////////////////////////////////////// public static int Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};ProgressOps=1;[getFlagsProperty]")) + "Data Source=${dataSource};ProgressOps=1;[getTestProperties]")) { connection.Progress += MyProgressHandler; connection.Open(); using (SQLiteCommand command = new SQLiteCommand("${sql}", @@ -210,11 +210,11 @@ /////////////////////////////////////////////////////////////////////// public static int Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};ProgressOps=1;[getFlagsProperty]")) + "Data Source=${dataSource};ProgressOps=1;[getTestProperties]")) { connection.Progress += MyProgressHandler; connection.Open(); using (SQLiteCommand command = new SQLiteCommand("${sql}", @@ -287,11 +287,11 @@ /////////////////////////////////////////////////////////////////////// public static int Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};ProgressOps=1;[getFlagsProperty]")) + "Data Source=${dataSource};ProgressOps=1;[getTestProperties]")) { connection.Progress += MyProgressHandler; connection.Open(); using (SQLiteCommand command = new SQLiteCommand("${sql}", Index: Tests/stress.eagle ================================================================== --- Tests/stress.eagle +++ Tests/stress.eagle @@ -1089,16 +1089,16 @@ public static class Test${id} { public static void BackupAndGetData() { using (SQLiteConnection source = new SQLiteConnection( - "FullUri=${dstFileName};[getFlagsProperty {} true]")) + "FullUri=${dstFileName};[getTestProperties {} true]")) { source.Open(); using (SQLiteConnection destination = new SQLiteConnection( - "FullUri=${srcFileName};[getFlagsProperty {} true]")) + "FullUri=${srcFileName};[getTestProperties {} true]")) { destination.Open(); source.BackupDatabase( destination, "main", "main", -1, null, 0); @@ -1172,16 +1172,16 @@ public static class Test${id} { public static void BackupAndGetData() { using (SQLiteConnection source = new SQLiteConnection( - "FullUri=${srcFileName};[getFlagsProperty {} true]")) + "FullUri=${srcFileName};[getTestProperties {} true]")) { source.Open(); using (SQLiteConnection destination = new SQLiteConnection( - "FullUri=${dstFileName};[getFlagsProperty {} true]")) + "FullUri=${dstFileName};[getTestProperties {} true]")) { destination.Open(); source.BackupDatabase( destination, "main", "main", -1, null, 0); Index: Tests/thread.eagle ================================================================== --- Tests/thread.eagle +++ Tests/thread.eagle @@ -205,11 +205,11 @@ // NOTE: Create a new connection object. We purposely avoid // putting this inside a "using" block to help test our // cleanup via the garbage collector. // SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]"); + "Data Source=${dataSource};[getTestProperties]"); // // NOTE: Open the connection. After this point, native memory // and resources have been allocated by this thread. // Index: Tests/tkt-0e48e80333.eagle ================================================================== --- Tests/tkt-0e48e80333.eagle +++ Tests/tkt-0e48e80333.eagle @@ -192,11 +192,11 @@ public static SQLiteConnection MakeConnection() { SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};Journal Mode=Wal;Pooling=true;" + - "[getFlagsProperty AllowNestedTransactions]"); + "[getTestProperties AllowNestedTransactions]"); connection.Open(); connection.Trace += handler; return connection; Index: Tests/tkt-1f7bfff467.eagle ================================================================== --- Tests/tkt-1f7bfff467.eagle +++ Tests/tkt-1f7bfff467.eagle @@ -169,11 +169,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty ${flags}]")) + "Data Source=${dataSource};[getTestProperties ${flags}]")) { connection.Open(); using (SQLiteTransaction transaction1 = connection.BeginTransaction()) @@ -252,11 +252,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty ${flags}]")) + "Data Source=${dataSource};[getTestProperties ${flags}]")) { connection.Open(); using (SQLiteTransaction transaction1 = connection.BeginTransaction()) @@ -339,11 +339,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty ${flags}]")) + "Data Source=${dataSource};[getTestProperties ${flags}]")) { connection.Open(); using (SQLiteTransaction transaction1 = connection.BeginTransaction()) @@ -439,11 +439,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty ${flags}]")) + "Data Source=${dataSource};[getTestProperties ${flags}]")) { connection.Open(); using (SQLiteTransaction transaction1 = connection.BeginTransaction()) Index: Tests/tkt-343d392b51.eagle ================================================================== --- Tests/tkt-343d392b51.eagle +++ Tests/tkt-343d392b51.eagle @@ -127,11 +127,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = connection.CreateCommand()) { @@ -234,11 +234,11 @@ { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};DateTimeFormat=JulianDay;" + - "[getFlagsProperty]")) + "[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = connection.CreateCommand()) { @@ -379,11 +379,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = connection.CreateCommand()) { Index: Tests/tkt-3aa50d8413.eagle ================================================================== --- Tests/tkt-3aa50d8413.eagle +++ Tests/tkt-3aa50d8413.eagle @@ -47,11 +47,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter( "${sql}", connection)) Index: Tests/tkt-47c6fa04d3.eagle ================================================================== --- Tests/tkt-47c6fa04d3.eagle +++ Tests/tkt-47c6fa04d3.eagle @@ -78,11 +78,11 @@ public static DataTable GetDataTable() { DataTable dataTable; using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = new SQLiteCommand(@"${sql}", connection)) Index: Tests/tkt-48a6b8e4ca.eagle ================================================================== --- Tests/tkt-48a6b8e4ca.eagle +++ Tests/tkt-48a6b8e4ca.eagle @@ -45,11 +45,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = new SQLiteCommand("${sql}", connection)) Index: Tests/tkt-4a791e70ab.eagle ================================================================== --- Tests/tkt-4a791e70ab.eagle +++ Tests/tkt-4a791e70ab.eagle @@ -38,11 +38,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = connection.CreateCommand()) { Index: Tests/tkt-56b42d99c1.eagle ================================================================== --- Tests/tkt-56b42d99c1.eagle +++ Tests/tkt-56b42d99c1.eagle @@ -44,16 +44,16 @@ using (TransactionScope transactionScope = new TransactionScope( TransactionScopeOption.Required, transactionOptions)) { using (SQLiteConnection connection1 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection1.Open(); using (SQLiteConnection connection2 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection2.Open(); BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField; @@ -137,16 +137,16 @@ using (TransactionScope transactionScope = new TransactionScope( TransactionScopeOption.Required, transactionOptions)) { using (SQLiteConnection connection1 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection1.Open(); using (SQLiteConnection connection2 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection2.Open(); using (SQLiteCommand command1 = connection1.CreateCommand()) { @@ -214,16 +214,16 @@ using (TransactionScope transactionScope = new TransactionScope( TransactionScopeOption.Required, transactionOptions)) { using (SQLiteConnection connection1 = new SQLiteConnection( - "Data Source=${dataSource};Enlist=False;[getFlagsProperty]")) + "Data Source=${dataSource};Enlist=False;[getTestProperties]")) { connection1.Open(); using (SQLiteConnection connection2 = new SQLiteConnection( - "Data Source=${dataSource};Enlist=False;[getFlagsProperty]")) + "Data Source=${dataSource};Enlist=False;[getTestProperties]")) { connection2.Open(); using (SQLiteCommand command1 = connection1.CreateCommand()) { @@ -291,16 +291,16 @@ using (TransactionScope transactionScope = new TransactionScope( TransactionScopeOption.Required, transactionOptions)) { using (SQLiteConnection connection1 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection1.Open(); using (SQLiteConnection connection2 = new SQLiteConnection( - "Data Source=${dataSource};Enlist=False;[getFlagsProperty]")) + "Data Source=${dataSource};Enlist=False;[getTestProperties]")) { connection2.Open(); using (SQLiteCommand command1 = connection1.CreateCommand()) { @@ -368,16 +368,16 @@ using (TransactionScope transactionScope = new TransactionScope( TransactionScopeOption.Required, transactionOptions)) { using (SQLiteConnection connection1 = new SQLiteConnection( - "Data Source=${dataSource};Enlist=False;[getFlagsProperty]")) + "Data Source=${dataSource};Enlist=False;[getTestProperties]")) { connection1.Open(); using (SQLiteConnection connection2 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection2.Open(); using (SQLiteCommand command1 = connection1.CreateCommand()) { @@ -441,16 +441,16 @@ using (TransactionScope transactionScope = new TransactionScope( TransactionScopeOption.Required, transactionOptions)) { using (SQLiteConnection connection1 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty $flags]")) + "Data Source=${dataSource};[getTestProperties $flags]")) { connection1.Open(); using (SQLiteConnection connection2 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty $flags]")) + "Data Source=${dataSource};[getTestProperties $flags]")) { connection2.Open(); BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField; @@ -534,16 +534,16 @@ using (TransactionScope transactionScope = new TransactionScope( TransactionScopeOption.Required, transactionOptions)) { using (SQLiteConnection connection1 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty $flags]")) + "Data Source=${dataSource};[getTestProperties $flags]")) { connection1.Open(); using (SQLiteConnection connection2 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty $flags]")) + "Data Source=${dataSource};[getTestProperties $flags]")) { connection2.Open(); using (SQLiteCommand command1 = connection1.CreateCommand()) { @@ -611,16 +611,16 @@ using (TransactionScope transactionScope = new TransactionScope( TransactionScopeOption.Required, transactionOptions)) { using (SQLiteConnection connection1 = new SQLiteConnection( - "Data Source=${dataSource};Enlist=False;[getFlagsProperty $flags]")) + "Data Source=${dataSource};Enlist=False;[getTestProperties $flags]")) { connection1.Open(); using (SQLiteConnection connection2 = new SQLiteConnection( - "Data Source=${dataSource};Enlist=False;[getFlagsProperty $flags]")) + "Data Source=${dataSource};Enlist=False;[getTestProperties $flags]")) { connection2.Open(); using (SQLiteCommand command1 = connection1.CreateCommand()) { @@ -688,16 +688,16 @@ using (TransactionScope transactionScope = new TransactionScope( TransactionScopeOption.Required, transactionOptions)) { using (SQLiteConnection connection1 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty $flags]")) + "Data Source=${dataSource};[getTestProperties $flags]")) { connection1.Open(); using (SQLiteConnection connection2 = new SQLiteConnection( - "Data Source=${dataSource};Enlist=False;[getFlagsProperty $flags]")) + "Data Source=${dataSource};Enlist=False;[getTestProperties $flags]")) { connection2.Open(); using (SQLiteCommand command1 = connection1.CreateCommand()) { @@ -765,16 +765,16 @@ using (TransactionScope transactionScope = new TransactionScope( TransactionScopeOption.Required, transactionOptions)) { using (SQLiteConnection connection1 = new SQLiteConnection( - "Data Source=${dataSource};Enlist=False;[getFlagsProperty $flags]")) + "Data Source=${dataSource};Enlist=False;[getTestProperties $flags]")) { connection1.Open(); using (SQLiteConnection connection2 = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty $flags]")) + "Data Source=${dataSource};[getTestProperties $flags]")) { connection2.Open(); using (SQLiteCommand command1 = connection1.CreateCommand()) { Index: Tests/tkt-6434e23a0f.eagle ================================================================== --- Tests/tkt-6434e23a0f.eagle +++ Tests/tkt-6434e23a0f.eagle @@ -48,11 +48,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter( "${sql}", connection)) Index: Tests/tkt-6c6ecccc5f.eagle ================================================================== --- Tests/tkt-6c6ecccc5f.eagle +++ Tests/tkt-6c6ecccc5f.eagle @@ -44,11 +44,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = new SQLiteCommand("${sql}", connection)) Index: Tests/tkt-72905c9a77.eagle ================================================================== --- Tests/tkt-72905c9a77.eagle +++ Tests/tkt-72905c9a77.eagle @@ -169,11 +169,11 @@ // NOTE: Create and open a connection and use it to log a // test message just to make sure that the logging // system is initialized and in working order. // using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); connection.LogMessage(0, "TEST ${id}"); } } Index: Tests/tkt-7e3fa93744.eagle ================================================================== --- Tests/tkt-7e3fa93744.eagle +++ Tests/tkt-7e3fa93744.eagle @@ -95,11 +95,11 @@ public static class Test${id} { public static int Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = connection.CreateCommand()) { Index: Tests/tkt-85b824b736.eagle ================================================================== --- Tests/tkt-85b824b736.eagle +++ Tests/tkt-85b824b736.eagle @@ -81,11 +81,11 @@ public static StringList GetList(params string\[\] strings) { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); SQLiteModuleTest${id} module = new SQLiteModuleTest${id}( "mod${id}", strings); @@ -200,11 +200,11 @@ public static ByteList GetList(params string\[\] strings) { ByteList result = new ByteList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); SQLiteModuleTest${id} module = new SQLiteModuleTest${id}( "mod${id}", strings); Index: Tests/tkt-996d13cd87.eagle ================================================================== --- Tests/tkt-996d13cd87.eagle +++ Tests/tkt-996d13cd87.eagle @@ -148,11 +148,11 @@ // Thread.Sleep(random.Next(0, 500)); SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};Pooling=${pooling};" + - "[getFlagsProperty]"); + "[getTestProperties]"); connection.Open(); using (SQLiteCommand command = new SQLiteCommand("${sql}", connection)) Index: Tests/tkt-ae5267b863.eagle ================================================================== --- Tests/tkt-ae5267b863.eagle +++ Tests/tkt-ae5267b863.eagle @@ -69,11 +69,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteCommand command = connection.CreateCommand()) { Index: Tests/tkt-e1b2e0f769.eagle ================================================================== --- Tests/tkt-e1b2e0f769.eagle +++ Tests/tkt-e1b2e0f769.eagle @@ -97,11 +97,11 @@ ///////////////////////////////////////////////////////////////////// public static int Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); return Tkt_e1b2e0f769(connection).Count; } Index: Tests/tkt-e30b820248.eagle ================================================================== --- Tests/tkt-e30b820248.eagle +++ Tests/tkt-e30b820248.eagle @@ -60,11 +60,11 @@ { Trace.Listeners.Add(listener); Trace.WriteLine("---- START TRACE \\"${name}\\""); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); connection.LogMessage(0, "Connection opened."); using (SQLiteTransaction transaction = @@ -156,11 +156,11 @@ #region Public Static Methods public static void OpenConnection() { connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]"); + "Data Source=${dataSource};[getTestProperties]"); connection.Open(); connection.LogMessage(0, "Connection opened."); } Index: Tests/tkt-ef2216192d.eagle ================================================================== --- Tests/tkt-ef2216192d.eagle +++ Tests/tkt-ef2216192d.eagle @@ -42,11 +42,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); using (SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter( "${sql}", connection)) Index: Tests/vtab.eagle ================================================================== --- Tests/vtab.eagle +++ Tests/vtab.eagle @@ -84,11 +84,11 @@ public static class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); connection.CreateModule(new SQLiteModuleTest${id}("mod${id}")); using (SQLiteCommand command = connection.CreateCommand()) @@ -153,11 +153,11 @@ public static StringList GetList(params string\[\] strings) { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); connection.CreateModule(new SQLiteModuleEnumerable( "mod${id}", strings)); @@ -261,11 +261,11 @@ public static StringList GetList(params string\[\] strings) { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); SQLiteModule module = new SQLiteModuleEnumerable( "mod${id}", strings); @@ -373,11 +373,11 @@ public static StringList GetList(params int\[\] integers) { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); connection.CreateModule(new SQLiteModuleEnumerable( "mod${id}", integers)); @@ -481,11 +481,11 @@ public static StringList GetList(params int\[\] integers) { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); SQLiteModule module = new SQLiteModuleEnumerable( "mod${id}", integers); @@ -717,11 +717,11 @@ public static StringList GetList() { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty NoBindFunctions]")) + "Data Source=${dataSource};[getTestProperties NoBindFunctions]")) { connection.Open(); connection.CreateModule(new SQLiteModuleTest${id}("mod${id}")); try @@ -970,11 +970,11 @@ public static StringList GetList() { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); connection.CreateModule(new SQLiteModuleTest${id}("mod${id}")); try @@ -1139,11 +1139,11 @@ public static StringList GetList() { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); connection.CreateModule(new SQLiteModuleTest${id}("mod${id}")); try @@ -1316,11 +1316,11 @@ public static StringList GetList(params string\[\] strings) { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); SQLiteModuleTest${id} module = new SQLiteModuleTest${id}( "mod${id}", strings); @@ -1461,11 +1461,11 @@ public static StringList GetList(params string\[\] strings) { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); SQLiteModuleTest${id} module = new SQLiteModuleTest${id}( "mod${id}", strings); @@ -1555,11 +1555,11 @@ public static class Test${id} { public static object GetSum() { using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); byte\[\] bytes = new byte\[1048576\]; new Random().NextBytes(bytes); @@ -1637,11 +1637,11 @@ public static StringList GetList(params string\[\] strings) { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); connection.CreateModule(new SQLiteModuleEnumerable( "mod${id}", strings)); @@ -1735,11 +1735,11 @@ public static StringList GetList(params string\[\] strings) { StringList result = new StringList(); using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};[getFlagsProperty]")) + "Data Source=${dataSource};[getTestProperties]")) { connection.Open(); connection.CreateModule(new SQLiteModuleEnumerable( "mod${id}", strings, true)); Index: lib/System.Data.SQLite/common.eagle ================================================================== --- lib/System.Data.SQLite/common.eagle +++ lib/System.Data.SQLite/common.eagle @@ -2527,10 +2527,35 @@ return [appendArgs "Flags=" $flags \;] } return "" } + + proc getTestProperties { {flags ""} {quiet false} } { + # + # NOTE: Start with "Flags" property for the new connection, if any. + # + set result [getFlagsProperty $flags $quiet] + + # + # NOTE: Add the name of the current test file, if available. This is + # only used for debugging. + # + if {[info exists ::test_file]} then { + append result {TestFile=${::test_file};} + } + + # + # NOTE: Add the name of the current test, if available. This is only + # used for debugging. + # + if {[info exists ::eagle_tests(CurrentName)]} then { + append result {TestName=${::eagle_tests(CurrentName)};} + } + + return $result + } proc enableSharedCache { channel enable {quiet false} } { if {[catch { object invoke -flags +NonPublic \ System.Data.SQLite.UnsafeNativeMethods \ @@ -2658,10 +2683,26 @@ # string, append it now. # if {[string length $extra] > 0} then { append connection \; $extra } + + # + # NOTE: Add the name of the current test file, if available. This is + # only used for debugging. + # + if {[info exists ::test_file]} then { + append connection {;TestFile=${::test_file}} + } + + # + # NOTE: Add the name of the current test, if available. This is only + # used for debugging. + # + if {[info exists ::eagle_tests(CurrentName)]} then { + append connection {;TestName=${::eagle_tests(CurrentName)}} + } # # NOTE: For clarity, append a final semicolon to the connection string. # append connection \; @@ -4953,11 +4994,11 @@ # NOTE: Save the test constraints for use by threads created in this # application domain. This is necessary because all the Eagle # "test context" information is per-thread. # if {![info exists ::test_constraints]} then { - set ::test_constraints $::eagle_tests(constraints) + set ::test_constraints $::eagle_tests(Constraints) } # # NOTE: Load the "after-constraints" custom per-user and/or per-host # test settings now.