This is an automated email from the ASF dual-hosted git repository. ptupitsyn pushed a commit to branch ignite-22133-bak in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit b55e4cf6b636ba636d39d755c2f35c57ae6d5aea Author: Pavel Tupitsyn <[email protected]> AuthorDate: Fri Jun 27 15:10:08 2025 +0300 Fix ExecuteScalarAsync, fix ExistsSql --- .../Apache.Ignite.EntityFrameworkCore/DataCommon/IgniteCommand.cs | 5 +++-- .../Migrations/Internal/IgniteHistoryRepository.cs | 8 ++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore/DataCommon/IgniteCommand.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore/DataCommon/IgniteCommand.cs index 0ee5eb31d82..1c1da0c05ed 100644 --- a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore/DataCommon/IgniteCommand.cs +++ b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore/DataCommon/IgniteCommand.cs @@ -24,6 +24,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Diagnostics; using Sql; +using Table; public class IgniteCommand : DbCommand { @@ -87,7 +88,7 @@ public class IgniteCommand : DbCommand Console.WriteLine($"IgniteCommand.ExecuteScalarAsync [statement={statement}, parameters={string.Join(", ", args)}]"); // TODO: Propagate transaction somehow. - await using IResultSet<object> resultSet = await GetSql().ExecuteAsync<object>( + await using IResultSet<IIgniteTuple> resultSet = await GetSql().ExecuteAsync( transaction: null, statement, cancellationToken, @@ -96,7 +97,7 @@ public class IgniteCommand : DbCommand await foreach (var row in resultSet) { // Return the first result. - return row; + return row[0]; } throw new InvalidOperationException("Query returned no results: " + statement); diff --git a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore/Migrations/Internal/IgniteHistoryRepository.cs b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore/Migrations/Internal/IgniteHistoryRepository.cs index b56666e0570..9f621040b20 100644 --- a/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore/Migrations/Internal/IgniteHistoryRepository.cs +++ b/modules/platforms/dotnet/Apache.Ignite.EntityFrameworkCore/Migrations/Internal/IgniteHistoryRepository.cs @@ -32,13 +32,9 @@ public class IgniteHistoryRepository : HistoryRepository get { var stringTypeMapping = Dependencies.TypeMappingSource.GetMapping(typeof(string)); + var literal = stringTypeMapping.GenerateSqlLiteral(TableName); - return - $""" - SELECT COUNT(*) FROM "IGNITE_MASTER_TODO" - WHERE "name" = {stringTypeMapping.GenerateSqlLiteral(TableName)} - AND "type" = 'table'; - """; + return $"SELECT COUNT(*) FROM SYSTEM.TABLES WHERE TABLE_NAME = {literal};"; } }
