Skip to content

Commit

Permalink
Merge pull request #75 from LinqToDB4iSeries/V5.1.1
Browse files Browse the repository at this point in the history
V5.1.1
  • Loading branch information
nsarris authored Apr 2, 2023
2 parents 68dc75e + 3f99bcf commit 6a6e0df
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Build/linq2db.Default.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Version>5.1.0</Version>
<Version>5.1.1</Version>

<Description>LINQ to DB is a data access technology that provides a run-time infrastructure for managing relational data as objects. This package is a provider for DB2 on the IBM iSeries.</Description>
<Authors>Roy Chase, Nikos Sarris</Authors>
Expand Down
10 changes: 5 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
-->
<ItemGroup>
<!--as stated in issue 1 - packages in this item group shouldn't be duplicated in other groups-->
<PackageVersion Include="linq2db" Version="5.1.0" />
<PackageVersion Include="linq2db.Tools" Version="5.1.0" />
<PackageVersion Include="linq2db.AspNet" Version="5.1.0" />
<PackageVersion Include="linq2db.Remote.Grpc" Version="5.1.0" />
<PackageVersion Include="linq2db.Remote.Wcf" Version="5.1.0" />
<PackageVersion Include="linq2db" Version="5.1.1" />
<PackageVersion Include="linq2db.Tools" Version="5.1.1" />
<PackageVersion Include="linq2db.AspNet" Version="5.1.1" />
<PackageVersion Include="linq2db.Remote.Grpc" Version="5.1.1" />
<PackageVersion Include="linq2db.Remote.Wcf" Version="5.1.1" />
<!--generic packages for source projects-->
<PackageVersion Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
Expand Down
6 changes: 3 additions & 3 deletions Source/ISeriesProvider/DB2iSeriesFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ internal class DB2iSeriesFactory : IDataProviderFactory
{
public IDataProvider GetDataProvider(IEnumerable<NamedValue> attributes)
{
var versionText = attributes.FirstOrDefault(_ => _.Name == "version");
var versionText = attributes.FirstOrDefault(_ => _.Name == "version")?.Value ?? "";

var version = versionText.Value switch
var version = versionText switch
{
var x when x.StartsWith("7.4.") || x == "7.4" || x == "7_4" => DB2iSeriesVersion.V7_4,
var x when x.StartsWith("7.3.") || x == "7.3" || x == "7_3" => DB2iSeriesVersion.V7_3,
var x when x.StartsWith("7.2.") || x == "7.2" || x == "7_2" => DB2iSeriesVersion.V7_2,
_ => DB2iSeriesVersion.V7_1
_ => DB2iSeriesProviderOptions.Defaults.Version
};

var providerType = attributes.FirstOrDefault(_ => _.Name == "assemblyName")?.Value switch
Expand Down
14 changes: 13 additions & 1 deletion Tests/Linq/DataProvider/SqlServerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;

using FluentAssertions;

using LinqToDB;
using LinqToDB.Common;
using LinqToDB.Data;
Expand All @@ -23,12 +25,15 @@
using LinqToDB.Mapping;
using LinqToDB.SchemaProvider;
using LinqToDB.Tools;

using Microsoft.SqlServer.Types;

using NUnit.Framework;
using Tests.Model;

namespace Tests.DataProvider
{
using Model;

[TestFixture]
public class SqlServerTests : DataProviderTestBase
{
Expand Down Expand Up @@ -2156,5 +2161,12 @@ static void AssertColumn(TableSchema table, string name, bool readOnly)
Assert.AreEqual(readOnly, column!.SkipOnUpdate);
}
}

[Test]
public void GetDataConnectionTest([IncludeDataSources(false, TestProvName.AllSqlServer)] string context)
{
var cs = DataConnection.GetConnectionString(context);
_ = SqlServerTools.CreateDataConnection(cs);
}
}
}
36 changes: 0 additions & 36 deletions Tests/Linq/Extensions/PostgreSQLTests.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForNoKeyUpdate}"));
}

Expand All @@ -167,9 +164,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForNoKeyUpdate} OF p, c_1"));
}

Expand All @@ -189,9 +183,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForNoKeyUpdate} {PostgreSQLHints.NoWait}"));
}

Expand All @@ -211,9 +202,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForNoKeyUpdate} OF p, c_1 {PostgreSQLHints.NoWait}"));
}

Expand All @@ -233,9 +221,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

var skipLocked = LastQuery.Contains(ProviderName.PostgreSQL95) ? " SKIP LOCKED" : "";
Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForNoKeyUpdate}{skipLocked}"));
}
Expand All @@ -256,9 +241,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

var skipLocked = LastQuery.Contains(ProviderName.PostgreSQL95) ? " SKIP LOCKED" : "";
Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForNoKeyUpdate} OF p, c_1{skipLocked}"));
}
Expand Down Expand Up @@ -395,9 +377,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForKeyShare}"));
}

Expand All @@ -417,9 +396,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForKeyShare} OF p, c_1"));
}

Expand All @@ -439,9 +415,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForKeyShare} {PostgreSQLHints.NoWait}"));
}

Expand All @@ -461,9 +434,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForKeyShare} OF p, c_1 {PostgreSQLHints.NoWait}"));
}

Expand All @@ -483,9 +453,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

var skipLocked = LastQuery.Contains(ProviderName.PostgreSQL95) ? " SKIP LOCKED" : "";
Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForKeyShare}{skipLocked}"));
}
Expand All @@ -506,9 +473,6 @@ select p

_ = q.ToList();

if (LastQuery.Contains(ProviderName.PostgreSQL92))
return;

var skipLocked = LastQuery.Contains(ProviderName.PostgreSQL95) ? " SKIP LOCKED" : "";
Assert.That(LastQuery, Contains.Substring($"{PostgreSQLHints.ForKeyShare} OF p, c_1{skipLocked}"));
}
Expand Down

0 comments on commit 6a6e0df

Please sign in to comment.