diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d9685f32..7de7a822a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ env: jobs: ci: - runs-on: windows-2022 + runs-on: windows-2025 strategy: fail-fast: false matrix: @@ -17,12 +17,12 @@ jobs: timeout-minutes: 120 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - - name: .NET 7.0 - uses: actions/setup-dotnet@v3 + - name: .NET 10.0 + uses: actions/setup-dotnet@v5 with: - dotnet-version: 7.0.x + dotnet-version: 10.0.x - name: Build run: | @@ -51,6 +51,7 @@ jobs: shell: powershell - name: Publish Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: + name: 'ci_${{ matrix.TEST_SUITE }}_${{ matrix.FIREBIRD_SELECTION }}_${{ env.CONFIGURATION }}' path: '.\\out\\' diff --git a/README.md b/README.md index 8949c0d75..7d5f084d1 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ * [Downloads](https://github.com/FirebirdSQL/NETProvider/releases) * [Issue tracker](https://github.com/FirebirdSQL/NETProvider/issues) * [Development mailing list](https://groups.google.com/forum/#!forum/firebird-net-provider) +* [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/FirebirdSQL/NETProvider) ## Builds diff --git a/build.ps1 b/build.ps1 index c5b84ce41..308363e27 100644 --- a/build.ps1 +++ b/build.ps1 @@ -8,7 +8,9 @@ $baseDir = Split-Path -Parent $PSCommandPath . "$baseDir\include.ps1" $outDir = "$baseDir\out" -$version = '' +$versionProvider = '' +$versionEFCore = '' +$versionEF6 = '' function Clean() { if (Test-Path $outDir) { @@ -18,30 +20,30 @@ function Clean() { } function Build() { - function b($target, $check=$True) { - dotnet msbuild /t:$target /p:Configuration=$Configuration /p:ContinuousIntegrationBuild=true "$baseDir\src\NETProvider.sln" /v:m /m - if ($check) { - Check-ExitCode - } + dotnet clean "$baseDir\src\NETProvider.slnx" -c $Configuration -v m + dotnet build "$baseDir\src\NETProvider.slnx" -c $Configuration -p:ContinuousIntegrationBuild=true -v m +} + +function Versions() { + function v($file) { + return (Get-Item $file).VersionInfo.ProductVersion -replace '(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+)?.*','$1.$2.$3$4' } - b 'Clean' - # this sometimes fails on CI - b 'Restore' $False - b 'Restore' - b 'Build' - $script:version = (Get-Item $baseDir\src\FirebirdSql.Data.FirebirdClient\bin\$Configuration\$(Get-UsedTargetFramework)\FirebirdSql.Data.FirebirdClient.dll).VersionInfo.ProductVersion -replace '(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+)?(.*)','$1.$2.$3$4' + $script:versionProvider = v $baseDir\src\FirebirdSql.Data.FirebirdClient\bin\$Configuration\net10.0\FirebirdSql.Data.FirebirdClient.dll + $script:versionEFCore = v $baseDir\src\FirebirdSql.EntityFrameworkCore.Firebird\bin\$Configuration\net10.0\FirebirdSql.EntityFrameworkCore.Firebird.dll + $script:versionEF6 = v $baseDir\src\EntityFramework.Firebird\bin\$Configuration\net48\EntityFramework.Firebird.dll } function NuGets() { - cp $baseDir\src\FirebirdSql.Data.FirebirdClient\bin\$Configuration\FirebirdSql.Data.FirebirdClient.$version.nupkg $outDir - cp $baseDir\src\EntityFramework.Firebird\bin\$Configuration\EntityFramework.Firebird.$version.nupkg $outDir - cp $baseDir\src\FirebirdSql.EntityFrameworkCore.Firebird\bin\$Configuration\FirebirdSql.EntityFrameworkCore.Firebird.$version.nupkg $outDir + cp $baseDir\src\FirebirdSql.Data.FirebirdClient\bin\$Configuration\FirebirdSql.Data.FirebirdClient.$versionProvider.nupkg $outDir + cp $baseDir\src\FirebirdSql.EntityFrameworkCore.Firebird\bin\$Configuration\FirebirdSql.EntityFrameworkCore.Firebird.$versionEFCore.nupkg $outDir + cp $baseDir\src\EntityFramework.Firebird\bin\$Configuration\EntityFramework.Firebird.$versionEF6.nupkg $outDir - cp $baseDir\src\FirebirdSql.Data.FirebirdClient\bin\$Configuration\FirebirdSql.Data.FirebirdClient.$version.snupkg $outDir - cp $baseDir\src\EntityFramework.Firebird\bin\$Configuration\EntityFramework.Firebird.$version.snupkg $outDir - cp $baseDir\src\FirebirdSql.EntityFrameworkCore.Firebird\bin\$Configuration\FirebirdSql.EntityFrameworkCore.Firebird.$version.snupkg $outDir + cp $baseDir\src\FirebirdSql.Data.FirebirdClient\bin\$Configuration\FirebirdSql.Data.FirebirdClient.$versionProvider.snupkg $outDir + cp $baseDir\src\FirebirdSql.EntityFrameworkCore.Firebird\bin\$Configuration\FirebirdSql.EntityFrameworkCore.Firebird.$versionEFCore.snupkg $outDir + cp $baseDir\src\EntityFramework.Firebird\bin\$Configuration\EntityFramework.Firebird.$versionEF6.snupkg $outDir } Clean Build +Versions NuGets diff --git a/docs/entity-framework-core.md b/docs/entity-framework-core.md index e14899156..e5b2a5c30 100644 --- a/docs/entity-framework-core.md +++ b/docs/entity-framework-core.md @@ -1,4 +1,4 @@ -# Entity Framework Core 7.x +# Entity Framework Core 8.x * Install `FirebirdSql.EntityFrameworkCore.Firebird` from NuGet. * Create your `DbContext`. diff --git a/include.ps1 b/include.ps1 index 3031b02bc..a713a7a9f 100644 --- a/include.ps1 +++ b/include.ps1 @@ -4,8 +4,4 @@ function Check-ExitCode() { echo "Non-zero ($exitCode) exit code. Exiting..." exit $exitCode } -} - -function Get-UsedTargetFramework() { - return 'net7.0' } \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 610fbe8f0..27f7e6a29 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,11 +1,10 @@ + latest portable - 10.0.0 - FirebirdSQL NETProvider FirebirdSQL @@ -20,6 +19,9 @@ snupkg license.txt + + 2026 + @@ -27,7 +29,7 @@ true - + all runtime; build; native; contentfiles; analyzers diff --git a/src/EntityFramework.Firebird.Tests/EntityFramework.Firebird.Tests.csproj b/src/EntityFramework.Firebird.Tests/EntityFramework.Firebird.Tests.csproj index 1e04b33f4..01672b56e 100644 --- a/src/EntityFramework.Firebird.Tests/EntityFramework.Firebird.Tests.csproj +++ b/src/EntityFramework.Firebird.Tests/EntityFramework.Firebird.Tests.csproj @@ -1,7 +1,6 @@  - - net7.0 + net10.0 false false true @@ -12,17 +11,22 @@ Exe FirebirdSql.Data.TestsBase.Program - + + + + + + + - - - - + + + + - diff --git a/src/EntityFramework.Firebird.Tests/EntityFrameworkTestsBase.cs b/src/EntityFramework.Firebird.Tests/EntityFrameworkTestsBase.cs index cc8936ad0..d54eaafa5 100644 --- a/src/EntityFramework.Firebird.Tests/EntityFrameworkTestsBase.cs +++ b/src/EntityFramework.Firebird.Tests/EntityFrameworkTestsBase.cs @@ -28,6 +28,7 @@ public abstract class EntityFrameworkTestsBase : FbTestsBase static EntityFrameworkTestsBase() { #if !NETFRAMEWORK + // example/documentation for .NET Framework System.Data.Common.DbProviderFactories.RegisterFactory(FbProviderServices.ProviderInvariantName, FirebirdClientFactory.Instance); #endif DbConfiguration.SetConfiguration(new FbTestDbContext.Conf()); diff --git a/src/EntityFramework.Firebird/EntityFramework.Firebird.csproj b/src/EntityFramework.Firebird/EntityFramework.Firebird.csproj index a2bb42363..12ec50978 100644 --- a/src/EntityFramework.Firebird/EntityFramework.Firebird.csproj +++ b/src/EntityFramework.Firebird/EntityFramework.Firebird.csproj @@ -9,14 +9,15 @@ true + $(EF6ProviderVersion) NETProvider - Entity Framework Provider - (c) 2014-2023 + (c) 2014-$(CopyrightEndYear) EntityFramework.Firebird Firebird Entity Framework Provider The Entity Framework provider for Firebird enables you to develop .NET applications that connect to the Firebird database using Entity Framework. - firebird;firebirsql;firebirdclient;entityframewor;adonet;database + firebird firebirsql firebirdclient entityframewor adonet database EF6;TRACE @@ -45,7 +46,8 @@ - + + @@ -53,7 +55,4 @@ - - - diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/BlobStreamTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/BlobStreamTests.cs new file mode 100644 index 000000000..6631ff77a --- /dev/null +++ b/src/FirebirdSql.Data.FirebirdClient.Tests/BlobStreamTests.cs @@ -0,0 +1,86 @@ +using System.IO; +using System.Security.Cryptography; +using System.Threading.Tasks; +using FirebirdSql.Data.TestsBase; +using NUnit.Framework; + +namespace FirebirdSql.Data.FirebirdClient.Tests; + +[TestFixtureSource(typeof(FbServerTypeTestFixtureSource), nameof(FbServerTypeTestFixtureSource.Default))] +[TestFixtureSource(typeof(FbServerTypeTestFixtureSource), nameof(FbServerTypeTestFixtureSource.Embedded))] +public class BlobStreamTests : FbTestsBase +{ + public BlobStreamTests(FbServerType serverType, bool compression, FbWireCrypt wireCrypt) + : base(serverType, compression, wireCrypt) + { } + + [Test] + public async Task FbBlobStreamReadTest() + { + var id_value = RandomNumberGenerator.GetInt32(int.MinValue, int.MaxValue); + var insert_values = RandomNumberGenerator.GetBytes(100000 * 4); + + await using (var transaction = await Connection.BeginTransactionAsync()) + { + await using (var insert = new FbCommand("INSERT INTO TEST (int_field, blob_field) values(@int_field, @blob_field)", Connection, transaction)) + { + insert.Parameters.Add("@int_field", FbDbType.Integer).Value = id_value; + insert.Parameters.Add("@blob_field", FbDbType.Binary).Value = insert_values; + await insert.ExecuteNonQueryAsync(); + } + await transaction.CommitAsync(); + } + + await using (var select = new FbCommand($"SELECT blob_field FROM TEST WHERE int_field = {id_value}", Connection)) + { + await using var reader = await select.ExecuteReaderAsync(); + while (await reader.ReadAsync()) + { + await using var output = new MemoryStream(); + await using (var stream = reader.GetStream(0)) + { + await stream.CopyToAsync(output); + } + + var select_values = output.ToArray(); + CollectionAssert.AreEqual(insert_values, select_values); + } + } + } + + [Test] + public async Task FbBlobStreamWriteTest() + { + var id_value = RandomNumberGenerator.GetInt32(int.MinValue, int.MaxValue); + var insert_values = RandomNumberGenerator.GetBytes(100000 * 4); + + await using (var transaction = await Connection.BeginTransactionAsync()) + { + await using (var insert = new FbCommand("INSERT INTO TEST (int_field, blob_field) values(@int_field, @blob_field)", Connection, transaction)) + { + insert.Parameters.Add("@int_field", FbDbType.Integer).Value = id_value; + insert.Parameters.Add("@blob_field", FbDbType.Binary).Value = insert_values; + await insert.ExecuteNonQueryAsync(); + } + + await using (var select = new FbCommand($"SELECT blob_field FROM TEST WHERE int_field = {id_value}", Connection, transaction)) + { + await using var reader = await select.ExecuteReaderAsync(); + while (await reader.ReadAsync()) + { + await using var stream = reader.GetStream(0); + await stream.WriteAsync(insert_values); + + break; + } + } + await transaction.CommitAsync(); + } + + await using (var select = new FbCommand($"SELECT blob_field FROM TEST WHERE int_field = {id_value}", Connection)) + { + var select_values = (byte[])await select.ExecuteScalarAsync(); + CollectionAssert.AreEqual(insert_values, select_values); + } + } +} \ No newline at end of file diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbBlobTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbBlobTests.cs index 61537d06b..d81d3a3ed 100644 --- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbBlobTests.cs +++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbBlobTests.cs @@ -44,6 +44,7 @@ public async Task BinaryBlobTest() insert.Parameters.Add("@blob_field", FbDbType.Binary).Value = insert_values; await insert.ExecuteNonQueryAsync(); } + await transaction.CommitAsync(); } diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbCommandTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbCommandTests.cs index c5bf8f0ad..44ba7c151 100644 --- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbCommandTests.cs +++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbCommandTests.cs @@ -187,6 +187,22 @@ public async Task NamedParametersReuseTest() } } + [Test] + public async Task NamedParametersPublicAccessor() + { + await using (var command = new FbCommand("select * from test where int_field >= @x1 and int_field <= @x2", Connection)) + { + Assert.IsNotNull(command.NamedParameters, "Unexpected null reference."); + Assert.IsTrue(command.NamedParameters.Count == 0, "Expected count 0 of named parameters before command prepare."); + + await command.PrepareAsync(); + + Assert.IsTrue(command.NamedParameters.Count == 2, "Expected count 2 of named parameters after command prepare."); + Assert.AreEqual(command.NamedParameters[0], "@x1"); + Assert.AreEqual(command.NamedParameters[1], "@x2"); + } + } + [Test] public async Task ExecuteStoredProcTest() { @@ -631,7 +647,7 @@ public async Task GetCommandExplainedPlanNoPlanTest() } [Test] - public async Task ReadsTimeWithProperPrecision() + public async Task ReadsTimeWithProperPrecisionTest() { await using (var cmd = Connection.CreateCommand()) { @@ -642,7 +658,7 @@ public async Task ReadsTimeWithProperPrecision() } [Test] - public async Task PassesTimeSpanWithProperPrecision() + public async Task PassesTimeSpanWithProperPrecisionTest() { var ts = TimeSpan.FromTicks(14321000); await using (var cmd = Connection.CreateCommand()) @@ -655,7 +671,7 @@ public async Task PassesTimeSpanWithProperPrecision() } [Test] - public async Task ReadsDateTimeWithProperPrecision() + public async Task ReadsDateTimeWithProperPrecisionTest() { await using (var cmd = Connection.CreateCommand()) { @@ -666,7 +682,7 @@ public async Task ReadsDateTimeWithProperPrecision() } [Test] - public async Task PassesDateTimeWithProperPrecision() + public async Task PassesDateTimeWithProperPrecisionTest() { var dt = new DateTime(635583639614321000); await using (var cmd = Connection.CreateCommand()) @@ -679,7 +695,41 @@ public async Task PassesDateTimeWithProperPrecision() } [Test] - public async Task ExecuteNonQueryReturnsMinusOneOnNonInsertUpdateDelete() + public async Task HighLowSurrogatePassingTest() + { + await using (var cmd = Connection.CreateCommand()) + { + const string Value = "😊!"; + cmd.CommandText = "select cast(@value1 as varchar(2) character set utf8), cast(@value2 as char(2) character set utf8) from rdb$database"; + cmd.Parameters.Add("value1", Value); + cmd.Parameters.Add("value2", Value); + await using (var reader = await cmd.ExecuteReaderAsync()) + { + await reader.ReadAsync(); + Assert.AreEqual(Value, reader[0]); + Assert.AreEqual(Value, reader[1]); + } + } + } + + [Test] + public async Task HighLowSurrogateReadingTest() + { + await using (var cmd = Connection.CreateCommand()) + { + const string Value = "😊!"; + cmd.CommandText = "select cast(x'F09F988A21' as varchar(2) character set utf8), cast(x'F09F988A21' as char(2) character set utf8) from rdb$database"; + await using (var reader = await cmd.ExecuteReaderAsync()) + { + await reader.ReadAsync(); + Assert.AreEqual(Value, reader[0]); + Assert.AreEqual(Value, reader[1]); + } + } + } + + [Test] + public async Task ExecuteNonQueryReturnsMinusOneOnNonInsertUpdateDeleteTest() { await using (var cmd = Connection.CreateCommand()) { diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbDataReaderTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbDataReaderTests.cs index 1aa2e50e6..c87c804bc 100644 --- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbDataReaderTests.cs +++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbDataReaderTests.cs @@ -313,7 +313,7 @@ public async Task ReadBinaryTest() { bytes[i] = (byte)random.Next(byte.MinValue, byte.MaxValue); } - var binaryString = $"x'{BitConverter.ToString(bytes).Replace("-", string.Empty)}'"; + var binaryString = $"x'{Convert.ToHexString(bytes)}'"; await using (var command = new FbCommand($"select {binaryString} from TEST", Connection, transaction)) { diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbServicesTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbServicesTests.cs index 96f388234..d667f2c48 100644 --- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbServicesTests.cs +++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbServicesTests.cs @@ -60,6 +60,49 @@ public async Task BackupRestoreTest() await Connection.CloseAsync(); } + [Test] + public async Task BackupRestoreZipTest() + { + if (!EnsureServerVersionAtLeast(new Version(4, 0, 0, 0))) + return; + + var backupName = $"{Guid.NewGuid()}.bak"; + var csb = BuildServicesConnectionStringBuilder(ServerType, Compression, WireCrypt, true); + var connectionString = csb.ToString(); + await BackupPartHelper(backupName, connectionString, x => + { + x.Options |= FbBackupFlags.Zip; + }); + await RestorePartHelper(backupName, connectionString); + // test the database was actually restored fine + await Connection.OpenAsync(); + await Connection.CloseAsync(); + } + + [Test] + public async Task BackupRestoreVerbIntTest() + { + if (!EnsureServerVersionAtLeast(new Version(3, 0, 0, 0))) + return; + + var backupName = $"{Guid.NewGuid()}.bak"; + var csb = BuildServicesConnectionStringBuilder(ServerType, Compression, WireCrypt, true); + var connectionString = csb.ToString(); + await BackupPartHelper(backupName, connectionString, x => + { + x.Verbose = false; + x.VerboseInterval = 1_000_000; + }); + await RestorePartHelper(backupName, connectionString, x => + { + x.Verbose = false; + x.VerboseInterval = 1_000_000; + }); + // test the database was actually restored fine + await Connection.OpenAsync(); + await Connection.CloseAsync(); + } + [Test] public async Task BackupRestoreParallelTest() { @@ -453,7 +496,7 @@ public async Task NFixupTest() Assert.DoesNotThrowAsync(() => Connection.OpenAsync()); } - static Task BackupPartHelper(string backupName, string connectionString) + static Task BackupPartHelper(string backupName, string connectionString, Action configure = null) { var backupSvc = new FbBackup(); backupSvc.ConnectionString = connectionString; @@ -462,9 +505,10 @@ static Task BackupPartHelper(string backupName, string connectionString) backupSvc.Verbose = true; backupSvc.Statistics = FbBackupRestoreStatistics.TotalTime | FbBackupRestoreStatistics.TimeDelta; backupSvc.ServiceOutput += ServiceOutput; + configure?.Invoke(backupSvc); return backupSvc.ExecuteAsync(); } - static Task RestorePartHelper(string backupName, string connectionString) + static Task RestorePartHelper(string backupName, string connectionString, Action configure = null) { var restoreSvc = new FbRestore(); restoreSvc.ConnectionString = connectionString; @@ -474,6 +518,7 @@ static Task RestorePartHelper(string backupName, string connectionString) restoreSvc.Statistics = FbBackupRestoreStatistics.TotalTime | FbBackupRestoreStatistics.TimeDelta; restoreSvc.BackupFiles.Add(new FbBackupFile(backupName, 2048)); restoreSvc.ServiceOutput += ServiceOutput; + configure?.Invoke(restoreSvc); return restoreSvc.ExecuteAsync(); } diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedDateTimeTypeTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedDateTimeTypeTests.cs index ca94f33e2..b69dc7044 100644 --- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedDateTimeTypeTests.cs +++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedDateTimeTypeTests.cs @@ -47,6 +47,14 @@ public void EqualityFalse(FbZonedDateTime expected, FbZonedDateTime actual) Assert.AreNotEqual(expected, actual); } + [Test] + public void ConvertToDateTimeShouldNotThrow() + { + var fbZonedDateTime = new FbZonedDateTime(new DateTime(2020, 12, 4, 10, 38, 0, DateTimeKind.Utc), "UTC"); + + Assert.DoesNotThrow(() => Convert.ChangeType(fbZonedDateTime, typeof(DateTime))); + } + public void DateTimeShouldBeUtc() { Assert.Throws(() => diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedTimeTypeTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedTimeTypeTests.cs index c0309b389..959c2a579 100644 --- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedTimeTypeTests.cs +++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedTimeTypeTests.cs @@ -46,4 +46,12 @@ public void EqualityFalse(FbZonedTime expected, FbZonedTime actual) { Assert.AreNotEqual(expected, actual); } + + [Test] + public void ConvertToTimeSpanShouldNotThrow() + { + var fbZonedTime = new FbZonedTime(TimeSpan.FromMinutes(142), "UTC"); + + Assert.DoesNotThrow(() => Convert.ChangeType(fbZonedTime, typeof(TimeSpan))); + } } diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FirebirdSql.Data.FirebirdClient.Tests.csproj b/src/FirebirdSql.Data.FirebirdClient.Tests/FirebirdSql.Data.FirebirdClient.Tests.csproj index 9ca84ea94..ff0b4ae13 100644 --- a/src/FirebirdSql.Data.FirebirdClient.Tests/FirebirdSql.Data.FirebirdClient.Tests.csproj +++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FirebirdSql.Data.FirebirdClient.Tests.csproj @@ -1,6 +1,6 @@  - net7.0 + net10.0 false false true @@ -12,10 +12,15 @@ FirebirdSql.Data.TestsBase.Program - - - - + + + + + + + + + diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/ClientFactory.cs b/src/FirebirdSql.Data.FirebirdClient/Client/ClientFactory.cs index a3869d1b3..c6ff43285 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/ClientFactory.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/ClientFactory.cs @@ -128,7 +128,7 @@ private static ValueTask CreateNativeDatabaseAsync(ConnectionStrin { var charset = GetCharset(options); - return ValueTask2.FromResult(new Native.FesDatabase(options.ClientLibrary, charset, options.PacketSize, options.Dialect)); + return ValueTask.FromResult(new Native.FesDatabase(options.ClientLibrary, charset, options.PacketSize, options.Dialect)); } private static ServiceManagerBase CreateManagedServiceManager(ConnectionString options) @@ -194,7 +194,7 @@ private static ValueTask CreateNativeServiceManagerAsync(Con { var charset = GetCharset(options); - return ValueTask2.FromResult(new Native.FesServiceManager(options.ClientLibrary, charset)); + return ValueTask.FromResult(new Native.FesServiceManager(options.ClientLibrary, charset)); } private static Exception UnsupportedProtocolException() => new NotSupportedException("Protocol not supported."); diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/FirebirdNetworkHandlingWrapper.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/FirebirdNetworkHandlingWrapper.cs index 28d85b36f..17f068a30 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/FirebirdNetworkHandlingWrapper.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/FirebirdNetworkHandlingWrapper.cs @@ -122,14 +122,14 @@ public async ValueTask ReadAsync(byte[] buffer, int offset, int count, Canc public void Write(byte[] buffer, int offset, int count) { - for (var i = offset; i < count; i++) + for (var i = 0; i < count; i++) _outputBuffer.Enqueue(buffer[offset + i]); } public ValueTask WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken = default) { - for (var i = offset; i < count; i++) + for (var i = 0; i < count; i++) _outputBuffer.Enqueue(buffer[offset + i]); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public void Flush() diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/GdsConnection.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/GdsConnection.cs index 249f31fb7..cc39ba6b2 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/GdsConnection.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/GdsConnection.cs @@ -114,12 +114,7 @@ public async ValueTask ConnectAsync(CancellationToken cancellationToken = defaul { using (var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(timeoutCts.Token, cancellationToken)) { -#if NET48 || NETSTANDARD2_0 || NETSTANDARD2_1 - static Func ConnectAsyncHelper(Socket socket) => (e, ct) => Task.Factory.FromAsync(socket.BeginConnect, socket.EndConnect, e, null); -#else - static Func ConnectAsyncHelper(Socket socket) => (e, ct) => SocketTaskExtensions.ConnectAsync(socket, e, ct).AsTask(); -#endif - await ConnectAsyncHelper(socket)(endPoint, combinedCts.Token).ConfigureAwait(false); + await socket.ConnectAsync(endPoint, combinedCts.Token).ConfigureAwait(false); } } @@ -366,11 +361,7 @@ public void Disconnect() { if (_networkStream != null) { -#if NET48 || NETSTANDARD2_0 _networkStream.Dispose(); -#else - _networkStream.Dispose(); -#endif _networkStream = null; } } @@ -378,12 +369,7 @@ public async ValueTask DisconnectAsync(CancellationToken cancellationToken = def { if (_networkStream != null) { -#if NET48 || NETSTANDARD2_0 - _networkStream.Dispose(); - await ValueTask2.CompletedTask.ConfigureAwait(false); -#else await _networkStream.DisposeAsync().ConfigureAwait(false); -#endif _networkStream = null; } } diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Srp/SrpClientBase.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Srp/SrpClientBase.cs index 21c331687..b84ab5a17 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Srp/SrpClientBase.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Srp/SrpClientBase.cs @@ -146,12 +146,12 @@ private static BigInteger GetUserHash(string user, string password, byte[] salt) private static BigInteger BigIntegerFromByteArray(byte[] b) { - return new BigInteger(b.Reverse().Concat(new byte[] { 0 }).ToArray()); + return new BigInteger(b.AsEnumerable().Reverse().Concat(new byte[] { 0 }).ToArray()); } private static byte[] BigIntegerToByteArray(BigInteger n) { - return n.ToByteArray().Reverse().SkipWhile((e, i) => i == 0 && e == 0).ToArray(); + return n.ToByteArray().AsEnumerable().Reverse().SkipWhile((e, i) => i == 0 && e == 0).ToArray(); } private static byte[] ComputeSHA1Hash(params byte[][] ba) diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsBlob.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsBlob.cs index 0b5fc37eb..7d6785144 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsBlob.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsBlob.cs @@ -69,7 +69,7 @@ public GdsBlob(GdsDatabase database, GdsTransaction transaction, long blobId) #region Protected Methods - protected override void Create() + public override void Create() { try { @@ -81,7 +81,7 @@ protected override void Create() throw; } } - protected override async ValueTask CreateAsync(CancellationToken cancellationToken = default) + public override async ValueTask CreateAsync(CancellationToken cancellationToken = default) { try { @@ -94,7 +94,7 @@ protected override async ValueTask CreateAsync(CancellationToken cancellationTok } } - protected override void Open() + public override void Open() { try { @@ -105,7 +105,7 @@ protected override void Open() throw; } } - protected override async ValueTask OpenAsync(CancellationToken cancellationToken = default) + public override async ValueTask OpenAsync(CancellationToken cancellationToken = default) { try { @@ -117,7 +117,87 @@ protected override async ValueTask OpenAsync(CancellationToken cancellationToken } } - protected override void GetSegment(Stream stream) + public override int GetLength() + { + try + { + if (!IsOpen) + Open(); + + var bufferLength = 20; + var buffer = new byte[bufferLength]; + + _database.Xdr.Write(IscCodes.op_info_blob); + _database.Xdr.Write(_blobHandle); + _database.Xdr.Write(0); + _database.Xdr.WriteBuffer(new byte[] { IscCodes.isc_info_blob_total_length }, 1); + _database.Xdr.Write(bufferLength); + + _database.Xdr.Flush(); + + var response = (GenericResponse)_database.ReadResponse(); + + var responseLength = bufferLength; + + if (response.Data.Length < bufferLength) + { + responseLength = response.Data.Length; + } + + Buffer.BlockCopy(response.Data, 0, buffer, 0, responseLength); + + var length = IscHelper.VaxInteger(buffer, 1, 2); + var size = IscHelper.VaxInteger(buffer, 3, (int)length); + + return (int)size; + } + catch (IOException ex) + { + throw IscException.ForIOException(ex); + } + } + + public override async ValueTask GetLengthAsync(CancellationToken cancellationToken = default) + { + try + { + if (!IsOpen) + await OpenAsync(cancellationToken).ConfigureAwait(false); + + var bufferLength = 20; + var buffer = new byte[bufferLength]; + + await _database.Xdr.WriteAsync(IscCodes.op_info_blob, cancellationToken).ConfigureAwait(false); + await _database.Xdr.WriteAsync(_blobHandle, cancellationToken).ConfigureAwait(false); + await _database.Xdr.WriteAsync(0, cancellationToken).ConfigureAwait(false); + await _database.Xdr.WriteBufferAsync(new byte[] { IscCodes.isc_info_blob_total_length }, 1, cancellationToken).ConfigureAwait(false); + await _database.Xdr.WriteAsync(bufferLength, cancellationToken).ConfigureAwait(false); + + await _database.Xdr.FlushAsync(cancellationToken).ConfigureAwait(false); + + var response = (GenericResponse)await _database.ReadResponseAsync(cancellationToken).ConfigureAwait(false); + + var responseLength = bufferLength; + + if (response.Data.Length < bufferLength) + { + responseLength = response.Data.Length; + } + + Buffer.BlockCopy(response.Data, 0, buffer, 0, responseLength); + + var length = IscHelper.VaxInteger(buffer, 1, 2); + var size = IscHelper.VaxInteger(buffer, 3, (int)length); + + return (int)size; + } + catch (IOException ex) + { + throw IscException.ForIOException(ex); + } + } + + public override void GetSegment(Stream stream) { var requested = SegmentSize; @@ -145,7 +225,7 @@ protected override void GetSegment(Stream stream) if (buffer.Length == 0) { - // previous segment was last, this has no data + // previous segment was last, this has no data return; } @@ -166,7 +246,7 @@ protected override void GetSegment(Stream stream) throw IscException.ForIOException(ex); } } - protected override async ValueTask GetSegmentAsync(Stream stream, CancellationToken cancellationToken = default) + public override async ValueTask GetSegmentAsync(Stream stream, CancellationToken cancellationToken = default) { var requested = SegmentSize; @@ -194,7 +274,7 @@ protected override async ValueTask GetSegmentAsync(Stream stream, CancellationTo if (buffer.Length == 0) { - // previous segment was last, this has no data + //previous segment was last, this has no data return; } @@ -216,7 +296,120 @@ protected override async ValueTask GetSegmentAsync(Stream stream, CancellationTo } } - protected override void PutSegment(byte[] buffer) + public override byte[] GetSegment() + { + var requested = SegmentSize; + + try + { + _database.Xdr.Write(IscCodes.op_get_segment); + _database.Xdr.Write(_blobHandle); + _database.Xdr.Write(requested < short.MaxValue - 12 ? requested : short.MaxValue - 12); + _database.Xdr.Write(DataSegment); + _database.Xdr.Flush(); + + var response = (GenericResponse)_database.ReadResponse(); + + RblRemoveValue(IscCodes.RBL_segment); + if (response.ObjectHandle == 1) + { + RblAddValue(IscCodes.RBL_segment); + } + else if (response.ObjectHandle == 2) + { + RblAddValue(IscCodes.RBL_eof_pending); + } + + var buffer = response.Data; + + if (buffer.Length == 0) + { + //previous segment was last, this has no data + return Array.Empty(); + } + + var posInInput = 0; + var posInOutput = 0; + + var tmp = new byte[requested * 2]; + while (posInInput < buffer.Length) + { + var len = (int)IscHelper.VaxInteger(buffer, posInInput, 2); + posInInput += 2; + + Array.Copy(buffer, posInInput, tmp, posInOutput, len); + posInOutput += len; + posInInput += len; + } + + var actualBuffer = new byte[posInOutput]; + Array.Copy(tmp, actualBuffer, posInOutput); + + return actualBuffer; + } + catch (IOException ex) + { + throw IscException.ForIOException(ex); + } + } + public override async ValueTask GetSegmentAsync(CancellationToken cancellationToken = default) + { + var requested = SegmentSize; + + try + { + await _database.Xdr.WriteAsync(IscCodes.op_get_segment, cancellationToken).ConfigureAwait(false); + await _database.Xdr.WriteAsync(_blobHandle, cancellationToken).ConfigureAwait(false); + await _database.Xdr.WriteAsync(requested < short.MaxValue - 12 ? requested : short.MaxValue - 12, cancellationToken).ConfigureAwait(false); + await _database.Xdr.WriteAsync(DataSegment, cancellationToken).ConfigureAwait(false); + await _database.Xdr.FlushAsync(cancellationToken).ConfigureAwait(false); + + var response = (GenericResponse)await _database.ReadResponseAsync(cancellationToken).ConfigureAwait(false); + + RblRemoveValue(IscCodes.RBL_segment); + if (response.ObjectHandle == 1) + { + RblAddValue(IscCodes.RBL_segment); + } + else if (response.ObjectHandle == 2) + { + RblAddValue(IscCodes.RBL_eof_pending); + } + + var buffer = response.Data; + + if (buffer.Length == 0) + { + // previous segment was last, this has no data + return Array.Empty(); + } + + var posInInput = 0; + var posInOutput = 0; + + var tmp = new byte[requested * 2]; + while (posInInput < buffer.Length) + { + var len = (int)IscHelper.VaxInteger(buffer, posInInput, 2); + posInInput += 2; + + Array.Copy(buffer, posInInput, tmp, posInOutput, len); + posInOutput += len; + posInInput += len; + } + + var actualBuffer = new byte[posInOutput]; + Array.Copy(tmp, actualBuffer, posInOutput); + + return actualBuffer; + } + catch (IOException ex) + { + throw IscException.ForIOException(ex); + } + } + + public override void PutSegment(byte[] buffer) { try { @@ -232,7 +425,7 @@ protected override void PutSegment(byte[] buffer) throw IscException.ForIOException(ex); } } - protected override async ValueTask PutSegmentAsync(byte[] buffer, CancellationToken cancellationToken = default) + public override async ValueTask PutSegmentAsync(byte[] buffer, CancellationToken cancellationToken = default) { try { @@ -249,14 +442,14 @@ protected override async ValueTask PutSegmentAsync(byte[] buffer, CancellationTo } } - protected override void Seek(int position) + public override void Seek(int offset, int seekMode) { try { _database.Xdr.Write(IscCodes.op_seek_blob); _database.Xdr.Write(_blobHandle); - _database.Xdr.Write(SeekMode); - _database.Xdr.Write(position); + _database.Xdr.Write(seekMode); + _database.Xdr.Write(offset); _database.Xdr.Flush(); var response = (GenericResponse)_database.ReadResponse(); @@ -268,14 +461,14 @@ protected override void Seek(int position) throw IscException.ForIOException(ex); } } - protected override async ValueTask SeekAsync(int position, CancellationToken cancellationToken = default) + public override async ValueTask SeekAsync(int offset, int seekMode, CancellationToken cancellationToken = default) { try { await _database.Xdr.WriteAsync(IscCodes.op_seek_blob, cancellationToken).ConfigureAwait(false); await _database.Xdr.WriteAsync(_blobHandle, cancellationToken).ConfigureAwait(false); - await _database.Xdr.WriteAsync(SeekMode, cancellationToken).ConfigureAwait(false); - await _database.Xdr.WriteAsync(position, cancellationToken).ConfigureAwait(false); + await _database.Xdr.WriteAsync(seekMode, cancellationToken).ConfigureAwait(false); + await _database.Xdr.WriteAsync(offset, cancellationToken).ConfigureAwait(false); await _database.Xdr.FlushAsync(cancellationToken).ConfigureAwait(false); var response = (GenericResponse)await _database.ReadResponseAsync(cancellationToken).ConfigureAwait(false); @@ -288,20 +481,20 @@ protected override async ValueTask SeekAsync(int position, CancellationToken can } } - protected override void Close() + public override void Close() { _database.ReleaseObject(IscCodes.op_close_blob, _blobHandle); } - protected override ValueTask CloseAsync(CancellationToken cancellationToken = default) + public override ValueTask CloseAsync(CancellationToken cancellationToken = default) { return _database.ReleaseObjectAsync(IscCodes.op_close_blob, _blobHandle, cancellationToken); } - protected override void Cancel() + public override void Cancel() { _database.ReleaseObject(IscCodes.op_cancel_blob, _blobHandle); } - protected override ValueTask CancelAsync(CancellationToken cancellationToken = default) + public override ValueTask CancelAsync(CancellationToken cancellationToken = default) { return _database.ReleaseObjectAsync(IscCodes.op_cancel_blob, _blobHandle, cancellationToken); } @@ -327,6 +520,7 @@ private void CreateOrOpen(int op, BlobParameterBuffer bpb) _blobId = response.BlobId; _blobHandle = response.ObjectHandle; + _isOpen = true; } catch (IOException ex) { @@ -350,6 +544,7 @@ private async ValueTask CreateOrOpenAsync(int op, BlobParameterBuffer bpb, Cance _blobId = response.BlobId; _blobHandle = response.ObjectHandle; + _isOpen = true; } catch (IOException ex) { diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsDatabase.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsDatabase.cs index 6e9e209ba..37f134aa1 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsDatabase.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsDatabase.cs @@ -159,7 +159,7 @@ protected virtual void ProcessAttachResponse(GenericResponse response) protected virtual ValueTask ProcessAttachResponseAsync(GenericResponse response, CancellationToken cancellationToken = default) { _handle = response.ObjectHandle; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } protected void AfterAttachActions() @@ -353,7 +353,7 @@ protected void ProcessCreateResponse(GenericResponse response) protected ValueTask ProcessCreateResponseAsync(GenericResponse response, CancellationToken cancellationToken = default) { _handle = response.ObjectHandle; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void CreateDatabaseWithTrustedAuth(DatabaseParameterBufferBase dpb, string database, byte[] cryptKey) @@ -784,7 +784,7 @@ protected virtual void ProcessReleaseObjectResponse(IResponse response) { } protected virtual ValueTask ProcessReleaseObjectResponseAsync(IResponse response, CancellationToken cancellationToken = default) { - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } #endregion diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsServiceManager.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsServiceManager.cs index d0f7bf057..20fb3b9cb 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsServiceManager.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsServiceManager.cs @@ -113,7 +113,7 @@ protected virtual void ProcessAttachResponse(GenericResponse response) protected virtual ValueTask ProcessAttachResponseAsync(GenericResponse response, CancellationToken cancellationToken = default) { Handle = response.ObjectHandle; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void Detach() diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsStatement.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsStatement.cs index f920c2706..54b5698cc 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsStatement.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsStatement.cs @@ -19,6 +19,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Threading; using System.Threading.Tasks; using FirebirdSql.Data.Common; @@ -190,7 +191,7 @@ public override ArrayBase CreateArray(ArrayDesc descriptor) public override ValueTask CreateArrayAsync(ArrayDesc descriptor, CancellationToken cancellationToken = default) { var array = new GdsArray(descriptor); - return ValueTask2.FromResult(array); + return ValueTask.FromResult(array); } public override ArrayBase CreateArray(string tableName, string fieldName) @@ -642,7 +643,7 @@ protected ValueTask ProcessInfoSqlResponseAsync(GenericResponse response { Debug.Assert(response.Data != null && response.Data.Length > 0); - return ValueTask2.FromResult(response.Data); + return ValueTask.FromResult(response.Data); } #endregion @@ -728,7 +729,7 @@ protected void ProcessFreeResponse(IResponse response) { } protected ValueTask ProcessFreeResponseAsync(IResponse response, CancellationToken cancellationToken = default) { - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } #endregion @@ -757,7 +758,7 @@ protected ValueTask ProcessAllocateResponseAsync(GenericResponse response, Cance _allRowsFetched = false; State = StatementState.Allocated; StatementType = DbStatementType.None; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } #endregion @@ -841,7 +842,7 @@ protected void ProcessExecuteResponse(GenericResponse response) { } protected ValueTask ProcessExecuteResponseAsync(GenericResponse response, CancellationToken cancellationToken = default) { - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } protected void ProcessStoredProcedureExecuteResponse(SqlResponse response) @@ -1246,7 +1247,7 @@ protected void WriteRawParameter(IXdrWriter xdr, DbField field) else { var svalue = field.DbValue.GetString(); - if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.Length > field.CharCount) + if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > field.CharCount) { throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation }); } @@ -1271,7 +1272,7 @@ protected void WriteRawParameter(IXdrWriter xdr, DbField field) else { var svalue = field.DbValue.GetString(); - if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.Length > field.CharCount) + if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > field.CharCount) { throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation }); } @@ -1394,7 +1395,7 @@ protected async ValueTask WriteRawParameterAsync(IXdrWriter xdr, DbField field, else { var svalue = await field.DbValue.GetStringAsync(cancellationToken).ConfigureAwait(false); - if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.Length > field.CharCount) + if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > field.CharCount) { throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation }); } @@ -1419,7 +1420,7 @@ protected async ValueTask WriteRawParameterAsync(IXdrWriter xdr, DbField field, else { var svalue = await field.DbValue.GetStringAsync(cancellationToken).ConfigureAwait(false); - if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.Length > field.CharCount) + if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > field.CharCount) { throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation }); } @@ -1532,10 +1533,11 @@ protected object ReadRawValue(IXdrReader xdr, DbField field) else { var s = xdr.ReadString(innerCharset, field.Length); + var runes = s.EnumerateRunesToChars().ToList(); if ((field.Length % field.Charset.BytesPerCharacter) == 0 && - s.Length > field.CharCount) + runes.Count > field.CharCount) { - return s.Substring(0, field.CharCount); + return new string([.. runes.Take(field.CharCount).SelectMany(x => x)]); } else { @@ -1629,10 +1631,11 @@ protected async ValueTask ReadRawValueAsync(IXdrReader xdr, DbField fiel else { var s = await xdr.ReadStringAsync(innerCharset, field.Length, cancellationToken).ConfigureAwait(false); + var runes = s.EnumerateRunesToChars().ToList(); if ((field.Length % field.Charset.BytesPerCharacter) == 0 && - s.Length > field.CharCount) + runes.Count > field.CharCount) { - return s.Substring(0, field.CharCount); + return new string([.. runes.Take(field.CharCount).SelectMany(x => x)]); } else { diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version11/GdsDatabase.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version11/GdsDatabase.cs index 1438c9cd8..7c9030be2 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version11/GdsDatabase.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version11/GdsDatabase.cs @@ -111,7 +111,7 @@ protected virtual void SendTrustedAuthToBuffer(DatabaseParameterBufferBase dpb, protected virtual ValueTask SendTrustedAuthToBufferAsync(DatabaseParameterBufferBase dpb, byte[] authData, CancellationToken cancellationToken = default) { dpb.Append(IscCodes.isc_dpb_trusted_auth, authData); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } protected IResponse ProcessTrustedAuthResponse(SspiHelper sspiHelper, IResponse response) diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version16/GdsBatch.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version16/GdsBatch.cs index e0f68b88f..def16aeee 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version16/GdsBatch.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version16/GdsBatch.cs @@ -172,7 +172,7 @@ protected void ProcessReleaseResponse(IResponse response) { } protected ValueTask ProcessReleaseResponseAsync(IResponse response, CancellationToken cancellationToken = default) { - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } protected ExecuteResultItem[] BuildResult(BatchCompletionStateResponse response) diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FbClientFactory.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FbClientFactory.cs index 98bc44bd8..9b5cc79a8 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FbClientFactory.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FbClientFactory.cs @@ -83,7 +83,7 @@ public static IFbClient Create(string dllName) { result = BuildFbClient(dllName); cache.Add(dllName, result); - ShutdownHelper.RegisterFbClientShutdown(() => NativeHelpers.CallIfExists(() => result.fb_shutdown(0, 0))); + ShutdownHelper.RegisterFbClientShutdown(() => NativeHelpers.CallIfExists(nameof(IFbClient.fb_shutdown), () => result.fb_shutdown(0, 0))); return result; } finally @@ -257,14 +257,6 @@ private static void EmitLdarg(ILGenerator il, int i) private static IFbClient CreateInstance(TypeBuilder tb) { var t = tb.CreateTypeInfo().AsType(); - -#if DEBUG -#if NET48 - var ab = (AssemblyBuilder)tb.Assembly; - ab.Save("DynamicAssembly.dll"); -#endif -#endif - return (IFbClient)Activator.CreateInstance(t); } @@ -288,13 +280,7 @@ private static TypeBuilder CreateTypeBuilder(string baseName) assemblyName.Name = baseName + "_Assembly"; // We create the dynamic assembly in our current AppDomain - var assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(assemblyName, -#if NET48 - AssemblyBuilderAccess.RunAndSave -#else - AssemblyBuilderAccess.Run -#endif - ); + var assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); // Generate the actual module (which is the DLL itself) var moduleBuilder = assemblyBuilder.DefineDynamicModule(baseName + "_Module"); diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesArray.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesArray.cs index 1a56bf713..9d8fdcd99 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesArray.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesArray.cs @@ -134,7 +134,7 @@ public override ValueTask GetSliceAsync(int sliceLength, CancellationTok _database.ProcessStatusVector(_statusVector); - return ValueTask2.FromResult(buffer); + return ValueTask.FromResult(buffer); } public override void PutSlice(Array sourceArray, int sliceLength) @@ -205,7 +205,7 @@ public override ValueTask PutSliceAsync(Array sourceArray, int sliceLength, Canc _database.ProcessStatusVector(_statusVector); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } #endregion @@ -520,7 +520,7 @@ protected override ValueTask DecodeSliceAsync(byte[] slice, CancellationT sliceData = tempData; } - return ValueTask2.FromResult(sliceData); + return ValueTask.FromResult(sliceData); } #endregion diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesBlob.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesBlob.cs index 6ca97a51f..99022672f 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesBlob.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesBlob.cs @@ -70,7 +70,7 @@ public FesBlob(FesDatabase database, FesTransaction transaction, long blobId) #region Protected Methods - protected override void Create() + public override void Create() { ClearStatusVector(); @@ -88,9 +88,11 @@ protected override void Create() _database.ProcessStatusVector(_statusVector); + _isOpen = true; + RblAddValue(IscCodes.RBL_create); } - protected override ValueTask CreateAsync(CancellationToken cancellationToken = default) + public override ValueTask CreateAsync(CancellationToken cancellationToken = default) { ClearStatusVector(); @@ -108,12 +110,14 @@ protected override ValueTask CreateAsync(CancellationToken cancellationToken = d _database.ProcessStatusVector(_statusVector); + _isOpen = true; + RblAddValue(IscCodes.RBL_create); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } - protected override void Open() + public override void Open() { ClearStatusVector(); @@ -130,8 +134,10 @@ protected override void Open() new byte[0]); _database.ProcessStatusVector(_statusVector); + + _isOpen = true; } - protected override ValueTask OpenAsync(CancellationToken cancellationToken = default) + public override ValueTask OpenAsync(CancellationToken cancellationToken = default) { ClearStatusVector(); @@ -149,10 +155,56 @@ protected override ValueTask OpenAsync(CancellationToken cancellationToken = def _database.ProcessStatusVector(_statusVector); - return ValueTask2.CompletedTask; + _isOpen = true; + + return ValueTask.CompletedTask; + } + + public override int GetLength() + { + ClearStatusVector(); + + var buffer = new byte[20]; + + _database.FbClient.isc_blob_info( + _statusVector, + ref _blobHandle, + 1, + new byte[] { IscCodes.isc_info_blob_total_length }, + (short)buffer.Length, + buffer); + + _database.ProcessStatusVector(_statusVector); + + var length = IscHelper.VaxInteger(buffer, 1, 2); + var size = IscHelper.VaxInteger(buffer, 3, (int)length); + + return (int)size; } - protected override void GetSegment(Stream stream) + public override ValueTask GetLengthAsync(CancellationToken cancellationToken = default) + { + ClearStatusVector(); + + var buffer = new byte[20]; + + _database.FbClient.isc_blob_info( + _statusVector, + ref _blobHandle, + 1, + new byte[] { IscCodes.isc_info_blob_total_length }, + (short)buffer.Length, + buffer); + + _database.ProcessStatusVector(_statusVector); + + var length = IscHelper.VaxInteger(buffer, 1, 2); + var size = IscHelper.VaxInteger(buffer, 3, (int)length); + + return ValueTask.FromResult((int)size); + } + + public override void GetSegment(Stream stream) { var requested = (short)SegmentSize; short segmentLength = 0; @@ -168,7 +220,6 @@ protected override void GetSegment(Stream stream) requested, tmp); - RblRemoveValue(IscCodes.RBL_segment); if (_statusVector[1] == new IntPtr(IscCodes.isc_segstr_eof)) @@ -190,7 +241,7 @@ protected override void GetSegment(Stream stream) stream.Write(tmp, 0, segmentLength); } - protected override ValueTask GetSegmentAsync(Stream stream, CancellationToken cancellationToken = default) + public override ValueTask GetSegmentAsync(Stream stream, CancellationToken cancellationToken = default) { var requested = (short)SegmentSize; short segmentLength = 0; @@ -212,7 +263,7 @@ protected override ValueTask GetSegmentAsync(Stream stream, CancellationToken ca if (_statusVector[1] == new IntPtr(IscCodes.isc_segstr_eof)) { RblAddValue(IscCodes.RBL_eof_pending); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } else { @@ -228,10 +279,101 @@ protected override ValueTask GetSegmentAsync(Stream stream, CancellationToken ca stream.Write(tmp, 0, segmentLength); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } - protected override void PutSegment(byte[] buffer) + public override byte[] GetSegment() + { + var requested = (short)(SegmentSize - 2); + short segmentLength = 0; + + ClearStatusVector(); + + var tmp = new byte[requested]; + + var status = _database.FbClient.isc_get_segment( + _statusVector, + ref _blobHandle, + ref segmentLength, + requested, + tmp); + + + RblRemoveValue(IscCodes.RBL_segment); + + if (_statusVector[1] == new IntPtr(IscCodes.isc_segstr_eof)) + { + RblAddValue(IscCodes.RBL_eof_pending); + return Array.Empty(); + } + + if (status == IntPtr.Zero || _statusVector[1] == new IntPtr(IscCodes.isc_segment)) + { + RblAddValue(IscCodes.RBL_segment); + } + else + { + _database.ProcessStatusVector(_statusVector); + } + + var actualSegment = tmp; + if (actualSegment.Length != segmentLength) + { + tmp = new byte[segmentLength]; + Array.Copy(actualSegment, tmp, segmentLength); + actualSegment = tmp; + } + + return actualSegment; + } + public override ValueTask GetSegmentAsync(CancellationToken cancellationToken = default) + { + var requested = (short)SegmentSize; + short segmentLength = 0; + + ClearStatusVector(); + + var tmp = new byte[requested]; + + var status = _database.FbClient.isc_get_segment( + _statusVector, + ref _blobHandle, + ref segmentLength, + requested, + tmp); + + + RblRemoveValue(IscCodes.RBL_segment); + + if (_statusVector[1] == new IntPtr(IscCodes.isc_segstr_eof)) + { + RblAddValue(IscCodes.RBL_eof_pending); + return ValueTask.FromResult(Array.Empty()); + } + else + { + if (status == IntPtr.Zero || _statusVector[1] == new IntPtr(IscCodes.isc_segment)) + { + RblAddValue(IscCodes.RBL_segment); + } + else + { + _database.ProcessStatusVector(_statusVector); + } + } + + var actualSegment = tmp; + if (actualSegment.Length != segmentLength) + { + tmp = new byte[segmentLength]; + Array.Copy(actualSegment, tmp, segmentLength); + actualSegment = tmp; + } + + return ValueTask.FromResult(actualSegment); + } + + public override void PutSegment(byte[] buffer) { ClearStatusVector(); @@ -243,7 +385,7 @@ protected override void PutSegment(byte[] buffer) _database.ProcessStatusVector(_statusVector); } - protected override ValueTask PutSegmentAsync(byte[] buffer, CancellationToken cancellationToken = default) + public override ValueTask PutSegmentAsync(byte[] buffer, CancellationToken cancellationToken = default) { ClearStatusVector(); @@ -255,19 +397,41 @@ protected override ValueTask PutSegmentAsync(byte[] buffer, CancellationToken ca _database.ProcessStatusVector(_statusVector); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } - protected override void Seek(int position) + public override void Seek(int position, int seekOperation) { - throw new NotSupportedException(); + ClearStatusVector(); + + var resultingPosition = 0; + _database.FbClient.isc_seek_blob( + _statusVector, + ref _blobHandle, + (short)seekOperation, + position, + ref resultingPosition); + + _database.ProcessStatusVector(_statusVector); } - protected override ValueTask SeekAsync(int position, CancellationToken cancellationToken = default) + public override ValueTask SeekAsync(int position, int seekOperation, CancellationToken cancellationToken = default) { - throw new NotSupportedException(); + ClearStatusVector(); + + var resultingPosition = 0; + _database.FbClient.isc_seek_blob( + _statusVector, + ref _blobHandle, + (short)seekOperation, + position, + ref resultingPosition); + + _database.ProcessStatusVector(_statusVector); + + return ValueTask.CompletedTask; } - protected override void Close() + public override void Close() { ClearStatusVector(); @@ -275,7 +439,7 @@ protected override void Close() _database.ProcessStatusVector(_statusVector); } - protected override ValueTask CloseAsync(CancellationToken cancellationToken = default) + public override ValueTask CloseAsync(CancellationToken cancellationToken = default) { ClearStatusVector(); @@ -283,10 +447,10 @@ protected override ValueTask CloseAsync(CancellationToken cancellationToken = de _database.ProcessStatusVector(_statusVector); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } - protected override void Cancel() + public override void Cancel() { ClearStatusVector(); @@ -294,7 +458,7 @@ protected override void Cancel() _database.ProcessStatusVector(_statusVector); } - protected override ValueTask CancelAsync(CancellationToken cancellationToken = default) + public override ValueTask CancelAsync(CancellationToken cancellationToken = default) { ClearStatusVector(); @@ -302,7 +466,7 @@ protected override ValueTask CancelAsync(CancellationToken cancellationToken = d _database.ProcessStatusVector(_statusVector); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } #endregion diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesDatabase.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesDatabase.cs index 81ed0ba8a..e9cfdef76 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesDatabase.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesDatabase.cs @@ -102,7 +102,7 @@ public override ValueTask CreateDatabaseAsync(DatabaseParameterBufferBase dpb, s ProcessStatusVector(Charset.DefaultCharset); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void CreateDatabaseWithTrustedAuth(DatabaseParameterBufferBase dpb, string database, byte[] cryptKey) @@ -134,7 +134,7 @@ public override ValueTask DropDatabaseAsync(CancellationToken cancellationToken _handle.Dispose(); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } #endregion @@ -268,7 +268,7 @@ public override ValueTask DetachAsync(CancellationToken cancellationToken = defa _statusVector = null; TransactionCount = 0; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } #endregion @@ -318,7 +318,7 @@ public override ValueTask CancelOperationAsync(short kind, CancellationToken can catch (IscException ex) when (ex.ErrorCode == IscCodes.isc_nothing_to_cancel) { } - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } #endregion @@ -381,7 +381,7 @@ public override ValueTask> GetDatabaseInfoAsync(byte[] items, int b DatabaseInfo(items, buffer, buffer.Length); - return ValueTask2.FromResult(IscHelper.ParseDatabaseInfo(buffer, Charset)); + return ValueTask.FromResult(IscHelper.ParseDatabaseInfo(buffer, Charset)); } #endregion diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesServiceManager.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesServiceManager.cs index 9fec98ec3..74d0af270 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesServiceManager.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesServiceManager.cs @@ -94,7 +94,7 @@ public override ValueTask AttachAsync(ServiceParameterBufferBase spb, string dat Handle = svcHandle; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void Detach() @@ -121,7 +121,7 @@ public override ValueTask DetachAsync(CancellationToken cancellationToken = defa Handle = svcHandle; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void Start(ServiceParameterBufferBase spb) @@ -156,7 +156,7 @@ public override ValueTask StartAsync(ServiceParameterBufferBase spb, Cancellatio ProcessStatusVector(); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void Query(ServiceParameterBufferBase spb, int requestLength, byte[] requestBuffer, int bufferLength, byte[] buffer) @@ -199,7 +199,7 @@ public override ValueTask QueryAsync(ServiceParameterBufferBase spb, int request ProcessStatusVector(); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override ServiceParameterBufferBase CreateServiceParameterBuffer() diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesStatement.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesStatement.cs index 8d29d76db..67a86c7cd 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesStatement.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesStatement.cs @@ -184,7 +184,7 @@ public override ArrayBase CreateArray(ArrayDesc descriptor) public override ValueTask CreateArrayAsync(ArrayDesc descriptor, CancellationToken cancellationToken = default) { var array = new FesArray(descriptor); - return ValueTask2.FromResult(array); + return ValueTask.FromResult(array); } public override ArrayBase CreateArray(string tableName, string fieldName) @@ -371,11 +371,13 @@ public override void Execute(int timeout, IDescriptorFiller descriptorFiller) descriptorFiller.Fill(_parameters, 0); ClearStatusVector(); - NativeHelpers.CallIfExists(() => - { - _database.FbClient.fb_dsql_set_timeout(_statusVector, ref _handle, (uint)timeout); - _database.ProcessStatusVector(_statusVector); - }); + NativeHelpers.CallIfExists( + nameof(IFbClient.fb_dsql_set_timeout), + () => + { + _database.FbClient.fb_dsql_set_timeout(_statusVector, ref _handle, (uint)timeout); + _database.ProcessStatusVector(_statusVector); + }); ClearStatusVector(); @@ -441,11 +443,13 @@ public override async ValueTask ExecuteAsync(int timeout, IDescriptorFiller desc await descriptorFiller.FillAsync(_parameters, 0, cancellationToken).ConfigureAwait(false); ClearStatusVector(); - NativeHelpers.CallIfExists(() => - { - _database.FbClient.fb_dsql_set_timeout(_statusVector, ref _handle, (uint)timeout); - _database.ProcessStatusVector(_statusVector); - }); + NativeHelpers.CallIfExists( + nameof(IFbClient.fb_dsql_set_timeout), + () => + { + _database.FbClient.fb_dsql_set_timeout(_statusVector, ref _handle, (uint)timeout); + _database.ProcessStatusVector(_statusVector); + }); ClearStatusVector(); @@ -683,7 +687,7 @@ protected override ValueTask FreeAsync(int option, CancellationToken cancellatio // an execute procedure statement. if (StatementType == DbStatementType.StoredProcedure && option == IscCodes.DSQL_close) { - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } ClearStatusVector(); @@ -704,7 +708,7 @@ protected override ValueTask FreeAsync(int option, CancellationToken cancellatio _database.ProcessStatusVector(_statusVector); - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } protected override void TransactionUpdated(object sender, EventArgs e) @@ -753,7 +757,7 @@ protected override ValueTask GetSqlInfoAsync(byte[] items, int bufferLen _database.ProcessStatusVector(_statusVector); - return ValueTask2.FromResult(buffer); + return ValueTask.FromResult(buffer); } #endregion diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesTransaction.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesTransaction.cs index 389f70741..9bfc54061 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesTransaction.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Native/FesTransaction.cs @@ -229,7 +229,7 @@ public override ValueTask BeginTransactionAsync(TransactionParameterBuffer tpb, } } - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void Commit() @@ -264,7 +264,7 @@ public override ValueTask CommitAsync(CancellationToken cancellationToken = defa State = TransactionState.NoTransaction; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void Rollback() @@ -299,7 +299,7 @@ public override ValueTask RollbackAsync(CancellationToken cancellationToken = de State = TransactionState.NoTransaction; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void CommitRetaining() @@ -326,7 +326,7 @@ public override ValueTask CommitRetainingAsync(CancellationToken cancellationTok State = TransactionState.Active; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void RollbackRetaining() @@ -353,21 +353,21 @@ public override ValueTask RollbackRetainingAsync(CancellationToken cancellationT State = TransactionState.Active; - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void Prepare() { } public override ValueTask PrepareAsync(CancellationToken cancellationToken = default) { - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override void Prepare(byte[] buffer) { } public override ValueTask PrepareAsync(byte[] buffer, CancellationToken cancellationToken = default) { - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } public override List GetTransactionInfo(byte[] items) @@ -393,7 +393,7 @@ public override ValueTask> GetTransactionInfoAsync(byte[] items, in TransactionInfo(items, buffer, buffer.Length); - return ValueTask2.FromResult(IscHelper.ParseTransactionInfo(buffer, _database.Charset)); + return ValueTask.FromResult(IscHelper.ParseTransactionInfo(buffer, _database.Charset)); } #endregion diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Native/IFbClient.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Native/IFbClient.cs index 15aa3148f..f49b09f0a 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Client/Native/IFbClient.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Client/Native/IFbClient.cs @@ -23,8 +23,8 @@ namespace FirebirdSql.Data.Client.Native; /// -/// This is the interface that the dynamically-generated class uses to call the native library. -/// Each connection can specify different client library to use even on the same OS. +/// This is the interface that the dynamically-generated class uses to call the native library. +/// Each connection can specify different client library to use even on the same OS. /// IFbClient and FbClientactory classes are implemented to support this feature. /// Public visibility added, because auto-generated assembly can't work with internal types /// @@ -68,6 +68,14 @@ IntPtr isc_open_blob2( short bpbLength, byte[] bpbAddress); + IntPtr isc_blob_info( + [In, Out] IntPtr[] statusVector, + ref BlobHandle blobHandle, + short itemListBufferLength, + byte[] itemListBuffer, + short resultBufferLength, + byte[] resultBuffer); + IntPtr isc_get_segment( [In, Out] IntPtr[] statusVector, [MarshalAs(UnmanagedType.I4)] ref BlobHandle blobHandle, @@ -81,6 +89,13 @@ IntPtr isc_put_segment( short segBufferLength, byte[] segBuffer); + IntPtr isc_seek_blob( + [In, Out] IntPtr[] statusVector, + [MarshalAs(UnmanagedType.I4)] ref BlobHandle blobHandle, + short mode, + int offset, + ref int resultingBlobPosition); + IntPtr isc_cancel_blob( [In, Out] IntPtr[] statusVector, [MarshalAs(UnmanagedType.I4)] ref BlobHandle blobHandle); @@ -260,4 +275,4 @@ IntPtr isc_transaction_info( byte[] resultBuffer); #pragma warning restore IDE1006 -} +} \ No newline at end of file diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/BlobBase.cs b/src/FirebirdSql.Data.FirebirdClient/Common/BlobBase.cs index 828b80c2d..7214d5e8c 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Common/BlobBase.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Common/BlobBase.cs @@ -29,14 +29,17 @@ internal abstract class BlobBase private int _segmentSize; protected long _blobId; + protected bool _isOpen; protected int _position; protected TransactionBase _transaction; public abstract int Handle { get; } public long Id => _blobId; public bool EOF => (_rblFlags & IscCodes.RBL_eof_pending) != 0; + public bool IsOpen => _isOpen; - protected int SegmentSize => _segmentSize; + public int SegmentSize => _segmentSize; + public int Position => _position; public abstract DatabaseBase Database { get; } @@ -203,26 +206,32 @@ public async ValueTask WriteAsync(byte[] buffer, int index, int count, Cancellat } } - protected abstract void Create(); - protected abstract ValueTask CreateAsync(CancellationToken cancellationToken = default); + public abstract void Create(); + public abstract ValueTask CreateAsync(CancellationToken cancellationToken = default); - protected abstract void Open(); - protected abstract ValueTask OpenAsync(CancellationToken cancellationToken = default); + public abstract void Open(); + public abstract ValueTask OpenAsync(CancellationToken cancellationToken = default); - protected abstract void GetSegment(Stream stream); - protected abstract ValueTask GetSegmentAsync(Stream stream, CancellationToken cancellationToken = default); + public abstract int GetLength(); + public abstract ValueTask GetLengthAsync(CancellationToken cancellationToken = default); - protected abstract void PutSegment(byte[] buffer); - protected abstract ValueTask PutSegmentAsync(byte[] buffer, CancellationToken cancellationToken = default); + public abstract byte[] GetSegment(); + public abstract ValueTask GetSegmentAsync(CancellationToken cancellationToken = default); - protected abstract void Seek(int position); - protected abstract ValueTask SeekAsync(int position, CancellationToken cancellationToken = default); + public abstract void GetSegment(Stream stream); + public abstract ValueTask GetSegmentAsync(Stream stream, CancellationToken cancellationToken = default); - protected abstract void Close(); - protected abstract ValueTask CloseAsync(CancellationToken cancellationToken = default); + public abstract void PutSegment(byte[] buffer); + public abstract ValueTask PutSegmentAsync(byte[] buffer, CancellationToken cancellationToken = default); - protected abstract void Cancel(); - protected abstract ValueTask CancelAsync(CancellationToken cancellationToken = default); + public abstract void Seek(int offset, int seekMode); + public abstract ValueTask SeekAsync(int offset, int seekMode, CancellationToken cancellationToken = default); + + public abstract void Close(); + public abstract ValueTask CloseAsync(CancellationToken cancellationToken = default); + + public abstract void Cancel(); + public abstract ValueTask CancelAsync(CancellationToken cancellationToken = default); protected void RblAddValue(int rblValue) { @@ -233,4 +242,4 @@ protected void RblRemoveValue(int rblValue) { _rblFlags &= ~rblValue; } -} +} \ No newline at end of file diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/BlobStream.cs b/src/FirebirdSql.Data.FirebirdClient/Common/BlobStream.cs new file mode 100644 index 000000000..60dd20fe9 --- /dev/null +++ b/src/FirebirdSql.Data.FirebirdClient/Common/BlobStream.cs @@ -0,0 +1,228 @@ +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace FirebirdSql.Data.Common; + +public sealed class BlobStream : Stream +{ + private readonly BlobBase _blobHandle; + private int _position; + + private byte[] _currentSegment; + private int _segmentPosition; + + private int Available => _currentSegment?.Length - _segmentPosition ?? 0; + + internal BlobStream(BlobBase blob) + { + _blobHandle = blob; + _position = 0; + } + + public override long Position + { + get => _position; + set => Seek(value, SeekOrigin.Begin); + } + + public override long Length + { + get + { + if (!_blobHandle.IsOpen) + _blobHandle.Open(); + + return _blobHandle.GetLength(); + } + } + + public override void Flush() + { + } + + public override int Read(byte[] buffer, int offset, int count) + { + ValidateBufferSize(buffer, offset, count); + + if (!_blobHandle.IsOpen) + _blobHandle.Open(); + + var copied = 0; + var remainingBufferSize = buffer.Length - offset; + do + { + if (remainingBufferSize == 0) + break; + + if (Available > 0) + { + var toCopy = Math.Min(Available, remainingBufferSize); + Array.Copy(_currentSegment, _segmentPosition, buffer, offset + copied, toCopy); + copied += toCopy; + _segmentPosition += toCopy; + remainingBufferSize -= toCopy; + _position += toCopy; + } + + if (_blobHandle.EOF) + break; + + if (Available == 0) + { + _currentSegment = _blobHandle.GetSegment(); + _segmentPosition = 0; + } + } while (copied < count); + + return copied; + } + public override async Task ReadAsync(byte[] buffer, int offset, int count, + CancellationToken cancellationToken) + { + ValidateBufferSize(buffer, offset, count); + + if (!_blobHandle.IsOpen) + await _blobHandle.OpenAsync(cancellationToken).ConfigureAwait(false); + + var copied = 0; + var remainingBufferSize = buffer.Length - offset; + do + { + if (remainingBufferSize == 0) + break; + + if (Available > 0) + { + var toCopy = Math.Min(Available, remainingBufferSize); + Array.Copy(_currentSegment, _segmentPosition, buffer, offset + copied, toCopy); + copied += toCopy; + _segmentPosition += toCopy; + remainingBufferSize -= toCopy; + _position += toCopy; + } + + if (_blobHandle.EOF) + break; + + if (Available == 0) + { + _currentSegment = await _blobHandle.GetSegmentAsync(cancellationToken).ConfigureAwait(false); + _segmentPosition = 0; + } + } while (copied < count); + + return copied; + } + + public override long Seek(long offset, SeekOrigin origin) + { + if (!_blobHandle.IsOpen) + _blobHandle.Open(); + + var seekMode = origin switch + { + SeekOrigin.Begin => IscCodes.isc_blb_seek_from_head, + SeekOrigin.Current => IscCodes.isc_blb_seek_relative, + SeekOrigin.End => IscCodes.isc_blb_seek_from_tail, + _ => throw new ArgumentOutOfRangeException(nameof(origin)) + }; + + _blobHandle.Seek((int)offset, seekMode); + return _position = _blobHandle.Position; + } + + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + + public override void Write(byte[] buffer, int offset, int count) + { + try + { + if (!_blobHandle.IsOpen) + _blobHandle.Create(); + + var chunk = count >= _blobHandle.SegmentSize ? _blobHandle.SegmentSize : count; + var tmpBuffer = new byte[chunk]; + + while (count > 0) + { + if (chunk > count) + { + chunk = count; + tmpBuffer = new byte[chunk]; + } + + Array.Copy(buffer, offset, tmpBuffer, 0, chunk); + _blobHandle.PutSegment(tmpBuffer); + + offset += chunk; + count -= chunk; + _position += chunk; + } + } + catch + { + _blobHandle.Cancel(); + throw; + } + } + public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + try + { + if (!_blobHandle.IsOpen) + await _blobHandle.CreateAsync(cancellationToken).ConfigureAwait(false); + + var chunk = count >= _blobHandle.SegmentSize ? _blobHandle.SegmentSize : count; + var tmpBuffer = new byte[chunk]; + + while (count > 0) + { + if (chunk > count) + { + chunk = count; + tmpBuffer = new byte[chunk]; + } + + Array.Copy(buffer, offset, tmpBuffer, 0, chunk); + await _blobHandle.PutSegmentAsync(tmpBuffer, cancellationToken).ConfigureAwait(false); + + offset += chunk; + count -= chunk; + _position += chunk; + } + } + catch + { + await _blobHandle.CancelAsync(cancellationToken).ConfigureAwait(false); + throw; + } + } + + public override bool CanRead => true; + public override bool CanSeek => true; + public override bool CanWrite => true; + + protected override void Dispose(bool disposing) + { + _blobHandle.Close(); + } + + public override ValueTask DisposeAsync() + { + return _blobHandle.CloseAsync(); + } + + private static void ValidateBufferSize(byte[] buffer, int offset, int count) + { + if (buffer is null) + throw new ArgumentNullException(nameof(buffer)); + + if (buffer.Length < offset + count) + throw new InvalidOperationException(); + } +} \ No newline at end of file diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/Charset.cs b/src/FirebirdSql.Data.FirebirdClient/Common/Charset.cs index 55ec3dd19..c8fb48659 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Common/Charset.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Common/Charset.cs @@ -113,7 +113,7 @@ public Charset(int id, string name, int bytesPerCharacter, string systemName) switch (SystemName) { case None: - Encoding = Encoding2.Default; + Encoding = Encoding.GetANSIEncoding(); IsNoneCharset = true; break; case Octets: diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/DatabaseBase.cs b/src/FirebirdSql.Data.FirebirdClient/Common/DatabaseBase.cs index 52a810c2d..e118cd7e3 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Common/DatabaseBase.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Common/DatabaseBase.cs @@ -28,7 +28,7 @@ internal abstract class DatabaseBase public Action WarningMessage { get; set; } public abstract bool UseUtf8ParameterBuffer { get; } - public Encoding ParameterBufferEncoding => UseUtf8ParameterBuffer ? Encoding.UTF8 : Encoding2.Default; + public Encoding ParameterBufferEncoding => UseUtf8ParameterBuffer ? Encoding.UTF8 : Encoding.GetANSIEncoding(); public abstract int Handle { get; } public Charset Charset { get; } diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/DateTime2.cs b/src/FirebirdSql.Data.FirebirdClient/Common/DateTime2.cs deleted file mode 100644 index 72bdaa5d2..000000000 --- a/src/FirebirdSql.Data.FirebirdClient/Common/DateTime2.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * The contents of this file are subject to the Initial - * Developer's Public License Version 1.0 (the "License"); - * you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. - * - * Software distributed under the License is distributed on - * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either - * express or implied. See the License for the specific - * language governing rights and limitations under the License. - * - * All Rights Reserved. - */ - -//$Authors = Jiri Cincura (jiri@cincura.net) - -using System; - -namespace FirebirdSql.Data.Common; - -internal static class DateTime2 -{ - public static DateTime UnixEpoch => -#if NET48 || NETSTANDARD2_0 - new DateTime(621355968000000000); -#else - DateTime.UnixEpoch; -#endif -} diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/DbField.cs b/src/FirebirdSql.Data.FirebirdClient/Common/DbField.cs index 924991656..3be89be74 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Common/DbField.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Common/DbField.cs @@ -16,6 +16,7 @@ //$Authors = Carlos Guzman Alvarez, Jiri Cincura (jiri@cincura.net) using System; +using System.Linq; using System.Numerics; using FirebirdSql.Data.Types; @@ -325,10 +326,11 @@ public void SetValue(byte[] buffer) { var s = Charset.GetString(buffer, 0, buffer.Length); + var runes = s.EnumerateRunesToChars().ToList(); if ((Length % Charset.BytesPerCharacter) == 0 && - s.Length > CharCount) + runes.Count > CharCount) { - s = s.Substring(0, CharCount); + s = new string([.. runes.Take(CharCount).SelectMany(x => x)]); } DbValue.SetValue(s); @@ -509,7 +511,7 @@ public void FixNull() case DbDataType.Date: case DbDataType.TimeStamp: - DbValue.SetValue(DateTime2.UnixEpoch); + DbValue.SetValue(DateTime.UnixEpoch); break; case DbDataType.Time: @@ -522,7 +524,7 @@ public void FixNull() case DbDataType.TimeStampTZ: case DbDataType.TimeStampTZEx: - DbValue.SetValue(new FbZonedDateTime(DateTime2.UnixEpoch, TimeZoneMapping.DefaultTimeZoneName)); + DbValue.SetValue(new FbZonedDateTime(DateTime.UnixEpoch, TimeZoneMapping.DefaultTimeZoneName)); break; case DbDataType.TimeTZ: diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/DbValue.cs b/src/FirebirdSql.Data.FirebirdClient/Common/DbValue.cs index f799b5acd..44b79a0f1 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Common/DbValue.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Common/DbValue.cs @@ -17,9 +17,11 @@ using System; using System.Globalization; +using System.Linq; using System.Numerics; using System.Threading; using System.Threading.Tasks; +using FirebirdSql.Data.FirebirdClient; using FirebirdSql.Data.Types; namespace FirebirdSql.Data.Common; @@ -331,13 +333,26 @@ public async ValueTask GetBinaryAsync(CancellationToken cancellationToke return (byte[])_value; } + public BlobStream GetBinaryStream() + { + if (_value is not long l) + throw new NotSupportedException(); + + return GetBlobStream(l); + } + public ValueTask GetBinaryStreamAsync(CancellationToken cancellationToken = default) + { + if (_value is not long l) + throw new NotSupportedException(); + + return GetBlobStreamAsync(l, cancellationToken); + } + public int GetDate() { return _value switch { -#if NET6_0_OR_GREATER DateOnly @do => TypeEncoder.EncodeDate(@do), -#endif _ => TypeEncoder.EncodeDate(GetDateTime()), }; } @@ -348,9 +363,7 @@ public int GetTime() { TimeSpan ts => TypeEncoder.EncodeTime(ts), FbZonedTime zt => TypeEncoder.EncodeTime(zt.Time), -#if NET6_0_OR_GREATER TimeOnly to => TypeEncoder.EncodeTime(to), -#endif _ => TypeEncoder.EncodeTime(TypeHelper.DateTimeTimeToTimeSpan(GetDateTime())), }; } @@ -411,7 +424,7 @@ public byte[] GetBytes() else { var svalue = GetString(); - if ((Field.Length % Field.Charset.BytesPerCharacter) == 0 && svalue.Length > Field.CharCount) + if ((Field.Length % Field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > Field.CharCount) { throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation }); } @@ -447,7 +460,7 @@ public byte[] GetBytes() else { var svalue = GetString(); - if ((Field.Length % Field.Charset.BytesPerCharacter) == 0 && svalue.Length > Field.CharCount) + if ((Field.Length % Field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > Field.CharCount) { throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation }); } @@ -626,7 +639,7 @@ public async ValueTask GetBytesAsync(CancellationToken cancellationToken else { var svalue = await GetStringAsync(cancellationToken).ConfigureAwait(false); - if ((Field.Length % Field.Charset.BytesPerCharacter) == 0 && svalue.Length > Field.CharCount) + if ((Field.Length % Field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > Field.CharCount) { throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation }); } @@ -662,7 +675,7 @@ public async ValueTask GetBytesAsync(CancellationToken cancellationToken else { var svalue = await GetStringAsync(cancellationToken).ConfigureAwait(false); - if ((Field.Length % Field.Charset.BytesPerCharacter) == 0 && svalue.Length > Field.CharCount) + if ((Field.Length % Field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > Field.CharCount) { throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation }); } @@ -854,6 +867,17 @@ private ValueTask GetBlobDataAsync(long blobId, CancellationToken cancel return blob.ReadAsync(cancellationToken); } + private BlobStream GetBlobStream(long blobId) + { + var blob = _statement.CreateBlob(blobId); + return new BlobStream(blob); + } + private ValueTask GetBlobStreamAsync(long blobId, CancellationToken cancellationToken = default) + { + var blob = _statement.CreateBlob(blobId); + return ValueTask.FromResult(new BlobStream(blob)); + } + private Array GetArrayData(long handle) { if (_field.ArrayHandle == null) diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/EmptyDescriptorFiller.cs b/src/FirebirdSql.Data.FirebirdClient/Common/EmptyDescriptorFiller.cs index 7a9a658da..cb2468dd0 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Common/EmptyDescriptorFiller.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Common/EmptyDescriptorFiller.cs @@ -32,6 +32,6 @@ public void Fill(Descriptor descriptor, int index) public ValueTask FillAsync(Descriptor descriptor, int index, CancellationToken cancellationToken = default) { - return ValueTask2.CompletedTask; + return ValueTask.CompletedTask; } } diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/Encoding2.cs b/src/FirebirdSql.Data.FirebirdClient/Common/Encoding2.cs deleted file mode 100644 index 726705610..000000000 --- a/src/FirebirdSql.Data.FirebirdClient/Common/Encoding2.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The contents of this file are subject to the Initial - * Developer's Public License Version 1.0 (the "License"); - * you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt. - * - * Software distributed under the License is distributed on - * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either - * express or implied. See the License for the specific - * language governing rights and limitations under the License. - * - * All Rights Reserved. - */ - -//$Authors = Jiri Cincura (jiri@cincura.net) - -using System; -using System.Globalization; -using System.Text; - -namespace FirebirdSql.Data.Common; - -internal static class Encoding2 -{ - public static Encoding Default { get; } = GetANSIEncoding(); - - private static Encoding GetANSIEncoding() - { -#if NET48 - return Encoding.Default; -#else - try - { - return Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.ANSICodePage); - } - catch (Exception) - { - return Encoding.Default; - } -#endif - } -} diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/Extensions.cs b/src/FirebirdSql.Data.FirebirdClient/Common/Extensions.cs index b3d5d4327..6143cc839 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Common/Extensions.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Common/Extensions.cs @@ -17,49 +17,89 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; -using System.Net.Sockets; +using System.Text; namespace FirebirdSql.Data.Common; internal static class Extensions { - public static int AsInt(this IntPtr ptr) + extension(IntPtr ptr) { - return (int)ptr.ToInt64(); + public int AsInt() + { + return (int)ptr.ToInt64(); + } } - public static IntPtr ReadIntPtr(this BinaryReader self) + extension(BinaryReader binaryReader) { - if (IntPtr.Size == sizeof(int)) + public IntPtr ReadIntPtr() { - return new IntPtr(self.ReadInt32()); + if (IntPtr.Size == sizeof(int)) + { + return new IntPtr(binaryReader.ReadInt32()); + } + else if (IntPtr.Size == sizeof(long)) + { + return new IntPtr(binaryReader.ReadInt64()); + } + else + { + throw new NotSupportedException(); + } } - else if (IntPtr.Size == sizeof(long)) + } + + extension(byte[] b) + { + public string ToHexString() { - return new IntPtr(self.ReadInt64()); + return Convert.ToHexString(b); } - else + } + + extension(T[] array) + { + public IEnumerable> Split(int size) { - throw new NotSupportedException(); + for (var i = 0; i < (float)array.Length / size; i++) + { + yield return array.Skip(i * size).Take(size); + } } } - public static string ToHexString(this byte[] b) + extension(string s) { - return BitConverter.ToString(b).Replace("-", string.Empty); + public IEnumerable EnumerateRunesToChars() + { + if (s == null) + throw new ArgumentNullException(nameof(s)); + + return s.EnumerateRunes().Select(r => + { + var result = new char[r.Utf16SequenceLength]; + r.EncodeToUtf16(result); + return result; + }); + } } - public static IEnumerable> Split(this T[] array, int size) + extension(Encoding) { - for (var i = 0; i < (float)array.Length / size; i++) + public static Encoding GetANSIEncoding() { - yield return array.Skip(i * size).Take(size); + try + { + return Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.ANSICodePage); + } + catch (Exception) + { + return Encoding.Default; + } } } - -#if NETSTANDARD2_0 - public static HashSet ToHashSet(this IEnumerable source) => new HashSet(source); -#endif } diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/IscCodes.cs b/src/FirebirdSql.Data.FirebirdClient/Common/IscCodes.cs index 40bb78da9..25a9d29a6 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Common/IscCodes.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Common/IscCodes.cs @@ -941,6 +941,10 @@ internal static class IscCodes public const int RBL_eof_pending = 4; public const int RBL_create = 8; + public const int isc_blb_seek_from_head = 0; + public const int isc_blb_seek_relative = 1; + public const int isc_blb_seek_from_tail = 2; + #endregion #region Blob Information diff --git a/src/FirebirdSql.Data.FirebirdClient/Common/IscErrorMessages.cs b/src/FirebirdSql.Data.FirebirdClient/Common/IscErrorMessages.cs index ad90db0c3..a3ad97a9e 100644 --- a/src/FirebirdSql.Data.FirebirdClient/Common/IscErrorMessages.cs +++ b/src/FirebirdSql.Data.FirebirdClient/Common/IscErrorMessages.cs @@ -23,6 +23,7 @@ internal static class IscErrorMessages { static Dictionary _messages = new Dictionary() { + {335544320, ""}, {335544321, "arithmetic exception, numeric overflow, or string truncation"}, /* arith_except */ {335544322, "invalid database key"}, /* bad_dbkey */ {335544323, "file {0} is not a valid database"}, /* bad_db_format */ @@ -215,8 +216,7 @@ internal static class IscErrorMessages {335544510, "lock time-out on wait transaction"}, /* lock_timeout */ {335544511, "procedure {0} is not defined"}, /* prcnotdef */ {335544512, "Input parameter mismatch for procedure {0}"}, /* prcmismat */ - {335544513, @"Database {0}: WAL subsystem bug for pid {1} -{2}"}, /* wal_bugcheck */ + {335544513, "Database {0}: WAL subsystem bug for pid {1}\n{2}"}, /* wal_bugcheck */ {335544514, "Could not expand the WAL segment for database {0}"}, /* wal_cant_expand */ {335544515, "status code {0} unknown"}, /* codnotdef */ {335544516, "exception {0} not defined"}, /* xcpnotdef */ @@ -340,9 +340,9 @@ internal static class IscErrorMessages {335544634, "Token unknown - line {0}, column {1}"}, /* dsql_token_unk_err */ {335544635, "there is no alias or table named {0} at this scope level"}, /* dsql_no_relation_alias */ {335544636, "there is no index {0} for table {1}"}, /* indexname */ - {335544637, "table {0} is not referenced in plan"}, /* no_stream_plan */ - {335544638, "table {0} is referenced more than once in plan; use aliases to distinguish"}, /* stream_twice */ - {335544639, "table {0} is referenced in the plan but not the from list"}, /* stream_not_found */ + {335544637, "table or procedure {0} is not referenced in plan"}, /* no_stream_plan */ + {335544638, "table or procedure {0} is referenced more than once in plan; use aliases to distinguish"}, /* stream_twice */ + {335544639, "table or procedure {0} is referenced in the plan but not the from list"}, /* stream_not_found */ {335544640, "Invalid use of CHARACTER SET or COLLATE"}, /* collation_requires_text */ {335544641, "Specified domain or source column {0} does not exist"}, /* dsql_domain_not_found */ {335544642, "index {0} cannot be used in the specified plan"}, /* index_unused */ @@ -362,7 +362,7 @@ internal static class IscErrorMessages {335544656, "variable {0} conflicts with parameter in same procedure"}, /* dsql_var_conflict */ {335544657, "Array/BLOB/DATE data types not allowed in arithmetic"}, /* dsql_no_blob_array */ {335544658, "{0} is not a valid base table of the specified view"}, /* dsql_base_table */ - {335544659, "table {0} is referenced twice in view; use an alias to distinguish"}, /* duplicate_base_table */ + {335544659, "table or procedure {0} is referenced twice in view; use an alias to distinguish"}, /* duplicate_base_table */ {335544660, "view {0} has more than one base table; use aliases to distinguish"}, /* view_alias */ {335544661, "cannot add index, index root page is full."}, /* index_root_page_full */ {335544662, "BLOB SUB_TYPE {0} is not defined"}, /* dsql_blob_type_unknown */ @@ -546,8 +546,8 @@ internal static class IscErrorMessages {335544840, "cannot update"}, /* no_update */ {335544841, "Cursor is already open"}, /* cursor_already_open */ {335544842, "{0}"}, /* stack_trace */ - {335544843, "Context variable {0} is not found in namespace {1}"}, /* ctx_var_not_found */ - {335544844, "Invalid namespace name {0} passed to {1}"}, /* ctx_namespace_invalid */ + {335544843, "Context variable '{0}' is not found in namespace '{1}'"}, /* ctx_var_not_found */ + {335544844, "Invalid namespace name '{0}' passed to {1}"}, /* ctx_namespace_invalid */ {335544845, "Too many context variables"}, /* ctx_too_big */ {335544846, "Invalid argument passed to {0}"}, /* ctx_bad_argument */ {335544847, "BLR syntax error. Identifier {0}... is too long"}, /* identifier_too_long */ @@ -624,15 +624,12 @@ internal static class IscErrorMessages {335544918, "Attachment handle is busy"}, /* att_handle_busy */ {335544919, "Bad written UDF detected: pointer returned in FREE_IT function was not allocated by ib_util_malloc"}, /* bad_udf_freeit */ {335544920, "External Data Source provider '{0}' not found"}, /* eds_provider_not_found */ - {335544921, @"Execute statement error at {0} : -{1}Data source : {2}"}, /* eds_connection */ + {335544921, "Execute statement error at {0} :\n{1}Data source : {2}"}, /* eds_connection */ {335544922, "Execute statement preprocess SQL error"}, /* eds_preprocess */ {335544923, "Statement expected"}, /* eds_stmt_expected */ {335544924, "Parameter name expected"}, /* eds_prm_name_expected */ {335544925, "Unclosed comment found near '{0}'"}, /* eds_unclosed_comment */ - {335544926, @"Execute statement error at {0} : -{1}Statement : {2} -Data source : {3}"}, /* eds_statement */ + {335544926, "Execute statement error at {0} :\n{1}Statement : {2}\nData source : {3}"}, /* eds_statement */ {335544927, "Input parameters mismatch"}, /* eds_input_prm_mismatch */ {335544928, "Output parameters mismatch"}, /* eds_output_prm_mismatch */ {335544929, "Input parameter '{0}' have no value set"}, /* eds_input_prm_not_set */ @@ -690,7 +687,7 @@ internal static class IscErrorMessages {335544981, "Floating point overflow in built-in function {0}"}, /* sysf_fp_overflow */ {335544982, "Floating point overflow in result from UDF {0}"}, /* udf_fp_overflow */ {335544983, "Invalid floating point value returned by UDF {0}"}, /* udf_fp_nan */ - {335544984, "Database is probably already opened by another engine instance in another Windows session"}, /* instance_conflict */ + {335544984, "Shared memory area is probably already created by another engine instance in another Windows session"}, /* instance_conflict */ {335544985, "No free space found in temporary directories"}, /* out_of_temp_space */ {335544986, "Explicit transaction control is not allowed"}, /* eds_expl_tran_ctrl */ {335544987, "Use of TRUSTED switches in spb_command_line is prohibited"}, /* no_trusted_spb */ @@ -824,7 +821,7 @@ internal static class IscErrorMessages {335545115, "Cannot open cursor for non-SELECT statement"}, /* no_cursor */ {335545116, "If specifies {0}, then shall not specify {1}"}, /* dsql_window_incompat_frames */ {335545117, "RANGE based window with {PRECEDING | FOLLOWING} cannot have ORDER BY with more than one value"}, /* dsql_window_range_multi_key */ - {335545118, "RANGE based window must have an ORDER BY key of numerical, date, time or timestamp types"}, /* dsql_window_range_inv_key_type */ + {335545118, "RANGE based window with PRECEDING/FOLLOWING must have a single ORDER BY key of numerical, date, time or timestamp types"}, /* dsql_window_range_inv_key_type */ {335545119, "Window RANGE/ROWS PRECEDING/FOLLOWING value must be of a numerical type"}, /* dsql_window_frame_value_inv_type */ {335545120, "Invalid PRECEDING or FOLLOWING offset in window function: cannot be negative"}, /* window_frame_value_invalid */ {335545121, "Window {0} not found"}, /* dsql_window_not_found */ @@ -843,7 +840,7 @@ internal static class IscErrorMessages {335545134, "OVERRIDING clause can be used only when an identity column is present in the INSERT's field list for table/view {0}"}, /* overriding_without_identity */ {335545135, "OVERRIDING SYSTEM VALUE can be used only for identity column defined as 'GENERATED ALWAYS' in INSERT for table/view {0}"}, /* overriding_system_invalid */ {335545136, "OVERRIDING USER VALUE can be used only for identity column defined as 'GENERATED BY DEFAULT' in INSERT for table/view {0}"}, /* overriding_user_invalid */ - {335545137, "OVERRIDING SYSTEM VALUE should be used to override the value of an identity column defined as 'GENERATED ALWAYS' in table/view {0}"}, /* overriding_system_missing */ + {335545137, "OVERRIDING clause should be used when an identity column defined as 'GENERATED ALWAYS' is present in the INSERT's field list for table table/view {0}"}, /* overriding_missing */ {335545138, "DecFloat precision must be 16 or 34"}, /* decprecision_err */ {335545139, "Decimal float divide by zero. The code attempted to divide a DECFLOAT value by zero."}, /* decfloat_divide_by_zero */ {335545140, "Decimal float inexact result. The result of an operation cannot be represented as a decimal fraction."}, /* decfloat_inexact_result */ @@ -884,7 +881,7 @@ internal static class IscErrorMessages {335545175, "Segment size ({0}) should not exceed 65535 (64K - 1) when using segmented blob"}, /* big_segment */ {335545176, "Invalid blob policy in the batch for {0}() call"}, /* batch_policy */ {335545177, "Can't change default BPB after adding any data to batch"}, /* batch_defbpb */ - {335545178, "Unexpected info buffer structure querying for default blob alignment"}, /* batch_align */ + {335545178, "Unexpected info buffer structure querying for server batch parameters"}, /* batch_align */ {335545179, "Duplicated segment {0} in multisegment connect block parameter"}, /* multi_segment_dup */ {335545180, "Plugin not supported by network protocol"}, /* non_plugin_protocol */ {335545181, "Error parsing message format"}, /* message_format */ @@ -981,14 +978,31 @@ internal static class IscErrorMessages {335545272, "Reset of user session failed. Connection is shut down."}, /* ses_reset_failed */ {335545273, "File size is less than expected"}, /* block_size */ {335545274, "Invalid key length {0}, need >{1}"}, /* tom_key_length */ + {335545275, "Invalid information arguments"}, /* inf_invalid_args */ + {335545276, "Empty or NULL parameter {0} is not accepted"}, /* sysf_invalid_null_empty */ + {335545277, "Undefined local table number {0}"}, /* bad_loctab_num */ + {335545278, "Invalid text <{0}> after quoted string"}, /* quoted_str_bad */ + {335545279, "Missing terminating quote <{0}> in the end of quoted string"}, /* quoted_str_miss */ + {335545280, "{0}: inconsistent shared memory type/version; found {1}, expected {2}"}, /* wrong_shmem_ver */ + {335545281, "{0}-bit engine can't open database already opened by {1}-bit engine"}, /* wrong_shmem_bitness */ + {335545282, "Procedures cannot specify access type other than NATURAL in the plan"}, /* wrong_proc_plan */ + {335545283, "Invalid RDB$BLOB_UTIL handle"}, /* invalid_blob_util_handle */ + {335545284, "Invalid temporary BLOB ID"}, /* bad_temp_blob_id */ + {335545285, "ODS upgrade failed while adding new system {0}"}, /* ods_upgrade_err */ + {335545286, "Wrong parallel workers value {0}, valid range are from 1 to {1}"}, /* bad_par_workers */ + {335545287, "Definition of index expression is not found for index {0}"}, /* idx_expr_not_found */ + {335545288, "Definition of index condition is not found for index {0}"}, /* idx_cond_not_found */ {335740929, "data base file name ({0}) already given"}, /* gfix_db_name */ {335740930, "invalid switch {0}"}, /* gfix_invalid_sw */ + {335740931, "gfix version {0}"}, /* gfix_version */ {335740932, "incompatible switch combination"}, /* gfix_incmp_sw */ {335740933, "replay log pathname required"}, /* gfix_replay_req */ {335740934, "number of page buffers for cache required"}, /* gfix_pgbuf_req */ {335740935, "numeric value required"}, /* gfix_val_req */ {335740936, "positive numeric value required"}, /* gfix_pval_req */ {335740937, "number of transactions per sweep required"}, /* gfix_trn_req */ + {335740938, "transaction number or \"all\" required"}, /* gfix_trn_all_req */ + {335740939, "\"sync\" or \"async\" required"}, /* gfix_sync_req */ {335740940, "\"full\" or \"reserve\" required"}, /* gfix_full_req */ {335740941, "user name required"}, /* gfix_usrname_req */ {335740942, "password required"}, /* gfix_pass_req */ @@ -998,21 +1012,128 @@ internal static class IscErrorMessages {335740946, "numeric value between 0 and 32767 inclusive required"}, /* gfix_nval_req */ {335740947, "must specify type of shutdown"}, /* gfix_type_shut */ {335740948, "please retry, specifying an option"}, /* gfix_retry */ + {335740949, "plausible options are:"}, /* gfix_opt */ + {335740950, "\\n Options can be abbreviated to the unparenthesized characters"}, /* gfix_qualifiers */ {335740951, "please retry, giving a database name"}, /* gfix_retry_db */ + {335740952, "Summary of validation errors"}, /* gfix_summary */ + {335740953, " -ac(tivate_shadow) activate shadow file for database usage"}, /* gfix_opt_active */ + {335740954, " -at(tach) shutdown new database attachments"}, /* gfix_opt_attach */ + {335740955, "\t-begin_log\tbegin logging for replay utility"}, /* gfix_opt_begin_log */ + {335740956, " -b(uffers) set page buffers "}, /* gfix_opt_buffers */ + {335740957, " -co(mmit) commit transaction "}, /* gfix_opt_commit */ + {335740958, " -ca(che) shutdown cache manager"}, /* gfix_opt_cache */ + {335740959, "\t-disable\tdisable WAL"}, /* gfix_opt_disable */ + {335740960, " -fu(ll) validate record fragments (-v)"}, /* gfix_opt_full */ + {335740961, " -fo(rce_shutdown) force database shutdown"}, /* gfix_opt_force */ + {335740962, " -h(ousekeeping) set sweep interval "}, /* gfix_opt_housekeep */ + {335740963, " -i(gnore) ignore checksum errors"}, /* gfix_opt_ignore */ + {335740964, " -k(ill_shadow) kill all unavailable shadow files"}, /* gfix_opt_kill */ + {335740965, " -l(ist) show limbo transactions"}, /* gfix_opt_list */ + {335740966, " -me(nd) prepare corrupt database for backup"}, /* gfix_opt_mend */ + {335740967, " -n(o_update) read-only validation (-v)"}, /* gfix_opt_no_update */ + {335740968, " -o(nline) database online "}, /* gfix_opt_online */ + {335740969, " -pr(ompt) prompt for commit/rollback (-l)"}, /* gfix_opt_prompt */ + {335740970, " -pa(ssword) default password"}, /* gfix_opt_password */ + {335740971, "\t-quit_log\tquit logging for replay utility"}, /* gfix_opt_quit_log */ + {335740972, " -r(ollback) rollback transaction "}, /* gfix_opt_rollback */ + {335740973, " -sw(eep) force garbage collection"}, /* gfix_opt_sweep */ + {335740974, " -sh(utdown) shutdown "}, /* gfix_opt_shut */ + {335740975, " -tw(o_phase) perform automated two-phase recovery"}, /* gfix_opt_two_phase */ + {335740976, " -tra(nsaction) shutdown transaction startup"}, /* gfix_opt_tran */ + {335740977, " -u(se) use full or reserve space for versions"}, /* gfix_opt_use */ + {335740978, " -user default user name"}, /* gfix_opt_user */ + {335740979, " -v(alidate) validate database structure"}, /* gfix_opt_validate */ + {335740980, " -w(rite) write synchronously or asynchronously"}, /* gfix_opt_write */ + {335740981, " -x set debug on"}, /* gfix_opt_x */ + {335740982, " -z print software version number"}, /* gfix_opt_z */ + {335740983, "\\n\tNumber of record level errors\t: {0}"}, /* gfix_rec_err */ + {335740984, "\tNumber of Blob page errors\t: {0}"}, /* gfix_blob_err */ + {335740985, "\tNumber of data page errors\t: {0}"}, /* gfix_data_err */ + {335740986, "\tNumber of index page errors\t: {0}"}, /* gfix_index_err */ + {335740987, "\tNumber of pointer page errors\t: {0}"}, /* gfix_pointer_err */ + {335740988, "\tNumber of transaction page errors\t: {0}"}, /* gfix_trn_err */ + {335740989, "\tNumber of database page errors\t: {0}"}, /* gfix_db_err */ + {335740990, "bad block type"}, /* gfix_bad_block */ {335740991, "internal block exceeds maximum size"}, /* gfix_exceed_max */ {335740992, "corrupt pool"}, /* gfix_corrupt_pool */ {335740993, "virtual memory exhausted"}, /* gfix_mem_exhausted */ {335740994, "bad pool id"}, /* gfix_bad_pool */ {335740995, "Transaction state {0} not in valid range."}, /* gfix_trn_not_valid */ + {335740996, "ATTACH_DATABASE: attempted attach of {0},"}, /* gfix_dbg_attach */ + {335740997, " failed"}, /* gfix_dbg_failed */ + {335740998, " succeeded"}, /* gfix_dbg_success */ + {335740999, "Transaction {0} is in limbo."}, /* gfix_trn_limbo */ + {335741000, "More limbo transactions than fit. Try again"}, /* gfix_try_again */ + {335741001, "Unrecognized info item {0}"}, /* gfix_unrec_item */ + {335741002, "A commit of transaction {0} will violate two-phase commit."}, /* gfix_commit_violate */ + {335741003, "A rollback of transaction {0} is needed to preserve two-phase commit."}, /* gfix_preserve */ + {335741004, "Transaction {0} has already been partially committed."}, /* gfix_part_commit */ + {335741005, "A rollback of this transaction will violate two-phase commit."}, /* gfix_rback_violate */ + {335741006, "Transaction {0} has been partially committed."}, /* gfix_part_commit2 */ + {335741007, "A commit is necessary to preserve the two-phase commit."}, /* gfix_commit_pres */ + {335741008, "Insufficient information is available to determine"}, /* gfix_insuff_info */ + {335741009, "a proper action for transaction {0}."}, /* gfix_action */ + {335741010, "Transaction {0}: All subtransactions have been prepared."}, /* gfix_all_prep */ + {335741011, "Either commit or rollback is possible."}, /* gfix_comm_rback */ {335741012, "unexpected end of input"}, /* gfix_unexp_eoi */ + {335741013, "Commit, rollback, or neither (c, r, or n)?"}, /* gfix_ask */ + {335741014, "Could not reattach to database for transaction {0}."}, /* gfix_reattach_failed */ + {335741015, "Original path: {0}"}, /* gfix_org_path */ + {335741016, "Enter a valid path:"}, /* gfix_enter_path */ + {335741017, "Attach unsuccessful."}, /* gfix_att_unsucc */ {335741018, "failed to reconnect to a transaction in database {0}"}, /* gfix_recon_fail */ + {335741019, "Transaction {0}:"}, /* gfix_trn2 */ + {335741020, " Multidatabase transaction:"}, /* gfix_mdb_trn */ + {335741021, " Host Site: {0}"}, /* gfix_host_site */ + {335741022, " Transaction {0}"}, /* gfix_trn */ + {335741023, "has been prepared."}, /* gfix_prepared */ + {335741024, "has been committed."}, /* gfix_committed */ + {335741025, "has been rolled back."}, /* gfix_rolled_back */ + {335741026, "is not available."}, /* gfix_not_available */ + {335741027, "is not found, assumed not prepared."}, /* gfix_not_prepared */ + {335741028, "is not found, assumed to be committed."}, /* gfix_be_committed */ + {335741029, " Remote Site: {0}"}, /* gfix_rmt_site */ + {335741030, " Database Path: {0}"}, /* gfix_db_path */ + {335741031, " Automated recovery would commit this transaction."}, /* gfix_auto_comm */ + {335741032, " Automated recovery would rollback this transaction."}, /* gfix_auto_rback */ + {335741033, "Warning: Multidatabase transaction is in inconsistent state for recovery."}, /* gfix_warning */ + {335741034, "Transaction {0} was committed, but prior ones were rolled back."}, /* gfix_trn_was_comm */ + {335741035, "Transaction {0} was rolled back, but prior ones were committed."}, /* gfix_trn_was_rback */ {335741036, "Transaction description item unknown"}, /* gfix_trn_unknown */ + {335741037, " -mo(de) read_only or read_write database"}, /* gfix_opt_mode */ {335741038, "\"read_only\" or \"read_write\" required"}, /* gfix_mode_req */ + {335741039, " -sq(l_dialect) set database dialect n"}, /* gfix_opt_SQL_dialect */ + {335741040, "database SQL dialect must be one of '{0}'"}, /* gfix_SQL_dialect */ + {335741041, "dialect number required"}, /* gfix_dialect_req */ {335741042, "positive or zero numeric value required"}, /* gfix_pzval_req */ + {335741043, " -tru(sted) use trusted authentication"}, /* gfix_opt_trusted */ + {335741044, "could not open password file {0}, errno {1}"}, + {335741045, "could not read password file {0}, errno {1}"}, + {335741046, "empty password file {0}"}, + {335741047, " -fe(tch_password) fetch password from file"}, + {335741048, "usage: gfix [options] "}, + {335741049, " -nol(inger) close database ignoring linger setting for it"}, /* gfix_opt_nolinger */ + {335741050, "\tNumber of inventory page errors\t: {0}"}, /* gfix_pip_err */ + {335741051, "\tNumber of record level warnings\t: {0}"}, /* gfix_rec_warn */ + {335741052, "\tNumber of blob page warnings\t: {0}"}, /* gfix_blob_warn */ + {335741053, "\tNumber of data page warnings\t: {0}"}, /* gfix_data_warn */ + {335741054, "\tNumber of index page warnings\t: {0}"}, /* gfix_index_warn */ + {335741055, "\tNumber of pointer page warnings\t: {0}"}, /* gfix_pointer_warn */ + {335741056, "\tNumber of transaction page warnings\t: {0}"}, /* gfix_trn_warn */ + {335741057, "\tNumber of database page warnings\t: {0}"}, /* gfix_db_warn */ + {335741058, "\tNumber of inventory page warnings\t: {0}"}, /* gfix_pip_warn */ + {335741059, " -icu fix database to be usable with present ICU version"}, /* gfix_opt_icu */ + {335741060, " -role set SQL role name"}, /* gfix_opt_role */ + {335741061, "SQL role name required"}, /* gfix_role_req */ + {335741062, " -repl(ica) replica mode "}, /* gfix_opt_repl */ + {335741063, "replica mode (none / read_only / read_write) required"}, /* gfix_repl_mode_req */ + {335741064, " -par(allel) parallel workers (-sweep, -icu)"}, /* gfix_opt_parallel */ + {335741065, " -up(grade) upgrade database ODS"}, /* gfix_opt_upgrade */ {336003074, "Cannot SELECT RDB$DB_KEY from a stored procedure."}, /* dsql_dbkey_from_non_table */ {336003075, "Precision 10 to 18 changed from DOUBLE PRECISION in SQL dialect 1 to 64-bit scaled integer in SQL dialect 3"}, /* dsql_transitional_numeric */ {336003076, "Use of {0} expression that returns different results in dialect 1 and dialect 3"}, /* dsql_dialect_warning_expr */ {336003077, "Database SQL dialect {0} does not support reference to {1} datatype"}, /* sql_db_dialect_dtype_unsupport */ + {336003078, ""}, {336003079, "DB dialect {0} and client dialect {1} conflict with respect to numeric precision {2}."}, /* sql_dialect_conflict_num */ {336003080, "WARNING: Numeric literal {0} is interpreted as a floating-point"}, /* dsql_warning_number_ambiguous */ {336003081, "value in SQL dialect 1, but as an exact numeric value in SQL dialect 3."}, /* dsql_warning_number_ambiguous1 */ @@ -1048,22 +1169,192 @@ internal static class IscErrorMessages {336003111, "Wrong number of parameters (expected {0}, got {1})"}, /* dsql_wrong_param_num */ {336003112, "Invalid DROP SQL SECURITY clause"}, /* dsql_invalid_drop_ss_clause */ {336003113, "UPDATE OR INSERT value for field {0}, part of the implicit or explicit MATCHING clause, cannot be DEFAULT"}, /* upd_ins_cannot_default */ + {336068609, "ODS version not supported by DYN"}, + {336068610, "unsupported DYN verb"}, + {336068611, "STORE RDB$FIELD_DIMENSIONS failed"}, + {336068612, "unsupported DYN verb"}, + {336068613, "{0}"}, + {336068614, "unsupported DYN verb"}, + {336068615, "DEFINE BLOB FILTER failed"}, + {336068616, "DEFINE GENERATOR failed"}, + {336068617, "DEFINE GENERATOR unexpected DYN verb"}, + {336068618, "DEFINE FUNCTION failed"}, + {336068619, "unsupported DYN verb"}, + {336068620, "DEFINE FUNCTION ARGUMENT failed"}, + {336068621, "STORE RDB$FIELDS failed"}, + {336068622, "No table specified for index"}, + {336068623, "STORE RDB$INDEX_SEGMENTS failed"}, + {336068624, "unsupported DYN verb"}, + {336068625, "PRIMARY KEY column lookup failed"}, + {336068626, "could not find UNIQUE or PRIMARY KEY constraint in table {0} with specified columns"}, + {336068627, "PRIMARY KEY lookup failed"}, + {336068628, "could not find PRIMARY KEY index in specified table {0}"}, + {336068629, "STORE RDB$INDICES failed"}, + {336068630, "STORE RDB$FIELDS failed"}, + {336068631, "STORE RDB$RELATION_FIELDS failed"}, + {336068632, "STORE RDB$RELATIONS failed"}, + {336068633, "STORE RDB$USER_PRIVILEGES failed defining a table"}, + {336068634, "unsupported DYN verb"}, + {336068635, "STORE RDB$RELATIONS failed"}, + {336068636, "STORE RDB$FIELDS failed"}, + {336068637, "STORE RDB$RELATION_FIELDS failed"}, + {336068638, "unsupported DYN verb"}, + {336068639, "DEFINE TRIGGER failed"}, + {336068640, "unsupported DYN verb"}, + {336068641, "DEFINE TRIGGER MESSAGE failed"}, + {336068642, "STORE RDB$VIEW_RELATIONS failed"}, + {336068643, "ERASE RDB$FIELDS failed"}, + {336068644, "ERASE BLOB FILTER failed"}, {336068645, "BLOB Filter {0} not found"}, /* dyn_filter_not_found */ + {336068646, "unsupported DYN verb"}, + {336068647, "ERASE RDB$FUNCTION_ARGUMENTS failed"}, + {336068648, "ERASE RDB$FUNCTIONS failed"}, {336068649, "Function {0} not found"}, /* dyn_func_not_found */ + {336068650, "unsupported DYN verb"}, + {336068651, "Domain {0} is used in table {1} (local name {2}) and cannot be dropped"}, + {336068652, "ERASE RDB$FIELDS failed"}, + {336068653, "ERASE RDB$FIELDS failed"}, + {336068654, "Column not found"}, + {336068655, "ERASE RDB$INDICES failed"}, {336068656, "Index not found"}, /* dyn_index_not_found */ + {336068657, "ERASE RDB$INDEX_SEGMENTS failed"}, + {336068658, "No segments found for index"}, + {336068659, "No table specified in ERASE RFR"}, + {336068660, "Column {0} from table {1} is referenced in view {2}"}, + {336068661, "ERASE RDB$RELATION_FIELDS failed"}, {336068662, "View {0} not found"}, /* dyn_view_not_found */ + {336068663, "Column not found for table"}, + {336068664, "ERASE RDB$INDEX_SEGMENTS failed"}, + {336068665, "ERASE RDB$INDICES failed"}, + {336068666, "ERASE RDB$RELATION_FIELDS failed"}, + {336068667, "ERASE RDB$VIEW_RELATIONS failed"}, + {336068668, "ERASE RDB$RELATIONS failed"}, + {336068669, "Table not found"}, + {336068670, "ERASE RDB$USER_PRIVILEGES failed"}, + {336068671, "ERASE RDB$FILES failed"}, + {336068672, "unsupported DYN verb"}, + {336068673, "ERASE RDB$TRIGGER_MESSAGES failed"}, + {336068674, "ERASE RDB$TRIGGERS failed"}, + {336068675, "Trigger not found"}, + {336068676, "MODIFY RDB$VIEW_RELATIONS failed"}, + {336068677, "unsupported DYN verb"}, + {336068678, "TRIGGER NAME expected"}, + {336068679, "ERASE TRIGGER MESSAGE failed"}, + {336068680, "Trigger Message not found"}, + {336068681, "unsupported DYN verb"}, + {336068682, "ERASE RDB$SECURITY_CLASSES failed"}, + {336068683, "Security class not found"}, + {336068684, "unsupported DYN verb"}, + {336068685, "SELECT RDB$USER_PRIVILEGES failed in grant"}, + {336068686, "SELECT RDB$USER_PRIVILEGES failed in grant"}, + {336068687, "STORE RDB$USER_PRIVILEGES failed in grant"}, + {336068688, "Specified domain or source column does not exist"}, + {336068689, "Generation of column name failed"}, + {336068690, "Generation of index name failed"}, + {336068691, "Generation of trigger name failed"}, + {336068692, "MODIFY DATABASE failed"}, + {336068693, "MODIFY RDB$CHARACTER_SETS failed"}, + {336068694, "MODIFY RDB$COLLATIONS failed"}, + {336068695, "MODIFY RDB$FIELDS failed"}, + {336068696, "MODIFY RDB$BLOB_FILTERS failed"}, {336068697, "Domain not found"}, /* dyn_domain_not_found */ + {336068698, "unsupported DYN verb"}, + {336068699, "MODIFY RDB$INDICES failed"}, + {336068700, "MODIFY RDB$FUNCTIONS failed"}, + {336068701, "Index column not found"}, + {336068702, "MODIFY RDB$GENERATORS failed"}, + {336068703, "MODIFY RDB$RELATION_FIELDS failed"}, + {336068704, "Local column {0} not found"}, + {336068705, "add EXTERNAL FILE not allowed"}, + {336068706, "drop EXTERNAL FILE not allowed"}, + {336068707, "MODIFY RDB$RELATIONS failed"}, + {336068708, "MODIFY RDB$PROCEDURE_PARAMETERS failed"}, + {336068709, "Table column not found"}, + {336068710, "MODIFY TRIGGER failed"}, + {336068711, "TRIGGER NAME expected"}, + {336068712, "unsupported DYN verb"}, + {336068713, "MODIFY TRIGGER MESSAGE failed"}, + {336068714, "Create metadata BLOB failed"}, + {336068715, "Write metadata BLOB failed"}, + {336068716, "Close metadata BLOB failed"}, {336068717, "Triggers created automatically cannot be modified"}, /* dyn_cant_modify_auto_trig */ + {336068718, "unsupported DYN verb"}, + {336068719, "ERASE RDB$USER_PRIVILEGES failed in revoke(1)"}, + {336068720, "Access to RDB$USER_PRIVILEGES failed in revoke(2)"}, + {336068721, "ERASE RDB$USER_PRIVILEGES failed in revoke (3)"}, + {336068722, "Access to RDB$USER_PRIVILEGES failed in revoke (4)"}, + {336068723, "CREATE VIEW failed"}, + {336068724, " attempt to index BLOB column in INDEX {0}"}, + {336068725, " attempt to index array column in index {0}"}, + {336068726, "key size too big for index {0}"}, + {336068727, "no keys for index {0}"}, + {336068728, "Unknown columns in index {0}"}, + {336068729, "STORE RDB$RELATION_CONSTRAINTS failed"}, + {336068730, "STORE RDB$CHECK_CONSTRAINTS failed"}, + {336068731, "Column: {0} not defined as NOT NULL - cannot be used in PRIMARY KEY constraint definition"}, + {336068732, "A column name is repeated in the definition of constraint: {0}"}, + {336068733, "Integrity Constraint lookup failed"}, + {336068734, "Same set of columns cannot be used in more than one PRIMARY KEY and/or UNIQUE constraint definition"}, + {336068735, "STORE RDB$REF_CONSTRAINTS failed"}, + {336068736, "No table specified in delete_constraint"}, + {336068737, "ERASE RDB$RELATION_CONSTRAINTS failed"}, + {336068738, "CONSTRAINT {0} does not exist."}, + {336068739, "Generation of constraint name failed"}, {336068740, "Table {0} already exists"}, /* dyn_dup_table */ + {336068741, "Number of referencing columns do not equal number of referenced columns"}, + {336068742, "STORE RDB$PROCEDURES failed"}, + {336068743, "Procedure {0} already exists"}, /* dyn_dup_procedure */ + {336068744, "STORE RDB$PROCEDURE_PARAMETERS failed"}, + {336068745, "Store into system table {0} failed"}, + {336068746, "ERASE RDB$PROCEDURE_PARAMETERS failed"}, + {336068747, "ERASE RDB$PROCEDURES failed"}, {336068748, "Procedure {0} not found"}, /* dyn_proc_not_found */ + {336068749, "MODIFY RDB$PROCEDURES failed"}, + {336068750, "DEFINE EXCEPTION failed"}, + {336068751, "ERASE EXCEPTION failed"}, {336068752, "Exception not found"}, /* dyn_exception_not_found */ + {336068753, "MODIFY EXCEPTION failed"}, {336068754, "Parameter {0} in procedure {1} not found"}, /* dyn_proc_param_not_found */ {336068755, "Trigger {0} not found"}, /* dyn_trig_not_found */ + {336068756, "Only one data type change to the domain {0} allowed at a time"}, + {336068757, "Only one data type change to the field {0} allowed at a time"}, + {336068758, "STORE RDB$FILES failed"}, {336068759, "Character set {0} not found"}, /* dyn_charset_not_found */ {336068760, "Collation {0} not found"}, /* dyn_collation_not_found */ + {336068761, "ERASE RDB$LOG_FILES failed"}, + {336068762, "STORE RDB$LOG_FILES failed"}, {336068763, "Role {0} not found"}, /* dyn_role_not_found */ + {336068764, "Difference file lookup failed"}, + {336068765, "DEFINE SHADOW failed"}, + {336068766, "MODIFY RDB$ROLES failed"}, {336068767, "Name longer than database column size"}, /* dyn_name_longer */ + {336068768, "\"Only one constraint allowed for a domain\""}, + {336068770, "Looking up column position failed"}, + {336068771, "A node name is not permitted in a table with external file definition"}, + {336068772, "Shadow lookup failed"}, + {336068773, "Shadow {0} already exists"}, + {336068774, "Cannot add file with the same name as the database or added files"}, + {336068775, "no grant option for privilege {0} on column {1} of table/view {2}"}, + {336068776, "no grant option for privilege {0} on column {1} of base table/view {2}"}, + {336068777, "no grant option for privilege {0} on table/view {1} (for column {2})"}, + {336068778, "no grant option for privilege {0} on base table/view {1} (for column {2})"}, + {336068779, "no {0} privilege with grant option on table/view {1} (for column {2})"}, + {336068780, "no {0} privilege with grant option on base table/view {1} (for column {2})"}, + {336068781, "no grant option for privilege {0} on table/view {1}"}, + {336068782, "no {0} privilege with grant option on table/view {1}"}, + {336068783, "table/view {0} does not exist"}, {336068784, "column {0} does not exist in table/view {1}"}, /* dyn_column_does_not_exist */ + {336068785, "Can not alter a view"}, + {336068786, "EXTERNAL FILE table not supported in this context"}, + {336068787, "attempt to index COMPUTED BY column in INDEX {0}"}, + {336068788, "Table Name lookup failed"}, + {336068789, "attempt to index a view"}, + {336068790, "SELECT RDB$RELATIONS failed in grant"}, + {336068791, "SELECT RDB$RELATION_FIELDS failed in grant"}, + {336068792, "SELECT RDB$RELATIONS/RDB$OWNER_NAME failed in grant"}, + {336068793, "SELECT RDB$USER_PRIVILEGES failed in grant"}, + {336068794, "SELECT RDB$VIEW_RELATIONS/RDB$RELATION_FIELDS/... failed in grant"}, + {336068795, "column {0} from table {1} is referenced in index {2}"}, {336068796, "SQL role {0} does not exist"}, /* dyn_role_does_not_exist */ {336068797, "user {0} has no grant admin option on SQL role {1}"}, /* dyn_no_grant_admin_opt */ {336068798, "user {0} is not a member of SQL role {1}"}, /* dyn_user_not_role_member */ @@ -1080,24 +1371,51 @@ internal static class IscErrorMessages {336068816, "New size specified for column {0} must be at least {1} characters."}, /* dyn_char_fld_too_small */ {336068817, "Cannot change datatype for {0}. Conversion from base type {1} to {2} is not supported."}, /* dyn_invalid_dtype_conversion */ {336068818, "Cannot change datatype for column {0} from a character type to a non-character type."}, /* dyn_dtype_conv_invalid */ + {336068819, "unable to allocate memory from the operating system"}, /* dyn_virmemexh */ {336068820, "Zero length identifiers are not allowed"}, /* dyn_zero_len_id */ + {336068821, "ERASE RDB$GENERATORS failed"}, /* del_gen_fail */ {336068822, "Sequence {0} not found"}, /* dyn_gen_not_found */ + {336068823, "Difference file is not defined"}, + {336068824, "Difference file is already defined"}, + {336068825, "Database is already in the physical backup mode"}, + {336068826, "Database is not in the physical backup mode"}, + {336068827, "DEFINE COLLATION failed"}, + {336068828, "CREATE COLLATION statement is not supported in older versions of the database. A backup and restore is required."}, {336068829, "Maximum number of collations per character set exceeded"}, /* max_coll_per_charset */ {336068830, "Invalid collation attributes"}, /* invalid_coll_attr */ + {336068831, "Collation {0} not installed for character set {1}"}, + {336068832, "Cannot use the internal domain {0} as new type for field {1}"}, + {336068833, "Default value is not allowed for array type in field {0}"}, + {336068834, "Default value is not allowed for array type in domain {0}"}, + {336068835, "DYN_UTIL_is_array failed for domain {0}"}, + {336068836, "DYN_UTIL_copy_domain failed for domain {0}"}, + {336068837, "Local column {0} doesn't have a default"}, + {336068838, "Local column {0} default belongs to domain {1}"}, + {336068839, "File name is invalid"}, {336068840, "{0} cannot reference {1}"}, /* dyn_wrong_gtt_scope */ + {336068841, "Local column {0} is computed, cannot set a default value"}, + {336068842, "ERASE RDB$COLLATIONS failed"}, /* del_coll_fail */ {336068843, "Collation {0} is used in table {1} (field name {2}) and cannot be dropped"}, /* dyn_coll_used_table */ {336068844, "Collation {0} is used in domain {1} and cannot be dropped"}, /* dyn_coll_used_domain */ {336068845, "Cannot delete system collation"}, /* dyn_cannot_del_syscoll */ {336068846, "Cannot delete default collation of CHARACTER SET {0}"}, /* dyn_cannot_del_def_coll */ + {336068847, "Domain {0} is used in procedure {1} (parameter name {2}) and cannot be dropped"}, + {336068848, "Field {0} cannot be used twice in index {1}"}, {336068849, "Table {0} not found"}, /* dyn_table_not_found */ + {336068850, "attempt to reference a view ({0}) in a foreign key"}, {336068851, "Collation {0} is used in procedure {1} (parameter name {2}) and cannot be dropped"}, /* dyn_coll_used_procedure */ {336068852, "New scale specified for column {0} must be at most {1}."}, /* dyn_scale_too_big */ {336068853, "New precision specified for column {0} must be at least {1}."}, /* dyn_precision_too_small */ + {336068854, "{0} is not grantor of {1} on {2} to {3}."}, {336068855, "Warning: {0} on {1} is not granted to {2}."}, /* dyn_miss_priv_warning */ {336068856, "Feature '{0}' is not supported in ODS {1}.{2}"}, /* dyn_ods_not_supp_feature */ {336068857, "Cannot add or remove COMPUTED from column {0}"}, /* dyn_cannot_addrem_computed */ {336068858, "Password should not be empty string"}, /* dyn_no_empty_pw */ {336068859, "Index {0} already exists"}, /* dyn_dup_index */ + {336068860, "Only {0} or user with privilege USE_GRANTED_BY_CLAUSE can use GRANTED BY clause"}, /* dyn_locksmith_use_granted */ + {336068861, "Exception {0} already exists"}, /* dyn_dup_exception */ + {336068862, "Sequence {0} already exists"}, /* dyn_dup_generator */ + {336068863, "ERASE RDB$USER_PRIVILEGES failed in REVOKE ALL ON ALL"}, {336068864, "Package {0} not found"}, /* dyn_package_not_found */ {336068865, "Schema {0} not found"}, /* dyn_schema_not_found */ {336068866, "Cannot ALTER or DROP system procedure {0}"}, /* dyn_cannot_mod_sysproc */ @@ -1110,22 +1428,37 @@ internal static class IscErrorMessages {336068873, "Function {0} has a signature mismatch on package body {1}"}, /* dyn_funcsignat_package */ {336068874, "Procedure {0} has a signature mismatch on package body {1}"}, /* dyn_procsignat_package */ {336068875, "Default values for parameters are not allowed in the definition of a previously declared packaged procedure {0}.{1}"}, /* dyn_defvaldecl_package_proc */ + {336068876, "Function {0} already exists"}, /* dyn_dup_function */ {336068877, "Package body {0} already exists"}, /* dyn_package_body_exists */ {336068878, "Invalid DDL statement for function {0}"}, /* dyn_invalid_ddl_func */ {336068879, "Cannot alter new style function {0} with ALTER EXTERNAL FUNCTION. Use ALTER FUNCTION instead."}, /* dyn_newfc_oldsyntax */ + {336068880, "Cannot delete system generator {0}"}, + {336068881, "Identity column {0} of table {1} must be of exact number type with zero scale"}, + {336068882, "Identity column {0} of table {1} cannot be changed to NULLable"}, + {336068883, "Identity column {0} of table {1} cannot have default value"}, + {336068884, "Domain {0} must be of exact number type with zero scale because it's used in an identity column"}, + {336068885, "Generation of generator name failed"}, {336068886, "Parameter {0} in function {1} not found"}, /* dyn_func_param_not_found */ {336068887, "Parameter {0} of routine {1} not found"}, /* dyn_routine_param_not_found */ {336068888, "Parameter {0} of routine {1} is ambiguous (found in both procedures and functions). Use a specifier keyword."}, /* dyn_routine_param_ambiguous */ {336068889, "Collation {0} is used in function {1} (parameter name {2}) and cannot be dropped"}, /* dyn_coll_used_function */ {336068890, "Domain {0} is used in function {1} (parameter name {2}) and cannot be dropped"}, /* dyn_domain_used_function */ {336068891, "ALTER USER requires at least one clause to be specified"}, /* dyn_alter_user_no_clause */ + {336068892, "Cannot delete system SQL role {0}"}, + {336068893, "Column {0} is not an identity column"}, {336068894, "Duplicate {0} {1}"}, /* dyn_duplicate_package_item */ {336068895, "System {0} {1} cannot be modified"}, /* dyn_cant_modify_sysobj */ {336068896, "INCREMENT BY 0 is an illegal option for sequence {0}"}, /* dyn_cant_use_zero_increment */ {336068897, "Can't use {0} in FOREIGN KEY constraint"}, /* dyn_cant_use_in_foreignkey */ {336068898, "Default values for parameters are not allowed in the definition of a previously declared packaged function {0}.{1}"}, /* dyn_defvaldecl_package_func */ + {336068899, "Password must be specified when creating user"}, /* dyn_create_user_no_password */ {336068900, "role {0} can not be granted to role {1}"}, /* dyn_cyclic_role */ + {336068901, "DROP SYSTEM PRIVILEGES should not be used in CREATE ROLE operator"}, + {336068902, "Access to SYSTEM PRIVILEGES in ROLES denied to {0}"}, + {336068903, "Only {0}, DB owner {1} or user with privilege USE_GRANTED_BY_CLAUSE can use GRANTED BY clause"}, {336068904, "INCREMENT BY 0 is an illegal option for identity column {0} of table {1}"}, /* dyn_cant_use_zero_inc_ident */ + {336068905, "Concurrent ALTER DATABASE is not supported"}, /* dyn_concur_alter_database */ + {336068906, "Incompatible ALTER DATABASE clauses: '{0}' and '{1}'"}, /* dyn_incompat_alter_database */ {336068907, "no {0} privilege with grant option on DDL {1}"}, /* dyn_no_ddl_grant_opt_priv */ {336068908, "no {0} privilege with grant option on object {1}"}, /* dyn_no_grant_opt_priv */ {336068909, "Function {0} does not exist"}, /* dyn_func_not_exist */ @@ -1137,6 +1470,7 @@ internal static class IscErrorMessages {336068915, "Exception {0} does not exist"}, /* dyn_exc_not_exist */ {336068916, "Generator/Sequence {0} does not exist"}, /* dyn_gen_not_exist */ {336068917, "Field {0} of table {1} does not exist"}, /* dyn_fld_not_exist */ + {336330752, "could not locate appropriate error message"}, {336330753, "found unknown switch"}, /* gbak_unknown_switch */ {336330754, "page size parameter missing"}, /* gbak_page_size_missing */ {336330755, "Page size specified ({0}) greater than limit (32768 bytes)"}, /* gbak_page_size_toobig */ @@ -1152,6 +1486,10 @@ internal static class IscErrorMessages {336330765, "REPLACE specified, but the first file {0} is a database"}, /* gbak_db_specified */ {336330766, "database {0} already exists. To replace it, use the -REP switch"}, /* gbak_db_exists */ {336330767, "device type not specified"}, /* gbak_unk_device */ + {336330768, "cannot create APOLLO tape descriptor file {0}"}, + {336330769, "cannot set APOLLO tape descriptor attribute for {0}"}, + {336330770, "cannot create APOLLO cartridge descriptor file {0}"}, + {336330771, "cannot close APOLLO tape descriptor file {0}"}, {336330772, "gds_$blob_info failed"}, /* gbak_blob_info_failed */ {336330773, "do not understand BLOB INFO item {0}"}, /* gbak_unk_blob_item */ {336330774, "gds_$get_segment failed"}, /* gbak_get_seg_failed */ @@ -1185,27 +1523,212 @@ internal static class IscErrorMessages {336330802, "unexpected end of file on backup file"}, /* gbak_unexp_eof */ {336330803, "database format {0} is too old to restore to"}, /* gbak_db_format_too_old */ {336330804, "array dimension for column {0} is invalid"}, /* gbak_inv_array_dim */ + {336330805, "expected array version number {0} but instead found {1}"}, + {336330806, "expected array dimension {0} but instead found {1}"}, {336330807, "Expected XDR record length"}, /* gbak_xdr_len_expected */ + {336330808, "Unexpected I/O error while {0} backup file"}, + {336330809, "adding file {0}, starting at page {1}"}, + {336330810, "array"}, + {336330811, "backup"}, + {336330812, " {0}B(ACKUP_DATABASE) backup database to file"}, + {336330813, "\t\tbackup file is compressed"}, + {336330814, " {0}D(EVICE) backup file device type on APOLLO (CT or MT)"}, + {336330815, " {0}M(ETA_DATA) backup or restore metadata only"}, + {336330816, "blob"}, {336330817, "cannot open backup file {0}"}, /* gbak_open_bkup_error */ {336330818, "cannot open status and error output file {0}"}, /* gbak_open_error */ + {336330819, "closing file, committing, and finishing"}, + {336330820, "committing metadata"}, + {336330821, "commit failed on table {0}"}, + {336330822, "committing secondary files"}, + {336330823, "creating index {0}"}, + {336330824, "committing data for table {0}"}, + {336330825, " {0}C(REATE_DATABASE) create database from backup file (restore)"}, + {336330826, "created database {0}, page_size {1} bytes"}, + {336330827, "creating file {0}"}, + {336330828, "creating indexes"}, + {336330829, "database {0} has a page size of {1} bytes."}, + {336330830, " {0}I(NACTIVE) deactivate indexes during restore"}, + {336330831, "do not understand BLOB INFO item {0}"}, + {336330832, "do not recognize {0} attribute {1} -- continuing"}, + {336330833, "error accessing BLOB column {0} -- continuing"}, + {336330834, "Exiting before completion due to errors"}, + {336330835, "Exiting before completion due to errors"}, + {336330836, "column"}, + {336330837, "file"}, + {336330838, "file length"}, + {336330839, "filter"}, + {336330840, "finishing, closing, and going home"}, + {336330841, "function"}, + {336330842, "function argument"}, + {336330843, "gbak version {0}"}, + {336330844, "domain"}, + {336330845, "index"}, + {336330846, "trigger {0} is invalid"}, + {336330847, "legal switches are:"}, + {336330848, "length given for initial file ({0}) is less than minimum ({1})"}, + {336330849, " {0}E(XPAND) no data compression"}, + {336330850, " {0}L(IMBO) ignore transactions in limbo"}, + {336330851, " {0}O(NE_AT_A_TIME) restore one table at a time"}, + {336330852, "opened file {0}"}, + {336330853, " {0}P(AGE_SIZE) override default page size"}, + {336330854, "page size"}, + {336330855, "page size specified ({0} bytes) rounded up to {1} bytes"}, + {336330856, " {0}Z print version number"}, + {336330857, "privilege"}, + {336330858, " {0} records ignored"}, + {336330859, " {0} records restored"}, + {336330860, "{0} records written"}, + {336330861, " {0}Y redirect/suppress status message output"}, + {336330862, "Reducing the database page size from {0} bytes to {1} bytes"}, + {336330863, "table"}, + {336330864, " {0}REP(LACE_DATABASE) replace database from backup file (restore)"}, + {336330865, " {0}V(ERIFY) report each action taken"}, + {336330866, "restore failed for record in table {0}"}, + {336330867, " restoring column {0}"}, + {336330868, " restoring file {0}"}, + {336330869, " restoring filter {0}"}, + {336330870, "restoring function {0}"}, + {336330871, " restoring argument for function {0}"}, + {336330872, " restoring gen id value of: {0}"}, + {336330873, "restoring domain {0}"}, + {336330874, " restoring index {0}"}, + {336330875, " restoring privilege for user {0}"}, + {336330876, "restoring data for table {0}"}, + {336330877, "restoring security class {0}"}, + {336330878, " restoring trigger {0}"}, + {336330879, " restoring trigger message for {0}"}, + {336330880, " restoring type {0} for column {1}"}, + {336330881, "started transaction"}, + {336330882, "starting transaction"}, + {336330883, "security class"}, + {336330884, "switches can be abbreviated to the unparenthesized characters"}, + {336330885, "transportable backup -- data in XDR format"}, + {336330886, "trigger"}, + {336330887, "trigger message"}, + {336330888, "trigger type"}, + {336330889, "unknown switch \"{0}\""}, + {336330890, "validation error on column in table {0}"}, + {336330891, " Version(s) for database \"{0}\""}, + {336330892, "view"}, + {336330893, " writing argument for function {0}"}, + {336330894, " writing data for table {0}"}, + {336330895, " writing gen id of: {0}"}, + {336330896, " writing column {0}"}, + {336330897, " writing filter {0}"}, + {336330898, "writing filters"}, + {336330899, " writing function {0}"}, + {336330900, "writing functions"}, + {336330901, " writing domain {0}"}, + {336330902, "writing domains"}, + {336330903, " writing index {0}"}, + {336330904, " writing privilege for user {0}"}, + {336330905, " writing table {0}"}, + {336330906, "writing tables"}, + {336330907, " writing security class {0}"}, + {336330908, " writing trigger {0}"}, + {336330909, " writing trigger message for {0}"}, + {336330910, "writing trigger messages"}, + {336330911, "writing triggers"}, + {336330912, " writing type {0} for column {1}"}, + {336330913, "writing types"}, + {336330914, "writing shadow files"}, + {336330915, " writing shadow file {0}"}, + {336330916, "writing id generators"}, + {336330917, " writing generator {0} value {1}"}, + {336330918, "readied database {0} for backup"}, + {336330919, "restoring table {0}"}, + {336330920, "type"}, + {336330921, "gbak:"}, + {336330922, "committing metadata for table {0}"}, + {336330923, "error committing metadata for table {0}"}, + {336330924, " {0}K(ILL) restore without creating shadows"}, + {336330925, "cannot commit index {0}"}, + {336330926, "cannot commit files"}, + {336330927, " {0}T(RANSPORTABLE) transportable backup -- data in XDR format"}, + {336330928, "closing file, committing, and finishing. {0} bytes written"}, + {336330929, " {0}G(ARBAGE_COLLECT) inhibit garbage collection"}, + {336330930, " {0}IG(NORE) ignore bad checksums"}, + {336330931, "\tcolumn {0} used in index {1} seems to have vanished"}, + {336330932, "index {0} omitted because {1} of the expected {2} keys were found"}, + {336330933, " {0}FA(CTOR) blocking factor"}, {336330934, "blocking factor parameter missing"}, /* gbak_missing_block_fac */ {336330935, "expected blocking factor, encountered \"{0}\""}, /* gbak_inv_block_fac */ {336330936, "a blocking factor may not be used in conjunction with device CT"}, /* gbak_block_fac_specified */ + {336330937, "restoring generator {0} value: {1}"}, + {336330938, " {0}OL(D_DESCRIPTIONS) save old style metadata descriptions"}, + {336330939, " {0}N(O_VALIDITY) do not restore database validity conditions"}, {336330940, "user name parameter missing"}, /* gbak_missing_username */ {336330941, "password parameter missing"}, /* gbak_missing_password */ + {336330942, " {0}PAS(SWORD) Firebird password"}, + {336330943, " {0}USER Firebird user name"}, + {336330944, "writing stored procedures"}, + {336330945, "writing stored procedure {0}"}, + {336330946, "writing parameter {0} for stored procedure"}, + {336330947, "restoring stored procedure {0}"}, + {336330948, " restoring parameter {0} for stored procedure"}, + {336330949, "writing exceptions"}, + {336330950, "writing exception {0}"}, + {336330951, "restoring exception {0}"}, {336330952, " missing parameter for the number of bytes to be skipped"}, /* gbak_missing_skipped_bytes */ {336330953, "expected number of bytes to be skipped, encountered \"{0}\""}, /* gbak_inv_skipped_bytes */ + {336330954, "adjusting an invalid decompression length from {0} to {1}"}, + {336330955, "skipped {0} bytes after reading a bad attribute {1}"}, + {336330956, " {0}S(KIP_BAD_DATA) skip number of bytes after reading bad data"}, + {336330957, "skipped {0} bytes looking for next valid attribute, encountered attribute {1}"}, + {336330958, "writing table constraints"}, + {336330959, "writing constraint {0}"}, + {336330960, "table constraint"}, + {336330961, "writing referential constraints"}, + {336330962, "writing check constraints"}, + {336330963, "writing character sets"}, /* msgVerbose_write_charsets */ + {336330964, "writing collations"}, /* msgVerbose_write_collations */ {336330965, "character set"}, /* gbak_err_restore_charset */ + {336330966, "writing character set {0}"}, /* msgVerbose_restore_charset */ {336330967, "collation"}, /* gbak_err_restore_collation */ + {336330968, "writing collation {0}"}, /* msgVerbose_restore_collation */ {336330972, "Unexpected I/O error while reading from backup file"}, /* gbak_read_error */ {336330973, "Unexpected I/O error while writing to backup file"}, /* gbak_write_error */ + {336330974, "\n\nCould not open file name \"{0}\""}, + {336330975, "\n\nCould not write to file \"{0}\""}, + {336330976, "\n\nCould not read from file \"{0}\""}, + {336330977, "Done with volume #{0}, \"{1}\""}, + {336330978, "\tPress return to reopen that file, or type a new\n\tname followed by return to open a different file."}, + {336330979, "Type a file name to open and hit return"}, + {336330980, " Name: "}, + {336330981, "\n\nERROR: Backup incomplete"}, + {336330982, "Expected backup start time {0}, found {1}"}, + {336330983, "Expected backup database {0}, found {1}"}, + {336330984, "Expected volume number {0}, found volume {1}"}, {336330985, "could not drop database {0} (no privilege or database might be in use)"}, /* gbak_db_in_use */ + {336330986, "Skipped bad security class entry: {0}"}, + {336330987, "Unknown V3 SUB_TYPE: {0} in FIELD: {1}."}, + {336330988, "Converted V3 sub_type: {0} to character_set_id: {1} and collate_id: {2}."}, + {336330989, "Converted V3 scale: {0} to character_set_id: {1} and callate_id: {2}."}, {336330990, "System memory exhausted"}, /* gbak_sysmemex */ + {336330991, " {0}NT Non-Transportable backup file format"}, + {336330992, "Index \"{0}\" failed to activate because:"}, + {336330993, " The unique index has duplicate values or NULLs."}, + {336330994, " Delete or Update duplicate values or NULLs, and activate index with"}, + {336330995, " ALTER INDEX \"{0}\" ACTIVE;"}, + {336330996, " Not enough disk space to create the sort file for an index."}, + {336330997, " Set the TMP environment variable to a directory on a filesystem that does have enough space, and activate index with"}, + {336330998, "Database is not online due to failure to activate one or more indices."}, + {336330999, "Run gfix -online to bring database online without active indices."}, + {336331000, "writing SQL roles"}, /* write_role_1 */ + {336331001, " writing SQL role: {0}"}, /* write_role_2 */ {336331002, "SQL role"}, /* gbak_restore_role_failed */ + {336331003, " restoring SQL role: {0}"}, /* restore_role */ + {336331004, " {0}RO(LE) Firebird SQL role"}, /* gbak_role_op */ {336331005, "SQL role parameter missing"}, /* gbak_role_op_missing */ + {336331006, " {0}CO(NVERT) backup external files as tables"}, /* gbak_convert_ext_tables */ + {336331007, "gbak: WARNING:"}, /* gbak_warning */ + {336331008, "gbak: ERROR:"}, /* gbak_error */ + {336331009, " {0}BU(FFERS) override page buffers default"}, /* gbak_page_buffers */ {336331010, "page buffers parameter missing"}, /* gbak_page_buffers_missing */ {336331011, "expected page buffers, encountered \"{0}\""}, /* gbak_page_buffers_wrong_param */ {336331012, "page buffers is allowed only on restore or create"}, /* gbak_page_buffers_restore */ + {336331013, "Starting with volume #{0}, \"{1}\""}, {336331014, "size specification either missing or incorrect for file {0}"}, /* gbak_inv_size */ {336331015, "file {0} out of sequence"}, /* gbak_file_outof_sequence */ {336331016, "can't join -- one of the files missing"}, /* gbak_join_file_missing */ @@ -1216,25 +1739,300 @@ internal static class IscErrorMessages {336331021, "can't write a header record to file {0}"}, /* gbak_hdr_write_failed */ {336331022, "free disk space exhausted"}, /* gbak_disk_space_ex */ {336331023, "file size given ({0}) is less than minimum allowed ({1})"}, /* gbak_size_lt_min */ + {336331024, "Warning -- free disk space exhausted for file {0}, the rest of the bytes ({1}) will be written to file {2}"}, {336331025, "service name parameter missing"}, /* gbak_svc_name_missing */ {336331026, "Cannot restore over current database, must be SYSDBA or owner of the existing database."}, /* gbak_not_ownr */ + {336331027, ""}, + {336331028, " {0}USE_(ALL_SPACE) do not reserve space for record versions"}, + {336331029, " {0}SE(RVICE) use services manager"}, + {336331030, " {0}MO(DE) \"read_only\" or \"read_write\" access"}, /* gbak_opt_mode */ {336331031, "\"read_only\" or \"read_write\" required"}, /* gbak_mode_req */ + {336331032, "setting database to read-only access"}, {336331033, "just data ignore all constraints etc."}, /* gbak_just_data */ {336331034, "restoring data only ignoring foreign key, unique, not null & other constraints"}, /* gbak_data_only */ + {336331035, "closing file, committing, and finishing. {0} bytes written"}, + {336331036, " {0}R(ECREATE_DATABASE) [O(VERWRITE)] create (or replace if OVERWRITE used)\\n\t\t\t\tdatabase from backup file (restore)"}, + {336331037, " activating and creating deferred index {0}"}, /* gbak_activating_idx */ + {336331038, "check constraint"}, + {336331039, "exception"}, + {336331040, "array dimensions"}, + {336331041, "generator"}, + {336331042, "procedure"}, + {336331043, "procedure parameter"}, + {336331044, "referential constraint"}, + {336331045, "type (in RDB$TYPES)"}, + {336331046, " {0}NOD(BTRIGGERS) do not run database triggers"}, + {336331047, " {0}TRU(STED) use trusted authentication"}, + {336331048, "writing names mapping"}, /* write_map_1 */ + {336331049, " writing map for {0}"}, /* write_map_2 */ + {336331050, " restoring map for {0}"}, /* get_map_1 */ + {336331051, "name mapping"}, /* get_map_2 */ + {336331052, "cannot restore arbitrary mapping"}, /* get_map_3 */ + {336331053, "restoring names mapping"}, /* get_map_4 */ + {336331054, " {0}FIX_FSS_D(ATA) fix malformed UNICODE_FSS data"}, + {336331055, " {0}FIX_FSS_M(ETADATA) fix malformed UNICODE_FSS metadata"}, + {336331056, "Character set parameter missing"}, + {336331057, "Character set {0} not found"}, + {336331058, " {0}FE(TCH_PASSWORD) fetch password from file"}, + {336331059, "too many passwords provided"}, + {336331060, "could not open password file {0}, errno {1}"}, + {336331061, "could not read password file {0}, errno {1}"}, + {336331062, "empty password file {0}"}, + {336331063, "Attribute {0} was already processed for exception {1}"}, + {336331064, "Skipping attribute {0} because the message already exists for exception {1}"}, + {336331065, "Trying to recover from unexpected attribute {0} due to wrong message length for exception {1}"}, + {336331066, "Attribute not specified for storing text bigger than 255 bytes"}, + {336331067, "Unable to store text bigger than 65536 bytes"}, + {336331068, "Failed while adjusting the security class name"}, + {336331069, "Usage:"}, + {336331070, " gbak -b [backup options] [general options]"}, + {336331071, " gbak -c [restore options] [general options]"}, + {336331072, " = | ... (size in db pages)"}, + {336331073, " = | ... (size in bytes = n[K|M|G])"}, + {336331074, " -recreate overwrite and -replace can be used instead of -c"}, + {336331075, "backup options are:"}, + {336331076, "restore options are:"}, + {336331077, "general options are:"}, {336331078, "verbose interval value parameter missing"}, /* gbak_missing_interval */ {336331079, "verbose interval value cannot be smaller than {0}"}, /* gbak_wrong_interval */ + {336331080, " {0}VERBI(NT) verbose information with explicit interval"}, {336331081, "verify (verbose) and verbint options are mutually exclusive"}, /* gbak_verify_verbint */ {336331082, "option -{0} is allowed only on restore or create"}, /* gbak_option_only_restore */ {336331083, "option -{0} is allowed only on backup"}, /* gbak_option_only_backup */ {336331084, "options -{0} and -{1} are mutually exclusive"}, /* gbak_option_conflict */ {336331085, "parameter for option -{0} was already specified with value \"{1}\""}, /* gbak_param_conflict */ {336331086, "option -{0} was already specified"}, /* gbak_option_repeated */ + {336331087, "writing package {0}"}, + {336331088, "writing packages"}, + {336331089, "restoring package {0}"}, + {336331090, "package"}, {336331091, "dependency depth greater than {0} for view {1}"}, /* gbak_max_dbkey_recursion */ {336331092, "value greater than {0} when calculating length of rdb$db_key for view {1}"}, /* gbak_max_dbkey_length */ {336331093, "Invalid metadata detected. Use -FIX_FSS_METADATA option."}, /* gbak_invalid_metadata */ {336331094, "Invalid data detected. Use -FIX_FSS_DATA option."}, /* gbak_invalid_data */ + {336331095, "text for attribute {0} is too large in {1}, truncating to {2} bytes"}, {336331096, "Expected backup version {1}..{2}. Found {0}"}, /* gbak_inv_bkup_ver2 */ + {336331097, " writing view {0}"}, + {336331098, " table {0} is a view"}, + {336331099, "writing security classes"}, {336331100, "database format {0} is too old to backup"}, /* gbak_db_format_too_old2 */ + {336331101, "backup version is {0}"}, + {336331102, "adjusting system generators"}, + {336331103, "Error closing database, but backup file is OK"}, + {336331104, "database"}, + {336331105, "required mapping attributes are missing in backup file"}, + {336331106, "missing regular expression to skip tables"}, + {336331107, " {0}SKIP_D(ATA) skip data for table"}, + {336331108, "regular expression to skip tables was already set"}, + {336331109, "adjusting views dbkey length"}, + {336331110, "updating ownership of packages, procedures and tables"}, + {336331111, "adding missing privileges"}, + {336331112, "adjusting the ONLINE and FORCED WRITES flags"}, + {336331113, " {0}ST(ATISTICS) TDRW show statistics:"}, + {336331114, " T time from start"}, + {336331115, " D delta time"}, + {336331116, " R page reads"}, + {336331117, " W page writes"}, + {336331118, "statistics parameter missing"}, /* gbak_missing_perf */ + {336331119, "wrong char \"{0}\" at statistics parameter"}, /* gbak_wrong_perf */ + {336331120, "too many chars at statistics parameter"}, /* gbak_too_long_perf */ + {336331121, "total statistics"}, + {336331122, "could not append BLOB data to batch"}, + {336331123, "could not start batch when restoring table {0}, trying old way"}, + {336331124, " {0}KEYNAME name of a key to be used for encryption"}, + {336331125, " {0}CRYPT crypt plugin name"}, + {336331126, " {0}ZIP backup file is in zip compressed format"}, + {336331127, "Keyname parameter missing"}, + {336331128, "Key holder parameter missing but backup file is encrypted"}, + {336331129, "CryptPlugin parameter missing"}, + {336331130, "Unknown crypt plugin name - use -CRYPT switch"}, + {336331131, "Inflate error {0}"}, + {336331132, "Deflate error {0}"}, + {336331133, "Key holder parameter missing"}, + {336331134, " {0}KEYHOLDER name of a key holder plugin"}, + {336331135, "Decompression stream init error {0}"}, + {336331136, "Compression stream init error {0}"}, + {336331137, "Invalid reply from getInfo() when waiting for DB encryption"}, + {336331138, "Problems with just created database encryption"}, + {336331139, "Skipped trigger {0} on system table {1}"}, + {336331140, " {0}INCLUDE(_DATA) backup data of table(s)"}, + {336331141, "missing regular expression to include tables"}, + {336331142, "regular expression to include tables was already set"}, + {336331143, "writing database create grants"}, + {336331144, " database create grant for {0}"}, + {336331145, " restoring database create grant for {0}"}, + {336331146, "restoring database create grants"}, + {336331147, "database create grant"}, + {336331148, "writing publications"}, + {336331149, " writing publication {0}"}, + {336331150, " writing publication for table {0}"}, + {336331151, "restoring publication {0}"}, + {336331152, "publication"}, + {336331153, "restoring publication for table {0}"}, + {336331154, "publication for table"}, + {336331155, " {0}REPLICA \"none\", \"read_only\" or \"read_write\" replica mode"}, /* gbak_opt_replica */ + {336331156, "\"none\", \"read_only\" or \"read_write\" required"}, /* gbak_replica_req */ + {336331157, "could not access batch parameters"}, + {336331158, " {0}PAR(ALLEL) parallel workers"}, + {336331159, "parallel workers parameter missing"}, /* gbak_missing_prl_wrks */ + {336331160, "expected parallel workers, encountered \"{0}\""}, /* gbak_inv_prl_wrks */ + {336331161, " {0}D(IRECT_IO) direct IO for backup file(s)"}, + {336331162, "use up to {0} parallel workers"}, + {336396289, "Firebird error"}, + {336396362, "Rollback not performed"}, + {336396364, "Connection error"}, + {336396365, "Connection not established"}, + {336396366, "Connection authorization failure."}, + {336396375, "deadlock"}, + {336396376, "Unsuccessful execution caused by deadlock."}, + {336396377, "record from transaction {0} is stuck in limbo"}, + {336396379, "operation completed with errors"}, + {336396382, "the SQL statement cannot be executed"}, + {336396384, "Unsuccessful execution caused by an unavailable resource."}, + {336396386, "Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements"}, + {336396387, "Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements"}, + {336396446, "Wrong numeric type"}, + {336396447, "too many versions"}, + {336396448, "intermediate journal file full"}, + {336396449, "journal file wrong format"}, + {336396450, "database {0} shutdown in {1} seconds"}, + {336396451, "restart shared cache manager"}, + {336396452, "exception {0}"}, + {336396453, "bad checksum"}, + {336396454, "refresh range number {0} not found"}, + {336396455, "expression evaluation not supported"}, + {336396456, "FOREIGN KEY column count does not match PRIMARY KEY"}, + {336396457, "Attempt to define a second PRIMARY KEY for the same table"}, + {336396458, "column used with aggregate"}, + {336396459, "invalid column reference"}, + {336396460, "invalid key position"}, + {336396461, "invalid direction for find operation"}, + {336396462, "Invalid statement handle"}, + {336396463, "invalid lock handle"}, + {336396464, "invalid lock level {0}"}, + {336396465, "invalid bookmark handle"}, + {336396468, "wrong or obsolete version"}, + {336396471, "The INSERT, UPDATE, DELETE, DDL or authorization statement cannot be executed because the transaction is inquiry only"}, + {336396472, "external file could not be opened for output"}, + {336396477, "multiple rows in singleton select"}, + {336396478, "No subqueries permitted for VIEW WITH CHECK OPTION"}, + {336396479, "DISTINCT, GROUP or HAVING not permitted for VIEW WITH CHECK OPTION"}, + {336396480, "Only one table allowed for VIEW WITH CHECK OPTION"}, + {336396481, "No WHERE clause for VIEW WITH CHECK OPTION"}, + {336396482, "Only simple column names permitted for VIEW WITH CHECK OPTION"}, + {336396484, "An error was found in the application program input parameters for the SQL statement."}, + {336396485, "Invalid insert or update value(s): object columns are constrained - no 2 table rows can have duplicate column values"}, + {336396486, "Arithmetic overflow or division by zero has occurred."}, + {336396594, "cannot access column {0} in view {1}"}, + {336396595, "Too many concurrent executions of the same request"}, + {336396596, "maximum indexes per table ({0}) exceeded"}, + {336396597, "new record size of {0} bytes is too big"}, + {336396598, "segments not allowed in expression index {0}"}, + {336396599, "wrong page type"}, + {336396603, "invalid ARRAY or BLOB operation"}, + {336396611, "{0} extension error"}, + {336396624, "key size exceeds implementation restriction for index \"{0}\""}, + {336396625, "definition error for index {0}"}, + {336396628, "cannot create index"}, + {336396651, "duplicate specification of {0} - not supported"}, + {336396663, "The insert failed because a column definition includes validation constraints."}, + {336396670, "Cannot delete object referenced by another object"}, + {336396671, "Cannot modify object referenced by another object"}, + {336396672, "Object is referenced by another object"}, + {336396673, "lock on conflicts with existing lock"}, + {336396681, "This operation is not defined for system tables."}, + {336396683, "Inappropriate self-reference of column"}, + {336396684, "Illegal array dimension range"}, + {336396687, "database or file exists"}, + {336396688, "sort error: corruption in data structure"}, + {336396689, "node not supported"}, + {336396690, "Shadow number must be a positive integer"}, + {336396691, "Preceding file did not specify length, so {0} must include starting page number"}, + {336396692, "illegal operation when at beginning of stream"}, + {336396693, "the current position is on a crack"}, + {336396735, "cannot modify an existing user privilege"}, + {336396736, "user does not have the privilege to perform operation"}, + {336396737, "This user does not have privilege to perform this operation on this object."}, + {336396756, "transaction marked invalid by I/O error"}, + {336396757, "Cannot prepare a CREATE DATABASE/SCHEMA statement"}, + {336396758, "violation of FOREIGN KEY constraint \"{0}\""}, + {336396769, "The prepare statement identifies a prepare statement with an open cursor"}, + {336396770, "Unknown statement or request"}, + {336396778, "Attempt to update non-updatable cursor"}, + {336396780, "The cursor identified in the UPDATE or DELETE statement is not positioned on a row."}, + {336396784, "Unknown cursor"}, + {336396786, "The cursor identified in an OPEN statement is already open."}, + {336396787, "The cursor identified in a FETCH or CLOSE statement is not open."}, + {336396875, "Overflow occurred during data type conversion."}, + {336396881, "null segment of UNIQUE KEY"}, + {336396882, "subscript out of bounds"}, + {336396886, "data operation not supported"}, + {336396887, "invalid comparison operator for find operation"}, + {336396974, "Cannot transliterate character between character sets"}, + {336396975, "count of column list and variable list do not match"}, + {336396985, "Incompatible column/host variable data type"}, + {336396991, "Operation violates CHECK constraint {0} on view or table"}, + {336396992, "internal Firebird consistency check (invalid RDB$CONSTRAINT_TYPE)"}, + {336396993, "Cannot update constraints (RDB$RELATION_CONSTRAINTS)."}, + {336396994, "Cannot delete CHECK constraint entry (RDB$CHECK_CONSTRAINTS)"}, + {336396995, "Cannot update constraints (RDB$CHECK_CONSTRAINTS)."}, + {336396996, "Cannot update constraints (RDB$REF_CONSTRAINTS)."}, + {336396997, "Column used in a PRIMARY constraint must be NOT NULL."}, + {336397004, "index {0} cannot be used in the specified plan"}, + {336397005, "table {0} is referenced in the plan but not the from list"}, + {336397006, "the table {0} is referenced twice; use aliases to differentiate"}, + {336397007, "table {0} is not referenced in plan"}, + {336397027, "Log file specification partition error"}, + {336397028, "Cache or Log redefined"}, + {336397029, "Write-ahead Log with shadowing configuration not allowed"}, + {336397030, "Overflow log specification required for round-robin log"}, + {336397031, "WAL defined; Cache Manager must be started first"}, + {336397033, "Write-ahead Log without shared cache configuration not allowed"}, + {336397034, "Cannot start WAL writer for the database {0}"}, + {336397035, "WAL writer synchronization error for the database {0}"}, + {336397036, "WAL setup error. Please see Firebird log."}, + {336397037, "WAL buffers cannot be increased. Please see Firebird log."}, + {336397038, "WAL writer - Journal server communication error. Please see Firebird log."}, + {336397039, "WAL I/O error. Please see Firebird log."}, + {336397040, "Unable to roll over; please see Firebird log."}, + {336397041, "obsolete"}, + {336397042, "obsolete"}, + {336397043, "obsolete"}, + {336397044, "obsolete"}, + {336397045, "database does not use Write-ahead Log"}, + {336397046, "Cannot roll over to the next log file {0}"}, + {336397047, "obsolete"}, + {336397048, "obsolete"}, + {336397049, "Cache or Log size too small"}, + {336397050, "Log record header too small at offset {0} in log file {1}"}, + {336397051, "Incomplete log record at offset {0} in log file {1}"}, + {336397052, "Unexpected end of log file {0} at offset {1}"}, + {336397053, "Database name in the log file {0} is different"}, + {336397054, "Log file {0} not closed properly; database recovery may be required"}, + {336397055, "Log file {0} not latest in the chain but open flag still set"}, + {336397056, "Invalid version of log file {0}"}, + {336397057, "Log file header of {0} too small"}, + {336397058, "obsolete"}, + {336397069, "table {0} is not defined"}, + {336397080, "invalid ORDER BY clause"}, + {336397082, "Column does not belong to referenced table"}, + {336397083, "column {0} is not defined in table {1}"}, + {336397084, "Undefined name"}, + {336397085, "Ambiguous column reference."}, + {336397116, "function {0} is not defined"}, + {336397117, "Invalid data type, length, or value"}, + {336397118, "Invalid number of arguments"}, + {336397126, "dbkey not available for multi-table views"}, + {336397130, "number of columns does not match select list"}, + {336397131, "must specify column name for view select expression"}, + {336397133, "{0} is not a valid base table of the specified view"}, + {336397137, "This column cannot be updated because it is derived from an SQL function or expression."}, + {336397138, "The object of the INSERT, DELETE or UPDATE statement is a view for which the requested operation is not permitted."}, + {336397183, "Invalid String"}, + {336397184, "Invalid token"}, + {336397185, "Invalid numeric literal"}, + {336397203, "An error occurred while trying to update the security database"}, + {336397204, "non-SQL security class defined"}, {336397205, "ODS versions before ODS{0} are not supported"}, /* dsql_too_old_ods */ {336397206, "Table {0} does not exist"}, /* dsql_table_not_found */ {336397207, "View {0} does not exist"}, /* dsql_view_not_found */ @@ -1365,6 +2163,388 @@ internal static class IscErrorMessages {336397332, "String literal with {0} characters exceeds the maximum length of {1} characters for the {2} character set"}, /* dsql_string_char_length */ {336397333, "Too many BEGIN...END nesting. Maximum level is {0}"}, /* dsql_max_nesting */ {336397334, "RECREATE USER {0} failed"}, /* dsql_recreate_user_failed */ + {336461924, "Row not found for fetch, update or delete, or the result of a query is an empty table."}, + {336461925, "segment buffer length shorter than expected"}, + {336462125, "Datatype needs modification"}, + {336462436, "Duplicate column or domain name found."}, + {336527507, "invalid block type encountered"}, + {336527508, "wrong packet type"}, + {336527509, "cannot map page"}, + {336527510, "request to allocate invalid block type"}, + {336527511, "request to allocate block type larger than maximum size"}, + {336527512, "memory pool free list is invalid"}, + {336527513, "invalid pool id encountered"}, + {336527514, "attempt to release free block"}, + {336527515, "attempt to release block overlapping following free block"}, + {336527516, "attempt to release block overlapping prior free block"}, + {336527517, "cannot sort on a field that does not exist"}, + {336527518, "database file not available"}, + {336527519, "cannot assert logical lock"}, + {336527520, "wrong ACL version"}, + {336527521, "shadow block not found"}, + {336527522, "shadow lock not synchronized properly"}, + {336527523, "root file name not listed for shadow"}, + {336527524, "failed to remove symbol from hash table"}, + {336527525, "cannot find tip page"}, + {336527526, "invalid rsb type"}, + {336527527, "invalid SEND request"}, + {336527528, "looper: action not yet implemented"}, + {336527529, "return data type not supported"}, + {336527530, "unexpected reply from journal server"}, + {336527531, "journal server is incompatible version"}, + {336527532, "journal server refused connection"}, + {336527533, "referenced index description not found"}, + {336527534, "index key too big"}, + {336527535, "partner index description not found"}, + {336527536, "bad difference record"}, + {336527537, "applied differences will not fit in record"}, + {336527538, "record length inconsistent"}, + {336527539, "decompression overran buffer"}, + {336527540, "cannot reposition for update after sort for RMS"}, + {336527541, "external access type not implemented"}, + {336527542, "differences record too long"}, + {336527543, "wrong record length"}, + {336527544, "limbo impossible"}, + {336527545, "wrong record version"}, + {336527546, "record disappeared"}, + {336527547, "cannot delete system tables"}, + {336527548, "cannot update erased record"}, + {336527549, "comparison not supported for specified data types"}, + {336527550, "conversion not supported for specified data types"}, + {336527551, "conversion error"}, + {336527552, "overflow during conversion"}, + {336527553, "null or invalid array"}, + {336527554, "BLOB not found"}, + {336527555, "cannot update old BLOB"}, + {336527556, "relation for array not known"}, + {336527557, "field for array not known"}, + {336527558, "array subscript computation error"}, + {336527559, "expected field node"}, + {336527560, "invalid BLOB ID"}, + {336527561, "cannot find BLOB page"}, + {336527562, "unknown data type"}, + {336527563, "shadow block not found for extend file"}, + {336527564, "index inconsistent"}, + {336527565, "index bucket overfilled"}, + {336527566, "exceeded index level"}, + {336527567, "page already in use"}, + {336527568, "page not accessed for write"}, + {336527569, "attempt to release page not acquired"}, + {336527570, "page in use during flush"}, + {336527571, "attempt to remove page from dirty page list when not there"}, + {336527572, "CCH_precedence: block marked"}, + {336527573, "insufficient cache size"}, + {336527574, "no cache buffers available for reuse"}, + {336527575, "page {0}, page type {1} lock conversion denied"}, + {336527576, "page {0}, page type {1} lock denied"}, + {336527577, "buffer marked for update"}, + {336527578, "CCH: {0}, status = {1} (218)"}, + {336527579, "request of unknown resource"}, + {336527580, "release of unknown resource"}, + {336527581, "(CMP) copy: cannot remap"}, + {336527582, "bad BLR -- invalid stream"}, + {336527583, "argument of scalar operation must be an array"}, + {336527584, "quad word arithmetic not supported"}, + {336527585, "data type not supported for arithmetic"}, + {336527586, "request size limit exceeded"}, + {336527587, "cannot access field {0} in view {1}"}, + {336527588, "cannot access field in view {0}"}, + {336527589, "EVL_assign_to: invalid operation"}, + {336527590, "EVL_bitmap: invalid operation"}, + {336527591, "EVL_boolean: invalid operation"}, + {336527592, "EVL_expr: invalid operation"}, + {336527593, "eval_statistical: invalid operation"}, + {336527594, "Unimplemented conversion, FAO directive O,Z,S"}, + {336527595, "Unimplemented conversion, FAO directive X,U"}, + {336527596, "Error parsing RDB FAO msg string"}, + {336527597, "Error parsing RDB FAO msg str"}, + {336527598, "unknown parameter in RdB status vector"}, + {336527599, "Firebird status vector inconsistent"}, + {336527600, "Firebird/RdB message parameter inconsistency"}, + {336527601, "error parsing RDB FAO message string"}, + {336527602, "unimplemented FAO directive"}, + {336527603, "missing pointer page in DPM_data_pages"}, + {336527604, "Fragment does not exist"}, + {336527605, "pointer page disappeared in DPM_delete"}, + {336527606, "pointer page lost from DPM_delete_relation"}, + {336527607, "missing pointer page in DPM_dump"}, + {336527608, "cannot find record fragment"}, + {336527609, "pointer page vanished from DPM_next"}, + {336527610, "temporary page buffer too small"}, + {336527611, "damaged data page"}, + {336527612, "header fragment length changed"}, + {336527613, "pointer page vanished from extend_relation"}, + {336527614, "pointer page vanished from relation list in locate_space"}, + {336527615, "cannot find free space"}, + {336527616, "pointer page vanished from mark_full"}, + {336527617, "bad record in RDB$PAGES"}, + {336527618, "page slot not empty"}, + {336527619, "bad pointer page"}, + {336527620, "index unexpectedly deleted"}, + {336527621, "scalar operator used on field which is not an array"}, + {336527622, "active"}, + {336527623, "committed"}, + {336527624, "rolled back"}, + {336527625, "in an ill-defined state"}, + {336527626, "next transaction older than oldest active transaction"}, + {336527627, "next transaction older than oldest transaction"}, + {336527628, "buffer marked during cache unwind"}, + {336527629, "error in recovery! database corrupted"}, + {336527630, "error in recovery! wrong data page record"}, + {336527631, "error in recovery! no space on data page"}, + {336527632, "error in recovery! wrong header page record"}, + {336527633, "error in recovery! wrong generator page record"}, + {336527634, "error in recovery! wrong b-tree page record"}, + {336527635, "error in recovery! wrong page inventory page record"}, + {336527636, "error in recovery! wrong pointer page record"}, + {336527637, "error in recovery! wrong index root page record"}, + {336527638, "error in recovery! wrong transaction page record"}, + {336527639, "error in recovery! out of sequence log record encountered"}, + {336527640, "error in recovery! unknown page type"}, + {336527641, "error in recovery! unknown record type"}, + {336527642, "journal server cannot archive to specified archive directory"}, + {336527643, "checksum error in log record when reading from log file"}, + {336527644, "cannot restore singleton select data"}, + {336527645, "lock not found in internal lock manager"}, + {336527646, "size of opt block exceeded"}, + {336527647, "Too many savepoints"}, + {336527648, "garbage collect record disappeared"}, + {336527649, "Unknown BLOB FILTER ACTION_"}, + {336527650, "error during savepoint backout"}, /* savepoint_error */ + {336527651, "cannot find record back version"}, + {336527652, "Illegal user_type."}, + {336527653, "bad ACL"}, + {336527654, "inconsistent LATCH_mark release"}, + {336527655, "inconsistent LATCH_mark call"}, + {336527656, "inconsistent latch downgrade call"}, + {336527657, "bdb is unexpectedly marked"}, + {336527658, "missing exclusive latch"}, + {336527659, "exceeded maximum number of shared latches on a bdb"}, + {336527660, "can't find shared latch"}, + {336527661, "Non-zero use_count of a buffer in the empty que"}, /* cache_non_zero_use_count */ + {336527662, "Unexpected page change from latching"}, /* unexpected_page_change */ + {336527663, "Invalid expression for evaluation"}, + {336527664, "RDB$FLAGS for trigger {0} in RDB$TRIGGERS is corrupted"}, /* rdb$triggers_rdb$flags_corrupt */ + {336527665, "Blobs accounting is inconsistent"}, + {336527666, "Found array data type with more than 16 dimensions"}, + {336658432, "Statement failed, SQLSTATE = {0}"}, /* GEN_ERR */ + {336658433, "usage: isql [options] []"}, /* USAGE */ + {336658434, "Unknown switch: {0}"}, /* SWITCH */ + {336658435, "Use CONNECT or CREATE DATABASE to specify a database"}, /* NO_DB */ + {336658436, "Unable to open {0}"}, /* FILE_OPEN_ERR */ + {336658437, "Commit current transaction (y/n)?"}, /* COMMIT_PROMPT */ + {336658438, "Committing."}, /* COMMIT_MSG */ + {336658439, "Rolling back work."}, /* ROLLBACK_MSG */ + {336658440, "Command error: {0}"}, /* CMD_ERR */ + {336658441, "Enter data or NULL for each column. RETURN to end."}, /* ADD_PROMPT */ + {336658442, "ISQL Version: {0}"}, /* VERSION */ + {336658443, "\t-a(ll) extract metadata incl. legacy non-SQL tables"}, /* USAGE_ALL */ + {336658444, "Number of DB pages allocated = {0}"}, /* NUMBER_PAGES */ + {336658445, "Sweep interval = {0}"}, /* SWEEP_INTERV */ + {336658446, "Number of wal buffers = {0}"}, /* NUM_WAL_BUFF */ + {336658447, "Wal buffer size = {0}"}, /* WAL_BUFF_SIZE */ + {336658448, "Check point length = {0}"}, /* CKPT_LENGTH */ + {336658449, "Check point interval = {0}"}, /* CKPT_INTERV */ + {336658450, "Wal group commit wait = {0}"}, /* WAL_GRPC_WAIT */ + {336658451, "Base level = {0}"}, /* BASE_LEVEL */ + {336658452, "Transaction in limbo = {0}"}, /* LIMBO */ + {336658453, "Frontend commands:"}, /* HLP_FRONTEND */ + {336658454, "BLOBVIEW -- view BLOB in text editor"}, /* HLP_BLOBED */ + {336658455, "BLOBDUMP -- dump BLOB to a file"}, /* HLP_BLOBDMP */ + {336658456, "EDIT [] -- edit SQL script file and execute"}, /* HLP_EDIT */ + {336658457, "INput -- take input from the named SQL file"}, /* HLP_INPUT */ + {336658458, "OUTput [] -- write output to named file"}, /* HLP_OUTPUT */ + {336658459, "SHELL -- execute Operating System command in sub-shell"}, /* HLP_SHELL */ + {336658460, "HELP -- display this menu"}, /* HLP_HELP */ + {336658461, "Set commands:"}, /* HLP_SETCOM */ + {336658462, " SET -- display current SET options"}, /* HLP_SET */ + {336658463, " SET AUTOddl -- toggle autocommit of DDL statements"}, /* HLP_SETAUTO */ + {336658464, " SET BLOB [ALL|] -- display BLOBS of subtype or ALL"}, /* HLP_SETBLOB */ + {336658465, " SET COUNT -- toggle count of selected rows on/off"}, /* HLP_SETCOUNT */ + {336658466, " SET ECHO -- toggle command echo on/off"}, /* HLP_SETECHO */ + {336658467, " SET STATs -- toggle display of performance statistics"}, /* HLP_SETSTAT */ + {336658468, " SET TERM -- change statement terminator string"}, /* HLP_SETTERM */ + {336658469, "SHOW [] -- display system information"}, /* HLP_SHOW */ + {336658470, " = CHECK, COLLATION, DATABASE, DOMAIN, EXCEPTION, FILTER, FUNCTION,"}, /* HLP_OBJTYPE */ + {336658471, "EXIT -- exit and commit changes"}, /* HLP_EXIT */ + {336658472, "QUIT -- exit and roll back changes"}, /* HLP_QUIT */ + {336658473, "All commands may be abbreviated to letters in CAPitals"}, /* HLP_ALL */ + {336658474, "\tSET SCHema/DB -- changes current database"}, /* HLP_SETSCHEMA */ + {336658475, "Yes"}, /* YES_ANS */ + {336658476, "Current memory = !c\nDelta memory = !d\nMax memory = !x\nElapsed time = !e sec\n"}, /* REPORT1 */ + {336658477, "Cpu = !u sec\nBuffers = !b\nReads = !r\nWrites = !w\nFetches = !f"}, /* REPORT2 */ + {336658478, "BLOB display set to subtype {0}. This BLOB: subtype = {1}"}, /* BLOB_SUBTYPE */ + {336658479, "BLOB: {0}, type 'edit' or filename to load>"}, /* BLOB_PROMPT */ + {336658480, "Enter {0} as Y/M/D>"}, /* DATE_PROMPT */ + {336658481, "Enter {0}>"}, /* NAME_PROMPT */ + {336658482, "Bad date {0}"}, /* DATE_ERR */ + {336658483, "CON> "}, /* CON_PROMPT */ + {336658484, " SET LIST -- toggle column or table display format"}, /* HLP_SETLIST */ + {336658485, "{0} not found"}, /* NOT_FOUND */ + {336658486, "Errors occurred (possibly duplicate domains) in creating {0} in {1}"}, /* COPY_ERR */ + {336658487, "Server version too old to support the isql command"}, /* SERVER_TOO_OLD */ + {336658488, "Records affected: {0}"}, /* REC_COUNT */ + {336658489, "Unlicensed for database \"{0}\""}, /* UNLICENSED */ + {336658490, " SET WIDTH [] -- set/unset print width to for column "}, /* HLP_SETWIDTH */ + {336658491, " SET PLAN -- toggle display of query access plan"}, /* HLP_SETPLAN */ + {336658492, " SET TIME -- toggle display of timestamp with DATE values"}, /* HLP_SETTIME */ + {336658493, "EDIT -- edit current command buffer and execute"}, /* HLP_EDIT2 */ + {336658494, "OUTput -- return output to stdout"}, /* HLP_OUTPUT2 */ + {336658495, " SET NAMES -- set name of runtime character set"}, /* HLP_SETNAMES */ + {336658496, " GENERATOR, GRANT, INDEX, PACKAGE, PROCEDURE, ROLE, SQL DIALECT,"}, /* HLP_OBJTYPE2 */ + {336658497, " SET BLOB -- turn off BLOB display"}, /* HLP_SETBLOB2 */ + {336658498, "SET