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
I have MiniProfiledDbConnection over a MariaDB connection, and when I will process an INSERT command, the Dapper.Contrib throw an exception.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[Id], [CreatedAt], [AndSoOn]' at line1
Debugging I understand that MiniProfiler change MySqlAdapter to MsSqlAdapter and the insert into command was created with wrong '[, ]' in the field names.
The insert command on MySql is like:
insert into table (field1, field2) values( 1, 'xpto')
But with the change, it is created with MSSQL sintax:
insert into table ([field1], [field2]) values( 1, 'xpto')
I see you're using MiniProfiler 3, is this the same in v4? I would assume it is, as what's happening in Dapper (I'm also one of the maintainers on it as well) is it's looking at the connection type, and the default is SQL Server if we don't recognize it.
I'll take a look next week about how we want to handle this, but I'm just kind of shocked I haven't heard of this before...the problem absolutely makes sense. This would need to be a Dapper change though, not a MiniProfiler one. We're currently working on StackExchange.Redis this month and likely Dapper in the following months...but it's possible we can quick fix this on MyGet at least to unblock you :)
Thank you.
I don't need the solution so fast, my critial use today is in MSSQL and it's not afeted.
But I have made debug on Dapper code and I realize that its receive MSSQL DbApender if I'm using the MiniProfiler, if I remove that from connection, the Dapper.Contrib comes to work well.
If I have some time, and if I found the problem, I create a PullRequest :-)
@reinaldocoelho I'm going to close this out and think about it over on the Dapper side. For now, there is a workaround that allows you to override the connection type resolution in Dapper.Contrib:
I have MiniProfiledDbConnection over a MariaDB connection, and when I will process an INSERT command, the Dapper.Contrib throw an exception.
Debugging I understand that MiniProfiler change MySqlAdapter to MsSqlAdapter and the insert into command was created with wrong '[, ]' in the field names.
The insert command on MySql is like:
But with the change, it is created with MSSQL sintax:
Same problem:
https://stackoverflow.com/questions/50581540/dapper-contrib-and-miniprofiler-for-mysql-integration-issues?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
It´s easy to fix that?
The text was updated successfully, but these errors were encountered: