You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Software versions
MySqlConnector version:
The version currently on git (2022-12-16 01:00:00 GMT+1)
Server type (MySQL, MariaDB, Aurora, etc.) and version:
MariaDB 10.9 and also tried with 10.11
.NET version:
4.7.2
(Optional) ORM NuGet packages and versions:
Describe the bug
Getting a MySqlException on a column which I don't have in any of my tables: 'SRS_ID'
Exception
ERROR: MySqlConnector.MySqlException (0x80004005): Unknown column 'SRS_ID' in 'field list'
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
at MySqlConnector.Core.ResultSet.<ReadResultSetHeaderAsync>d__2.MoveNext() in C:\dev\.net\valiweb\trunk\MySqlConnector\Core\ResultSet.cs:line 43
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at MySqlConnector.MySqlDataReader.ActivateResultSet(CancellationToken cancellationToken) in C:\dev\.net\valiweb\trunk\MySqlConnector\MySqlDataReader.cs:line 130
at MySqlConnector.MySqlDataReader.<CreateAsync>d__107.MoveNext() in C:\dev\.net\valiweb\trunk\MySqlConnector\MySqlDataReader.cs:line 489
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at MySqlConnector.Core.CommandExecutor.<ExecuteReaderAsync>d__0.MoveNext() in C:\dev\.net\valiweb\trunk\MySqlConnector\Core\CommandExecutor.cs:line 56
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at MySqlConnector.MySqlCommand.<ExecuteReaderAsync>d__84.MoveNext() in C:\dev\.net\valiweb\trunk\MySqlConnector\MySqlCommand.cs:line 344
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at MySqlConnector.Core.SchemaProvider.<FillDataTableAsync>d__4.MoveNext() in C:\dev\.net\valiweb\trunk\MySqlConnector\Core\SchemaProvider.cs:line 421
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at MySqlConnector.Core.SchemaProvider.<FillColumnsAsync>d__11.MoveNext() in C:\dev\.net\valiweb\trunk\MySqlConnector\Core\SchemaProvider.g.cs:line 216
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at MySqlConnector.Core.SchemaProvider.<GetSchemaAsync>d__6.MoveNext() in C:\dev\.net\valiweb\trunk\MySqlConnector\Core\SchemaProvider.g.cs:line 25
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
at MySqlConnector.MySqlConnection.GetSchema(String collectionName, String[] restrictionValues) in C:\dev\.net\valiweb\trunk\MySqlConnector\MySqlConnection.cs:line 601
at SubSonic.SqlGeneration.Schema.ANSISchemaGenerator.GetTableFromDB(IDataProvider provider, String tableName) in C:\dev\.net\lib\subsonic\trunk\3.0\SubSonic.Core\SQLGeneration\Schema\ANSISchemaGenerator.cs:line 205
at SubSonic.DataProviders.DbDataProvider.GetTableFromDB(String tableName) in C:\dev\.net\lib\subsonic\trunk\3.0\SubSonic.Core\DataProviders\DbDataProvider.cs:line 395
at SubSonic.Schema.Migrator.MigrateFromModel(Type type, IDataProvider provider) in C:\dev\.net\lib\subsonic\trunk\3.0\SubSonic.Core\Schema\Migrator.cs:line 95
at Tim.Migrator.Form1.AddT(Migrator m, Type t, IDataProvider provider, IDataProvider providerRevisions, BatchQuery queryTimDB, BatchQuery queryTimRevisionsDB, List`1 result, String SpecificClass) in C:\dev\.net\valiweb\trunk\Tim.Migrator\Form1.cs:line 163
at Tim.Migrator.Form1.ReadThread1() in C:\dev\.net\valiweb\trunk\Tim.Migrator\Form1.cs:line 121, provider: server=localhost;Port=3306;database=skellec_vw2017;user id=skellec_user; password=valibali16; Convert Zero Datetime=True;
dataTable.TableName which gets sent in is called "COLUMNS"
Line 394 in MySqlConnector/Core/SchemaProvider.cs:
// remove columns that the server doesn't support if (dataTable.TableName == "Columns")
{
using (var command = new MySqlCommand("SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'information_schema' AND table_name = 'COLUMNS' AND column_name = 'GENERATION_EXPRESSION';", m_connection))
{
if (await command.ExecuteScalarAsync(ioBehavior, cancellationToken).ConfigureAwait(false) is null)
dataTable.Columns.Remove("GENERATION_EXPRESSION");
}
using (var command = new MySqlCommand("SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'information_schema' AND table_name = 'COLUMNS' AND column_name = 'SRS_ID';", m_connection))
{
if (await command.ExecuteScalarAsync(ioBehavior, cancellationToken).ConfigureAwait(false) is null)
dataTable.Columns.Remove("SRS_ID");
}
}
Suggested to be: if (dataTable.TableName.Equals("Columns", StringComparison.OrdinalIgnoreCase))
Software versions
MySqlConnector version:
The version currently on git (2022-12-16 01:00:00 GMT+1)
Server type (MySQL, MariaDB, Aurora, etc.) and version:
MariaDB 10.9 and also tried with 10.11
.NET version:
4.7.2
(Optional) ORM NuGet packages and versions:
Describe the bug
Getting a MySqlException on a column which I don't have in any of my tables: 'SRS_ID'
Exception
Expected behavior
To work the same as with a MySQL database but with a MariaDB
Additional context
So the exact same code works vs a MySQL database, but not vs a MariaDB with identical tables etc.
The text was updated successfully, but these errors were encountered: