Skip to content

Commit 9ccb6e9

Browse files
authored
Merge branch 'master' into upstream/covariantReturnTypes
2 parents 7a95a5d + b9842e8 commit 9ccb6e9

25 files changed

Lines changed: 409 additions & 623 deletions

File tree

ChangeLog/7.2.0-Beta-1-dev.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[main] Unused Xtensive.Collections.PriorityQueue is removed
2+
[main] Xtensive.Orm.Rse.Providers.Provider.Sources has changed return type to IReadOnlyList<T>, as well as ctor parameter
3+
[main] SqlInsert.Values became obsolete and no longer in use. Use ValueRows collection to add value rows
4+
[main] DomainConfiguration.MaxNumberOfConditions is introduced
5+
[main] SqlDml.Truncate() is introduced.
6+
[main] WellKnown.MaxNumberOfConditions became obsolete, use new DomainConfiguration.MaxNumberOfConditions if needed
7+
[main] Temporary tables cleanup now uses TRUNCATE instead of DELETE when possible
8+
[main] Temporary tables population is increased with multi-row inserts - 256 and 16 items per INSERT
9+
[main] PersistParameterBinding has new field RowIndex, use it for multi-row inserts if needed
10+
[main] TemporaryTableDescriptor changed interface to IMultiRecordPersistDescriptor, fully compatible with IPersistDescriptor
11+
[postgresql] QueryInfo.MaxQueryParameterCount actualized, it is 65535 now
12+
[oracle] QueryInfo.MaxQueryParameterCount actualized, it is 65535 now

Orm/Xtensive.Orm.Oracle/Sql.Drivers.Oracle/v09/ServerInfoProvider.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public override QueryInfo GetQueryInfo()
183183
queryInfo.ParameterPrefix = ":";
184184
queryInfo.MaxLength = DoNotKnow;
185185
queryInfo.MaxComparisonOperations = DoNotKnow;
186-
queryInfo.MaxQueryParameterCount = 63999;
186+
queryInfo.MaxQueryParameterCount = 65535;
187187
queryInfo.Features =
188188
QueryFeatures.NamedParameters |
189189
QueryFeatures.ParameterPrefix |
@@ -202,7 +202,8 @@ public override ServerFeatures GetServerFeatures()
202202
return ServerFeatures.Savepoints |
203203
ServerFeatures.LargeObjects |
204204
ServerFeatures.CursorParameters |
205-
ServerFeatures.MultipleResultsViaCursorParameters;
205+
ServerFeatures.MultipleResultsViaCursorParameters |
206+
ServerFeatures.TemporaryTableEmulation;
206207
}
207208

208209
public override IdentityInfo GetIdentityInfo()

Orm/Xtensive.Orm.PostgreSql/Sql.Drivers.PostgreSql/v9_0/ServerInfoProvider.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ namespace Xtensive.Sql.Drivers.PostgreSql.v9_0
1010
{
1111
internal class ServerInfoProvider : v8_4.ServerInfoProvider
1212
{
13+
public override QueryInfo GetQueryInfo()
14+
{
15+
var queryInfo = base.GetQueryInfo();
16+
queryInfo.MaxQueryParameterCount = 65535;
17+
return queryInfo;
18+
}
19+
1320
// Constructors
1421

1522
public ServerInfoProvider(SqlDriver driver)

Orm/Xtensive.Orm.SqlServer/Sql.Drivers.SqlServer/DriverFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ private static ErrorMessageParser CreateMessageParser(SqlServerConnection connec
4444
bool isEnglish;
4545
using (var command = connection.CreateCommand()) {
4646
command.CommandText = LangIdQuery;
47-
isEnglish = command.ExecuteScalar().ToString()=="0";
47+
var langId = (short) command.ExecuteScalar();
48+
isEnglish = langId == 0 || langId == 23;
4849
}
4950

5051
var templates = new Dictionary<int, string>();

Orm/Xtensive.Orm.Tests.Core/Collections/PriorityQueueTest.cs

Lines changed: 0 additions & 100 deletions
This file was deleted.

Orm/Xtensive.Orm.Tests.Framework/Orm.config

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232

3333
<domain name="mssql2019"
3434
connectionUrl="sqlserver://localhost\DO_SQL2019/DO-Tests?MultipleActiveResultSets=True" />
35+
36+
<domain name="mssql2022"
37+
connectionUrl="sqlserver://localhost\DO_SQL2022/DO-Tests?MultipleActiveResultSets=True" />
3538

3639
<domain name="pgsql83"
3740
connectionUrl="postgresql://dotest:dotest@localhost:5483/dotest" />
@@ -66,6 +69,9 @@
6669
<domain name="pgsql140"
6770
connectionUrl="postgresql://dotest:dotest@localhost:54140/dotest" />
6871

72+
<domain name="pgsql150"
73+
connectionUrl="postgresql://dotest:dotest@localhost:54150/dotest" />
74+
6975
<domain name="oracle10"
7076
connectionUrl="oracle://dotest:dotest@localhost:5510/ora10" />
7177

@@ -122,6 +128,9 @@
122128
<domain name="mssql2019cs" provider="sqlserver"
123129
connectionString="Data Source=localhost\DO_SQL2019;Initial Catalog=DO-Tests;Integrated Security=True;MultipleActiveResultSets=True" />
124130

131+
<domain name="mssql2022cs" provider="sqlserver"
132+
connectionString="Data Source=localhost\DO_SQL2022;Initial Catalog=DO-Tests;Integrated Security=True;MultipleActiveResultSets=True" />
133+
125134
<domain name="pgsql83cs" provider="postgresql"
126135
connectionString="HOST=localhost;PORT=5483;DATABASE=dotest;USER ID=dotest;PASSWORD=dotest" />
127136

@@ -155,6 +164,9 @@
155164
<domain name="pgsql140cs" provider="postgresql"
156165
connectionString="HOST=localhost;PORT=54140;DATABASE=dotest;USER ID=dotest;PASSWORD=dotest" />
157166

167+
<domain name="pgsql150cs" provider="postgresql"
168+
connectionString="HOST=localhost;PORT=54150;DATABASE=dotest;USER ID=dotest;PASSWORD=dotest" />
169+
158170
<domain name="oracle10cs" provider="oracle"
159171
connectionString="DATA SOURCE=&quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=5510))(CONNECT_DATA=(SERVICE_NAME=ora10)))&quot;;USER ID=dotest;PASSWORD=dotest" />
160172

Orm/Xtensive.Orm.Tests.Framework/TestHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ public static TimeOnly AdjustTimeOnlyForProvider(this TimeOnly origin, StoragePr
169169
var newTicks = ticks - (ticks % divider.Value);
170170
return new TimeOnly(newTicks);
171171
}
172+
#endif
172173

173174
public static void AddValueRow(this SqlInsert insert, in (SqlColumn column, SqlExpression value) first, params (SqlColumn column, SqlExpression value)[] additional)
174175
{
@@ -180,6 +181,5 @@ public static void AddValueRow(this SqlInsert insert, in (SqlColumn column, SqlE
180181
}
181182
insert.ValueRows.Add(row);
182183
}
183-
#endif
184184
}
185185
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Copyright (C) 2023 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
4+
5+
using System;
6+
using NUnit.Framework;
7+
8+
namespace Xtensive.Orm.Tests.Configuration
9+
{
10+
[TestFixture]
11+
public class MaxNumberOfConditionsTest
12+
{
13+
[Test]
14+
public void NegativeNumberTest()
15+
{
16+
var config = DomainConfigurationFactory.Create();
17+
config.MaxNumberOfConditions = -1;
18+
_ = Assert.Throws<InvalidOperationException>(() => config.Lock());
19+
20+
config = DomainConfigurationFactory.Create();
21+
config.MaxNumberOfConditions = -100;
22+
_ = Assert.Throws<InvalidOperationException>(() => config.Lock());
23+
}
24+
25+
[Test]
26+
public void MaxNumberIsZeroTest()
27+
{
28+
var config = DomainConfigurationFactory.Create();
29+
config.MaxNumberOfConditions = 0;
30+
_ = Assert.Throws<InvalidOperationException>(() => config.Lock());
31+
}
32+
33+
[Test]
34+
public void MaxNumberIsOneTest()
35+
{
36+
var config = DomainConfigurationFactory.Create();
37+
config.MaxNumberOfConditions = 1;
38+
_ = Assert.Throws<InvalidOperationException>(() => config.Lock());
39+
}
40+
41+
[Test]
42+
public void EdgeValuesTest()
43+
{
44+
var config = DomainConfigurationFactory.Create();
45+
config.MaxNumberOfConditions = 2;
46+
Assert.DoesNotThrow(() => config.Lock());
47+
48+
config = DomainConfigurationFactory.Create();
49+
config.MaxNumberOfConditions = 999;
50+
Assert.DoesNotThrow(() => config.Lock());
51+
}
52+
53+
[Test]
54+
public void ExceededLimit()
55+
{
56+
var config = DomainConfigurationFactory.Create();
57+
config.MaxNumberOfConditions = 1000;
58+
_ = Assert.Throws<InvalidOperationException>(() => config.Lock());
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)