Skip to content

Commit

Permalink
Test for #4321.
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-tkachev committed Jan 4, 2024
1 parent fc47528 commit 1347b7e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Data/Setup Scripts/oracle19.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ REM use pull to get latest layers (run will use cached layers)
docker pull oracledb19c/oracle.19.3.0-ee:oracle19.3.0-ee
docker run -d --name oracle19 -e ORACLE_PWD=password -e ORACLE_SID=XE -p 1531:1521 oracledb19c/oracle.19.3.0-ee:oracle19.3.0-ee

call wait oracle19 "DATABASE IS READY TO USE!"
call wait oracle19 "Completing Database Creation"

REM create test database
docker cp oracle-setup.sql oracle19:/setup.sql
Expand Down
5 changes: 5 additions & 0 deletions Data/Setup Scripts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ Contains database setup scripts for local testing
Use of Windows-based images is not recommended as they probably will not work due to base image mismatch.

- `sqlserver2022-win.cmd` : Windows script to create or update docker container with SQL Server 2022 (Windows-based) instance

### Windows downloads and installs (for local testing)

- [Docker Desktop](https://www.docker.com/products/docker-desktop/)
- [Microsoft® SQL Server® Compact 4.0 SP1](https://www.microsoft.com/en-us/download/details.aspx?id=30709)
25 changes: 25 additions & 0 deletions Tests/Linq/Extensions/SqlServerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -921,5 +921,30 @@ select new

_ = q.ToList();
}

[Test]
public void TablesInScopeHintWithTReferenceTest(
[IncludeDataSources(true, TestProvName.AllSqlServer)] string context)
{
using var db = GetDataContext(context);

var q =
(
from c in db.Child
select new
{
c.ChildID,
c.Parent!.ParentID
}
)
.TablesInScopeHint(SqlServerHints.Table.NoLock);

_ = q.ToList();

var test = LastQuery?.Replace("\r", "");

Assert.That(test, Contains.Substring("[Child] [c] WITH (NoLock)"));
Assert.That(test, Contains.Substring("[Parent] [p] WITH (NoLock)"));
}
}
}

0 comments on commit 1347b7e

Please sign in to comment.