Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent result when using ExecuteDataTable #617

Open
jeffersonthadeu opened this issue Feb 3, 2025 · 2 comments
Open

Inconsistent result when using ExecuteDataTable #617

jeffersonthadeu opened this issue Feb 3, 2025 · 2 comments
Assignees

Comments

@jeffersonthadeu
Copy link

When executing the following query, tested directly in the Database, the result is 12 records.

Image

When I use the ExecuteDataTable method, the result is always 1 record.

When testing without ExecuteDataTable, the result is 12 records.

Image

The test was done with other records and the behavior is the same.

When removing the crg_nid column from the SELECT, the result is 12 records using ExecuteDataTable and also without it.

Image

The same behavior occurred with ExecuteDataSet.

@JonathanMagnan JonathanMagnan self-assigned this Feb 3, 2025
@JonathanMagnan
Copy link
Member

Hello @jeffersonthadeu ,

Thank you, we will try to reproduce this issue.

Best Regards,

Jon

@JonathanMagnan
Copy link
Member

Hello @jeffersonthadeu ,

Indeed, I confirm that we can reproduce the issue, but we currently choose to not fix it.

We currently use an interceptor to load the datatable:

var interceptionContext = new DbCommandInterceptionContext(@this.GetDbContext().GetObjectContext().GetInterceptionContext());

using (DbDataReader reader = DbInterception.Dispatch.Command.Reader(command, interceptionContext))
{
	dt.Load(reader);
}

The code is global to all providers and not only MySQL, so we are currently very limited in what we can do as:

  • It works perfectly for other providers such as SQL Server
  • We know some people use the interceptor with MySQL (so we cannot simply remove it for only the MySQL provider)

Unforutnately, in this case, I would recommend you create your own extension methods that don't use the interceptor and not using this feature for our library.

Best Regards,

Jon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants