Skip to content

Commit 3227850

Browse files
committed
fix odbc
1 parent a11ebb9 commit 3227850

File tree

6 files changed

+47
-47
lines changed

6 files changed

+47
-47
lines changed

test/EFCore.Jet.FunctionalTests/Query/NorthwindFunctionsQueryJetTest.Functions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,13 +2388,13 @@ public override async Task Indexof_with_one_parameter_arg(bool async)
23882388
{
23892389
await base.Indexof_with_one_parameter_arg(async);
23902390
AssertSql(
2391-
"""
2391+
$"""
23922392
@__pattern_0='a' (Size = 30)
23932393
@__pattern_0='a' (Size = 30)
23942394
23952395
SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region`
23962396
FROM `Customers` AS `c`
2397-
WHERE (INSTR(1, `c`.`ContactName`, @__pattern_0, 1) - IIF(@__pattern_0 = '', 0, 1)) = 1
2397+
WHERE (INSTR(1, `c`.`ContactName`, {AssertSqlHelper.Parameter("@__pattern_0")}, 1) - IIF({AssertSqlHelper.Parameter("@__pattern_0")} = '', 0, 1)) = 1
23982398
""");
23992399
}
24002400

@@ -2415,12 +2415,12 @@ public override async Task Indexof_with_parameter_starting_position(bool async)
24152415
await base.Indexof_with_parameter_starting_position(async);
24162416

24172417
AssertSql(
2418-
"""
2418+
$"""
24192419
@__start_0='2'
24202420
24212421
SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region`
24222422
FROM `Customers` AS `c`
2423-
WHERE (INSTR(@__start_0 + 1, `c`.`ContactName`, 'a', 1) - 1) = 4
2423+
WHERE (INSTR({AssertSqlHelper.Parameter("@__start_0")} + 1, `c`.`ContactName`, 'a', 1) - 1) = 4
24242424
""");
24252425
}
24262426

test/EFCore.Jet.FunctionalTests/Query/NorthwindQueryFiltersQueryJetTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ public override async Task Find(bool async)
5858
await base.Find(async);
5959

6060
AssertSql(
61-
"""
61+
$"""
6262
@__ef_filter__TenantPrefix_0_startswith='B%' (Size = 40)
6363
@__p_0='ALFKI' (Size = 5)
6464
6565
SELECT TOP 1 `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region`
6666
FROM `Customers` AS `c`
67-
WHERE (`c`.`CompanyName` LIKE @__ef_filter__TenantPrefix_0_startswith) AND `c`.`CustomerID` = @__p_0
67+
WHERE (`c`.`CompanyName` LIKE {AssertSqlHelper.Parameter("@__ef_filter__TenantPrefix_0_startswith")}) AND `c`.`CustomerID` = {AssertSqlHelper.Parameter("@__p_0")}
6868
""");
6969
}
7070

@@ -302,22 +302,22 @@ public override void Compiled_query()
302302
base.Compiled_query();
303303

304304
AssertSql(
305-
"""
305+
$"""
306306
@__ef_filter__TenantPrefix_0_startswith='B%' (Size = 40)
307307
@__customerID='BERGS' (Size = 5)
308308
309309
SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region`
310310
FROM `Customers` AS `c`
311-
WHERE (`c`.`CompanyName` LIKE @__ef_filter__TenantPrefix_0_startswith) AND `c`.`CustomerID` = @__customerID
311+
WHERE (`c`.`CompanyName` LIKE {AssertSqlHelper.Parameter("@__ef_filter__TenantPrefix_0_startswith")}) AND `c`.`CustomerID` = {AssertSqlHelper.Parameter("@__customerID")}
312312
""",
313313
//
314-
"""
314+
$"""
315315
@__ef_filter__TenantPrefix_0_startswith='B%' (Size = 40)
316316
@__customerID='BLAUS' (Size = 5)
317317
318318
SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region`
319319
FROM `Customers` AS `c`
320-
WHERE (`c`.`CompanyName` LIKE @__ef_filter__TenantPrefix_0_startswith) AND `c`.`CustomerID` = @__customerID
320+
WHERE (`c`.`CompanyName` LIKE {AssertSqlHelper.Parameter("@__ef_filter__TenantPrefix_0_startswith")}) AND `c`.`CustomerID` = {AssertSqlHelper.Parameter("@__customerID")}
321321
""");
322322
}
323323

test/EFCore.Jet.FunctionalTests/Query/NorthwindWhereQueryJetTest.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,12 +1380,12 @@ public override async Task Where_bool_member_and_parameter_compared_to_binary_ex
13801380
await base.Where_bool_member_and_parameter_compared_to_binary_expression_nested(isAsync);
13811381

13821382
AssertSql(
1383-
"""
1383+
$"""
13841384
@__prm_0='True'
13851385
13861386
SELECT `p`.`ProductID`, `p`.`Discontinued`, `p`.`ProductName`, `p`.`SupplierID`, `p`.`UnitPrice`, `p`.`UnitsInStock`
13871387
FROM `Products` AS `p`
1388-
WHERE `p`.`Discontinued` = (IIF(`p`.`ProductID` > 50, TRUE, FALSE) BXOR @__prm_0)
1388+
WHERE `p`.`Discontinued` = (IIF(`p`.`ProductID` > 50, TRUE, FALSE) BXOR {AssertSqlHelper.Parameter("@__prm_0")})
13891389
""");
13901390
}
13911391

@@ -1526,12 +1526,12 @@ public override async Task Where_concat_string_int_comparison1(bool isAsync)
15261526
await base.Where_concat_string_int_comparison1(isAsync);
15271527

15281528
AssertSql(
1529-
"""
1529+
$"""
15301530
@__i_0='10'
15311531
15321532
SELECT `c`.`CustomerID`
15331533
FROM `Customers` AS `c`
1534-
WHERE (`c`.`CustomerID` & (@__i_0 & '')) = `c`.`CompanyName`
1534+
WHERE (`c`.`CustomerID` & ({AssertSqlHelper.Parameter("@__i_0")} & '')) = `c`.`CompanyName`
15351535
""");
15361536
}
15371537

@@ -1540,12 +1540,12 @@ public override async Task Where_concat_string_int_comparison2(bool isAsync)
15401540
await base.Where_concat_string_int_comparison2(isAsync);
15411541

15421542
AssertSql(
1543-
"""
1543+
$"""
15441544
@__i_0='10'
15451545
15461546
SELECT `c`.`CustomerID`
15471547
FROM `Customers` AS `c`
1548-
WHERE ((@__i_0 & '') & `c`.`CustomerID`) = `c`.`CompanyName`
1548+
WHERE (({AssertSqlHelper.Parameter("@__i_0")} & '') & `c`.`CustomerID`) = `c`.`CompanyName`
15491549
""");
15501550
}
15511551

@@ -1554,13 +1554,13 @@ public override async Task Where_concat_string_int_comparison3(bool isAsync)
15541554
await base.Where_concat_string_int_comparison3(isAsync);
15551555

15561556
AssertSql(
1557-
"""
1557+
$"""
15581558
@__p_0='30'
15591559
@__j_1='21'
15601560
15611561
SELECT `c`.`CustomerID`
15621562
FROM `Customers` AS `c`
1563-
WHERE ((((@__p_0 & '') & `c`.`CustomerID`) & (@__j_1 & '')) & (42 & '')) = `c`.`CompanyName`
1563+
WHERE (((({AssertSqlHelper.Parameter("@__p_0")} & '') & `c`.`CustomerID`) & {AssertSqlHelper.Parameter("(@__j_1")} & '')) & (42 & '')) = `c`.`CompanyName`
15641564
""");
15651565
}
15661566

@@ -1581,12 +1581,12 @@ public override async Task Where_concat_string_string_comparison(bool isAsync)
15811581
await base.Where_concat_string_string_comparison(isAsync);
15821582

15831583
AssertSql(
1584-
"""
1584+
$"""
15851585
@__i_0='A' (Size = 255)
15861586
15871587
SELECT `c`.`CustomerID`
15881588
FROM `Customers` AS `c`
1589-
WHERE (@__i_0 & `c`.`CustomerID`) = 'AALFKI'
1589+
WHERE ({AssertSqlHelper.Parameter("@__i_0")} & `c`.`CustomerID`) = 'AALFKI'
15901590
""");
15911591
}
15921592

@@ -1595,12 +1595,12 @@ public override async Task Where_string_concat_method_comparison(bool isAsync)
15951595
await base.Where_string_concat_method_comparison(isAsync);
15961596

15971597
AssertSql(
1598-
"""
1598+
$"""
15991599
@__i_0='A' (Size = 255)
16001600
16011601
SELECT `c`.`CustomerID`
16021602
FROM `Customers` AS `c`
1603-
WHERE (@__i_0 & `c`.`CustomerID`) = 'AAROUT'
1603+
WHERE ({AssertSqlHelper.Parameter("@__i_0")} & `c`.`CustomerID`) = 'AAROUT'
16041604
""");
16051605
}
16061606

@@ -1609,13 +1609,13 @@ public override async Task Where_string_concat_method_comparison_2(bool async)
16091609
await base.Where_string_concat_method_comparison_2(async);
16101610

16111611
AssertSql(
1612-
"""
1612+
$"""
16131613
@__i_0='A' (Size = 255)
16141614
@__j_1='B' (Size = 255)
16151615
16161616
SELECT `c`.`CustomerID`
16171617
FROM `Customers` AS `c`
1618-
WHERE (@__i_0 & (@__j_1 & `c`.`CustomerID`)) = 'ABANATR'
1618+
WHERE ({AssertSqlHelper.Parameter("@__i_0")} & ({AssertSqlHelper.Parameter("@__j_1")} & `c`.`CustomerID`)) = 'ABANATR'
16191619
""");
16201620
}
16211621

@@ -1624,14 +1624,14 @@ public override async Task Where_string_concat_method_comparison_3(bool async)
16241624
await base.Where_string_concat_method_comparison_3(async);
16251625

16261626
AssertSql(
1627-
"""
1627+
$"""
16281628
@__i_0='A' (Size = 255)
16291629
@__j_1='B' (Size = 255)
16301630
@__k_2='C' (Size = 255)
16311631
16321632
SELECT `c`.`CustomerID`
16331633
FROM `Customers` AS `c`
1634-
WHERE (@__i_0 & (@__j_1 & (@__k_2 & `c`.`CustomerID`))) = 'ABCANTON'
1634+
WHERE ({AssertSqlHelper.Parameter("@__i_0")} & ({AssertSqlHelper.Parameter("@__j_1")} & ({AssertSqlHelper.Parameter("@__k_2")} & `c`.`CustomerID`))) = 'ABCANTON'
16351635
""");
16361636
}
16371637

@@ -2110,13 +2110,13 @@ public override async Task Using_same_parameter_twice_in_query_generates_one_sql
21102110
await base.Using_same_parameter_twice_in_query_generates_one_sql_parameter(async);
21112111

21122112
AssertSql(
2113-
"""
2113+
$"""
21142114
@__i_0='10'
21152115
@__i_0='10'
21162116
21172117
SELECT `c`.`CustomerID`
21182118
FROM `Customers` AS `c`
2119-
WHERE (((@__i_0 & '') & `c`.`CustomerID`) & (@__i_0 & '')) = '10ALFKI10'
2119+
WHERE ((({AssertSqlHelper.Parameter("@__i_0")} & '') & `c`.`CustomerID`) & ({AssertSqlHelper.Parameter("@__i_0")} & '')) = '10ALFKI10'
21202120
""");
21212121
}
21222122

test/EFCore.Jet.FunctionalTests/Query/TPHInheritanceQueryJetTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ public override async Task Setting_foreign_key_to_a_different_type_throws()
622622
WHERE `a`.`Discriminator` = 'Kiwi'
623623
""",
624624
//
625-
"""
625+
$"""
626626
@p0='0'
627627
@p1='Eagle' (Nullable = false) (Size = 8)
628628
@p2='2' (Nullable = true)
@@ -632,7 +632,7 @@ public override async Task Setting_foreign_key_to_a_different_type_throws()
632632
@p6='Haliaeetus leucocephalus' (Size = 100)
633633
634634
INSERT INTO `Animals` (`CountryId`, `Discriminator`, `EagleId`, `Group`, `IsFlightless`, `Name`, `Species`)
635-
VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6);
635+
VALUES ({AssertSqlHelper.Parameter("@p0")}, {AssertSqlHelper.Parameter("@p1")}, {AssertSqlHelper.Parameter("@p2")}, {AssertSqlHelper.Parameter("@p3")}, {AssertSqlHelper.Parameter("@p4")}, {AssertSqlHelper.Parameter("@p5")}, {AssertSqlHelper.Parameter("@p6")});
636636
SELECT `Id`
637637
FROM `Animals`
638638
WHERE @@ROWCOUNT = 1 AND `Id` = @@identity;

test/EFCore.Jet.FunctionalTests/Query/TPTFiltersInheritanceQueryJetTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ public override async Task Can_use_IgnoreQueryFilters_and_GetDatabaseValues(bool
186186
INNER JOIN `Eagle` AS `e` ON `a`.`Id` = `e`.`Id`
187187
""",
188188
//
189-
"""
189+
$"""
190190
@__p_0='1'
191191
192192
SELECT TOP 1 `a`.`Id`, `a`.`CountryId`, `a`.`Name`, `a`.`Species`, `b`.`EagleId`, `b`.`IsFlightless`, `e`.`Group`
193193
FROM (`Animals` AS `a`
194194
INNER JOIN `Birds` AS `b` ON `a`.`Id` = `b`.`Id`)
195195
INNER JOIN `Eagle` AS `e` ON `a`.`Id` = `e`.`Id`
196-
WHERE `a`.`Id` = @__p_0
196+
WHERE `a`.`Id` = {AssertSqlHelper.Parameter("@__p_0")}
197197
""");
198198
}
199199

test/EFCore.Jet.FunctionalTests/Update/NonSharedModelUpdatesJetTest.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,33 @@ public override async Task Principal_and_dependent_roundtrips_with_cycle_breakin
2121
await base.Principal_and_dependent_roundtrips_with_cycle_breaking(async);
2222

2323
AssertSql(
24-
"""
24+
$"""
2525
@p0='AC South' (Size = 255)
2626
2727
INSERT INTO `AuthorsClub` (`Name`)
28-
VALUES (@p0);
28+
VALUES ({AssertSqlHelper.Parameter("@p0")});
2929
SELECT `Id`
3030
FROM `AuthorsClub`
3131
WHERE @@ROWCOUNT = 1 AND `Id` = @@identity;
3232
""",
3333
//
34-
"""
34+
$"""
3535
@p1='1'
3636
@p2='Alice' (Size = 255)
3737
3838
INSERT INTO `Author` (`AuthorsClubId`, `Name`)
39-
VALUES (@p1, @p2);
39+
VALUES ({AssertSqlHelper.Parameter("@p1")}, {AssertSqlHelper.Parameter("@p2")});
4040
SELECT `Id`
4141
FROM `Author`
4242
WHERE @@ROWCOUNT = 1 AND `Id` = @@identity;
4343
""",
4444
//
45-
"""
45+
$"""
4646
@p3='1'
4747
@p4=NULL (Size = 255)
4848
4949
INSERT INTO `Book` (`AuthorId`, `Title`)
50-
VALUES (@p3, @p4);
50+
VALUES ({AssertSqlHelper.Parameter("@p3")}, {AssertSqlHelper.Parameter("@p4")});
5151
SELECT `Id`
5252
FROM `Book`
5353
WHERE @@ROWCOUNT = 1 AND `Id` = @@identity;
@@ -59,41 +59,41 @@ public override async Task Principal_and_dependent_roundtrips_with_cycle_breakin
5959
INNER JOIN `Author` AS `a` ON `b`.`AuthorId` = `a`.`Id`
6060
""",
6161
//
62-
"""
62+
$"""
6363
@p0='AC North' (Size = 255)
6464
6565
INSERT INTO `AuthorsClub` (`Name`)
66-
VALUES (@p0);
66+
VALUES ({AssertSqlHelper.Parameter("@p0")});
6767
SELECT `Id`
6868
FROM `AuthorsClub`
6969
WHERE @@ROWCOUNT = 1 AND `Id` = @@identity;
7070
""",
7171
//
72-
"""
72+
$"""
7373
@p1='2'
7474
@p2='Author of the year 2023' (Size = 255)
7575
7676
INSERT INTO `Author` (`AuthorsClubId`, `Name`)
77-
VALUES (@p1, @p2);
77+
VALUES ({AssertSqlHelper.Parameter("@p1")}, {AssertSqlHelper.Parameter("@p2")});
7878
SELECT `Id`
7979
FROM `Author`
8080
WHERE @@ROWCOUNT = 1 AND `Id` = @@identity;
8181
""",
8282
//
83-
"""
83+
$"""
8484
@p3='2'
8585
@p4='1'
8686
87-
UPDATE `Book` SET `AuthorId` = @p3
88-
WHERE `Id` = @p4;
87+
UPDATE `Book` SET `AuthorId` = {AssertSqlHelper.Parameter("@p3")}
88+
WHERE `Id` = {AssertSqlHelper.Parameter("@p4")};
8989
SELECT @@ROWCOUNT;
9090
""",
9191
//
92-
"""
92+
$"""
9393
@p0='1'
9494
9595
DELETE FROM `Author`
96-
WHERE `Id` = @p0;
96+
WHERE `Id` = {AssertSqlHelper.Parameter("@p0")};
9797
SELECT @@ROWCOUNT;
9898
""");
9999
}

0 commit comments

Comments
 (0)