-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW 1461701: Add test for Max LOB size parameter switch (#989)
- Loading branch information
1 parent
76cfbd2
commit bc329ab
Showing
2 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
Snowflake.Data.Tests/IntegrationTests/SFMaxLobSizeSwitchIT.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Data; | ||
using NUnit.Framework; | ||
using Snowflake.Data.Client; | ||
|
||
namespace Snowflake.Data.Tests.IntegrationTests | ||
{ | ||
[TestFixture] | ||
public class SFMaxLobSizeSwitchIT : SFBaseTest | ||
{ | ||
private const string SqlSelectLargeString = "select randstr(20000000, random()) as large_str"; | ||
|
||
[Test] | ||
[Ignore("TODO: Enable when Max LOB size is available on the automated tests environment")] | ||
public void TestIncreaseMaxLobSizeParameterSwitchSelect() | ||
{ | ||
using (var conn = new SnowflakeDbConnection(ConnectionString + "poolingEnabled=false")) | ||
{ | ||
conn.Open(); | ||
IDbCommand cmd = conn.CreateCommand(); | ||
cmd.CommandText = "alter session set ENABLE_LARGE_VARCHAR_AND_BINARY_IN_RESULT=false"; | ||
cmd.ExecuteNonQuery(); | ||
|
||
cmd.CommandText = SqlSelectLargeString; | ||
var thrown = Assert.Throws<SnowflakeDbException>(() => cmd.ExecuteReader()); | ||
Assert.That(thrown.Message, Does.Contain("exceeds supported length")); | ||
|
||
cmd.CommandText = "alter session set ENABLE_LARGE_VARCHAR_AND_BINARY_IN_RESULT=true"; | ||
cmd.ExecuteNonQuery(); | ||
cmd.CommandText = SqlSelectLargeString; | ||
var reader = cmd.ExecuteReader(); | ||
Assert.IsTrue(reader.Read()); | ||
} | ||
} | ||
} | ||
} |