Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbra committed Aug 13, 2023
1 parent 7b6f8a0 commit 08f1a1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions grate.unittests/Generic/GenericDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ public virtual async Task Is_created_with_custom_script_if_custom_create_databas

var customScript = Context.Syntax.CreateDatabase(scriptedDatabase, password);
TestConfig.WriteContent(Wrap(config.SqlFilesDirectory, config.Folders?.CreateDatabase?.Path), "createDatabase.sql", customScript);
try
{
//try
//{
await using var migrator = GetMigrator(config);
await migrator.Migrate();

Check failure on line 53 in grate.unittests/Generic/GenericDatabase.cs

View workflow job for this annotation

GitHub Actions / Test report MariaDB

grate.unittests.MariaDB.Database ► Is_created_with_custom_script_if_custom_create_database_folder_exists

Failed test found in: test-results-MariaDB.xml Error: MySqlConnector.MySqlException : Unknown database 'DEFAULTDATABASE' Data: Server Error Code: 1049 SqlState: 42000
Raw output
MySqlConnector.MySqlException : Unknown database 'DEFAULTDATABASE'
Data:
  Server Error Code: 1049
  SqlState: 42000
   at MySqlConnector.Core.ServerSession.ReceiveReplyAsyncAwaited(ValueTask`1 task) in /_/src/MySqlConnector/Core/ServerSession.cs:line 966
   at MySqlConnector.Core.ServerSession.ConnectAsync(ConnectionSettings cs, MySqlConnection connection, Int32 startTickCount, ILoadBalancer loadBalancer, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ServerSession.cs:line 570
   at MySqlConnector.Core.ConnectionPool.ConnectSessionAsync(MySqlConnection connection, String logMessage, Int32 startTickCount, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 410
   at MySqlConnector.Core.ConnectionPool.ConnectSessionAsync(MySqlConnection connection, String logMessage, Int32 startTickCount, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 415
   at MySqlConnector.Core.ConnectionPool.GetSessionAsync(MySqlConnection connection, Int32 startTickCount, Int32 timeoutMilliseconds, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 105
   at MySqlConnector.Core.ConnectionPool.GetSessionAsync(MySqlConnection connection, Int32 startTickCount, Int32 timeoutMilliseconds, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/ConnectionPool.cs:line 135
   at MySqlConnector.MySqlConnection.CreateSessionAsync(ConnectionPool pool, Int32 startTickCount, Activity activity, Nullable`1 ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlConnection.cs:line 929
   at MySqlConnector.MySqlConnection.OpenAsync(Nullable`1 ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlConnection.cs:line 423
   at grate.Migration.AnsiSqlDatabase.Open(DbConnection conn)
   at grate.Migration.AnsiSqlDatabase.OpenNewActiveConnection()
   at grate.Migration.GrateMigrator.CreateGrateStructure(IDbMigrator dbMigrator)
   at grate.Migration.GrateMigrator.Migrate()
   at grate.unittests.Generic.GenericDatabase.Is_created_with_custom_script_if_custom_create_database_folder_exists() in /home/runner/work/grate/grate/grate.unittests/Generic/GenericDatabase.cs:line 53
   at grate.unittests.Generic.GenericDatabase.Is_created_with_custom_script_if_custom_create_database_folder_exists() in /home/runner/work/grate/grate/grate.unittests/Generic/GenericDatabase.cs:line 66
   at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
   at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter)
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.<>c__DisplayClass4_0.<PerformWork>b__0()
   at NUnit.Framework.Internal.ContextUtils.<>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated(ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated[T](Func`1 func)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()

Check failure on line 53 in grate.unittests/Generic/GenericDatabase.cs

View workflow job for this annotation

GitHub Actions / Test report Oracle

grate.unittests.Oracle.Database ► Is_created_with_custom_script_if_custom_create_database_folder_exists

Failed test found in: test-results-Oracle.xml Error: Oracle.ManagedDataAccess.Client.OracleException : ORA-06550: line 3, column 105: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem return returning <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between into using || multiset bulk member submultiset
Raw output
Oracle.ManagedDataAccess.Client.OracleException : ORA-06550: line 3, column 105:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

   * & = - + ; < / > at in is mod remainder not rem return
   returning <an exponent (**)> <> or != or ~= >= <= <> and or
   like like2 like4 likec between into using || multiset bulk
   member submultiset
   at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone)
   at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteNonQuery(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, OracleException& exceptionForArrayBindDML, OracleConnection connection, Boolean isFromEF)
   at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteNonQuery()
   at System.Data.Common.DbCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at grate.Migration.AnsiSqlDatabase.ExecuteNonQuery(DbConnection conn, String sql, Nullable`1 timeout)
   at grate.Migration.AnsiSqlDatabase.ExecuteNonQuery(DbConnection conn, String sql, Nullable`1 timeout)
   at grate.Migration.AnsiSqlDatabase.RunSql(String sql, ConnectionType connectionType, TransactionHandling transactionHandling)
   at grate.Migration.DbMigrator.RunTheActualSqlWithoutLogging(String sql, String scriptName, ConnectionType connectionType, TransactionHandling transactionHandling)
   at grate.Migration.DbMigrator.RunTheActualSqlWithoutLogging(String sql, String scriptName, ConnectionType connectionType, TransactionHandling transactionHandling)
   at grate.Migration.DbMigrator.<>c__DisplayClass29_0.<<RunSqlWithoutLogging>g__PrintLogAndRunSql|0>d.MoveNext()
--- End of stack trace from previous location ---
   at grate.Migration.DbMigrator.RunSqlWithoutLogging(String sql, String scriptName, GrateEnvironment environment, ConnectionType connectionType, TransactionHandling transactionHandling)
   at grate.Migration.GrateMigrator.ProcessWithoutLogging(DirectoryInfo root, MigrationsFolder folder, String changeDropFolder, ConnectionType connectionType, TransactionHandling transactionHandling)
   at grate.Migration.GrateMigrator.CreateDatabaseIfItDoesNotExist(IDbMigrator dbMigrator)
   at grate.Migration.GrateMigrator.Migrate()
   at grate.unittests.Generic.GenericDatabase.Is_created_with_custom_script_if_custom_create_database_folder_exists() in /home/runner/work/grate/grate/grate.unittests/Generic/GenericDatabase.cs:line 53
   at grate.unittests.Generic.GenericDatabase.Is_created_with_custom_script_if_custom_create_database_folder_exists() in /home/runner/work/grate/grate/grate.unittests/Generic/GenericDatabase.cs:line 66
   at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
   at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter)
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.<>c__DisplayClass4_0.<PerformWork>b__0()
   at NUnit.Framework.Internal.ContextUtils.<>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated(ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated[T](Func`1 func)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()

Check failure on line 53 in grate.unittests/Generic/GenericDatabase.cs

View workflow job for this annotation

GitHub Actions / Test report PostgreSQL

grate.unittests.PostgreSQL.Database ► Is_created_with_custom_script_if_custom_create_database_folder_exists

Failed test found in: test-results-PostgreSQL.xml Error: Npgsql.PostgresException : 3D000: database "DEFAULTDATABASE" does not exist Data: Severity: FATAL InvariantSeverity: FATAL SqlState: 3D000 MessageText: database "DEFAULTDATABASE" does not exist File: postinit.c Line: 945 Routine: InitPostgres
Raw output
Npgsql.PostgresException : 3D000: database "DEFAULTDATABASE" does not exist
Data:
  Severity: FATAL
  InvariantSeverity: FATAL
  SqlState: 3D000
  MessageText: database "DEFAULTDATABASE" does not exist
  File: postinit.c
  Line: 945
  Routine: InitPostgres
   at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|234_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
   at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|216_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
   at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
   at Npgsql.UnpooledDataSource.Get(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
   at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|45_0(Boolean async, CancellationToken cancellationToken)
   at grate.Migration.AnsiSqlDatabase.Open(DbConnection conn)
   at grate.Migration.AnsiSqlDatabase.OpenNewActiveConnection()
   at grate.Migration.GrateMigrator.CreateGrateStructure(IDbMigrator dbMigrator)
   at grate.Migration.GrateMigrator.Migrate()
   at grate.unittests.Generic.GenericDatabase.Is_created_with_custom_script_if_custom_create_database_folder_exists() in /home/runner/work/grate/grate/grate.unittests/Generic/GenericDatabase.cs:line 53
   at grate.unittests.Generic.GenericDatabase.Is_created_with_custom_script_if_custom_create_database_folder_exists() in /home/runner/work/grate/grate/grate.unittests/Generic/GenericDatabase.cs:line 66
   at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
   at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter)
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.<>c__DisplayClass4_0.<PerformWork>b__0()
   at NUnit.Framework.Internal.ContextUtils.<>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated(ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated[T](Func`1 func)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()

Check failure on line 53 in grate.unittests/Generic/GenericDatabase.cs

View workflow job for this annotation

GitHub Actions / Test report SqlServer

grate.unittests.SqlServer.Database ► Is_created_with_custom_script_if_custom_create_database_folder_exists

Failed test found in: test-results-SqlServer.xml Error: Microsoft.Data.SqlClient.SqlException : Cannot open database "DEFAULTDATABASE" requested by the login. The login failed. Login failed for user 'sa'. Data: HelpLink.ProdName: Microsoft SQL Server HelpLink.EvtSrc: MSSQLServer HelpLink.EvtID: 4060 HelpLink.BaseHelpUrl: https://go.microsoft.com/fwlink HelpLink.LinkId: 20476
Raw output
Microsoft.Data.SqlClient.SqlException : Cannot open database "DEFAULTDATABASE" requested by the login. The login failed.
Login failed for user 'sa'.
Data:
  HelpLink.ProdName: Microsoft SQL Server
  HelpLink.EvtSrc: MSSQLServer
  HelpLink.EvtID: 4060
  HelpLink.BaseHelpUrl: https://go.microsoft.com/fwlink
  HelpLink.LinkId: 20476
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
   at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass48_0.<CreateReplaceConnectionContinuation>b__0(Task`1 _)
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at grate.Migration.AnsiSqlDatabase.Open(DbConnection conn)
   at grate.Migration.AnsiSqlDatabase.OpenNewActiveConnection()
   at grate.Migration.GrateMigrator.CreateGrateStructure(IDbMigrator dbMigrator)
   at grate.Migration.GrateMigrator.Migrate()
   at grate.unittests.Generic.GenericDatabase.Is_created_with_custom_script_if_custom_create_database_folder_exists() in /home/runner/work/grate/grate/grate.unittests/Generic/GenericDatabase.cs:line 53
   at grate.unittests.Generic.GenericDatabase.Is_created_with_custom_script_if_custom_create_database_folder_exists() in /home/runner/work/grate/grate/grate.unittests/Generic/GenericDatabase.cs:line 66
   at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
   at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter)
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.<>c__DisplayClass4_0.<PerformWork>b__0()
   at NUnit.Framework.Internal.ContextUtils.<>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated(ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated[T](Func`1 func)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()

Check failure on line 53 in grate.unittests/Generic/GenericDatabase.cs

View workflow job for this annotation

GitHub Actions / Test report SqlServer

grate.unittests.SqlServerCaseSensitive.Database ► Is_created_with_custom_script_if_custom_create_database_folder_exists

Failed test found in: test-results-SqlServer.xml Error: Microsoft.Data.SqlClient.SqlException : Cannot open database "DEFAULTDATABASE" requested by the login. The login failed. Login failed for user 'sa'. Data: HelpLink.ProdName: Microsoft SQL Server HelpLink.EvtSrc: MSSQLServer HelpLink.EvtID: 4060 HelpLink.BaseHelpUrl: https://go.microsoft.com/fwlink HelpLink.LinkId: 20476
Raw output
Microsoft.Data.SqlClient.SqlException : Cannot open database "DEFAULTDATABASE" requested by the login. The login failed.
Login failed for user 'sa'.
Data:
  HelpLink.ProdName: Microsoft SQL Server
  HelpLink.EvtSrc: MSSQLServer
  HelpLink.EvtID: 4060
  HelpLink.BaseHelpUrl: https://go.microsoft.com/fwlink
  HelpLink.LinkId: 20476
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
   at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
   at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
   at Microsoft.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass48_0.<CreateReplaceConnectionContinuation>b__0(Task`1 _)
   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at grate.Migration.AnsiSqlDatabase.Open(DbConnection conn)
   at grate.Migration.AnsiSqlDatabase.OpenNewActiveConnection()
   at grate.Migration.GrateMigrator.CreateGrateStructure(IDbMigrator dbMigrator)
   at grate.Migration.GrateMigrator.Migrate()
   at grate.unittests.Generic.GenericDatabase.Is_created_with_custom_script_if_custom_create_database_folder_exists() in /home/runner/work/grate/grate/grate.unittests/Generic/GenericDatabase.cs:line 53
   at grate.unittests.Generic.GenericDatabase.Is_created_with_custom_script_if_custom_create_database_folder_exists() in /home/runner/work/grate/grate/grate.unittests/Generic/GenericDatabase.cs:line 66
   at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
   at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter)
   at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
   at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.<>c__DisplayClass4_0.<PerformWork>b__0()
   at NUnit.Framework.Internal.ContextUtils.<>c__DisplayClass1_0`1.<DoIsolated>b__0(Object _)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated(ContextCallback callback, Object state)
   at NUnit.Framework.Internal.ContextUtils.DoIsolated[T](Func`1 func)
   at NUnit.Framework.Internal.Execution.SimpleWorkItem.PerformWork()
}
catch (DbException)
{
//}
//catch (DbException e)
//{
//var s = e.Message;
//Do nothing because database name is wrong due to custom script
}
//}

File.Delete(Path.Join(Wrap(config.SqlFilesDirectory, config.Folders?.CreateDatabase?.Path).ToString(), "createDatabase.sql"));

Expand Down
3 changes: 2 additions & 1 deletion grate/Infrastructure/OracleSyntax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public string StatementSeparatorRegex
const string dashComments = @"(?<KEEP1>--.*$)";
const string starComments = @"(?<KEEP1>/\*[\S\s]*?\*/)";
const string batchSeparator = @"(?<KEEP1>.*)(?<BATCHSPLITTER>;)(?<KEEP2>\s|$)";
const string sqlPlusExecuteCommand = @"(?<KEEP1>^|\s)(?<BATCHSPLITTER>\/|;)(?<KEEP2>\s*|$|\n)";
//const string sqlPlusExecuteCommand = @"(?<KEEP1>^|\s)(?<BATCHSPLITTER>\/|;)(?<KEEP2>\s*|$|\n)";
const string sqlPlusExecuteCommand = @"(?<KEEP1>^|\s)(?<BATCHSPLITTER>\/)(?<KEEP2>\s|$)";
return strings + "|" + dashComments + "|" + starComments + "|" + batchSeparator + "|" + sqlPlusExecuteCommand;
}
}
Expand Down

0 comments on commit 08f1a1a

Please sign in to comment.