Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f4aa1ac
Use JSON for multistatement tests
sfc-gh-ext-simba-lf Jun 10, 2025
0eeff61
Add switch case for double
sfc-gh-ext-simba-lf Jun 10, 2025
b89c607
Add check if rowsetBase64 exists
sfc-gh-ext-simba-lf Jun 10, 2025
a574cd3
Merge branch 'master' of https://github.com/snowflakedb/snowflake-con…
sfc-gh-ext-simba-lf Jun 10, 2025
32f0399
Enable multistatement test parameter
sfc-gh-ext-simba-lf Jun 12, 2025
aaa24d0
Remove test parameter
sfc-gh-ext-simba-lf Jun 12, 2025
c0cc0c0
Merge branch 'master' into NO-SNOW-Fix-Multistatement-Tests
sfc-gh-ext-simba-lf Jun 16, 2025
ffd62ab
Revert removing whiteline
sfc-gh-ext-simba-lf Jun 16, 2025
d283a16
Add tests for arrow
sfc-gh-ext-simba-lf Jun 20, 2025
7d5e2ae
Use Convert function
sfc-gh-ext-simba-lf Jun 27, 2025
3e188b6
Merge branch 'master' of https://github.com/snowflakedb/snowflake-con…
sfc-gh-ext-simba-lf Jul 16, 2025
db92637
Remove setting multi-statement to JSON
sfc-gh-ext-simba-lf Jul 16, 2025
acd9151
Remove extra setting of result format
sfc-gh-ext-simba-lf Jul 16, 2025
5094118
Revert assert
sfc-gh-ext-simba-lf Jul 16, 2025
fdde4dd
Temporary disable result format check
sfc-gh-ext-simba-lf Jul 17, 2025
7611217
Revert last
sfc-gh-ext-simba-lf Jul 17, 2025
ba7ea2b
Merge branch 'master' into NO-SNOW-Fix-Multistatement-Tests
sfc-gh-ext-simba-lf Jul 21, 2025
0da40c7
Merge branch 'master' of https://github.com/snowflakedb/snowflake-con…
sfc-gh-ext-simba-lf Jul 21, 2025
24af513
Merge branch 'master' into NO-SNOW-Fix-Multistatement-Tests
sfc-gh-ext-simba-lf Jul 24, 2025
e78e3c9
Merge branch 'NO-SNOW-Fix-Multistatement-Tests' of https://github.com…
sfc-gh-ext-simba-lf Jul 24, 2025
afe7eb0
Retrigger checks
sfc-gh-ext-simba-lf Jul 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions Snowflake.Data.Tests/IntegrationTests/SFMultiStatementsIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@

namespace Snowflake.Data.Tests.IntegrationTests
{
[TestFixture(ResultFormat.ARROW)]
[TestFixture(ResultFormat.JSON)]
[TestFixture]
class SFMultiStatementsIT : SFBaseTest
{
private readonly ResultFormat _resultFormat;

public SFMultiStatementsIT(ResultFormat resultFormat)
{
_resultFormat = resultFormat;
}

[Test]
public void TestSelectWithoutBinding()
{
Expand All @@ -21,7 +30,7 @@ public void TestSelectWithoutBinding()
{
conn.ConnectionString = ConnectionString;
conn.Open();
SessionParameterAlterer.SetResultFormat(conn, ResultFormat.JSON);
SessionParameterAlterer.SetResultFormat(conn, _resultFormat);

IDbCommand cmd = conn.CreateCommand();
var param = cmd.CreateParameter();
Expand Down Expand Up @@ -88,7 +97,7 @@ public async Task TestSelectAsync()
{
conn.ConnectionString = ConnectionString;
conn.Open();
SessionParameterAlterer.SetResultFormat(conn, ResultFormat.JSON);
SessionParameterAlterer.SetResultFormat(conn, _resultFormat);

DbCommand cmd = conn.CreateCommand();
var param = cmd.CreateParameter();
Expand Down Expand Up @@ -130,7 +139,7 @@ public void TestSelectWithBinding()
{
conn.ConnectionString = ConnectionString;
conn.Open();
SessionParameterAlterer.SetResultFormat(conn, ResultFormat.JSON);
SessionParameterAlterer.SetResultFormat(conn, _resultFormat);

IDbCommand cmd = conn.CreateCommand();
// Set statement count
Expand Down Expand Up @@ -183,8 +192,7 @@ public void TestMixedQueryTypeWithBinding()
{
conn.ConnectionString = ConnectionString;
conn.Open();
SessionParameterAlterer.SetResultFormat(conn, ResultFormat.JSON);

SessionParameterAlterer.SetResultFormat(conn, _resultFormat);

using (DbCommand cmd = conn.CreateCommand())
{
Expand Down Expand Up @@ -289,7 +297,7 @@ public void TestWithExecuteNonQuery()
{
conn.ConnectionString = ConnectionString;
conn.Open();
SessionParameterAlterer.SetResultFormat(conn, ResultFormat.JSON);
SessionParameterAlterer.SetResultFormat(conn, _resultFormat);

using (DbCommand cmd = conn.CreateCommand())
{
Expand Down Expand Up @@ -358,7 +366,7 @@ public void TestWithAllQueryTypes()
{
conn.ConnectionString = ConnectionString;
conn.Open();
SessionParameterAlterer.SetResultFormat(conn, ResultFormat.JSON);
SessionParameterAlterer.SetResultFormat(conn, _resultFormat);

using (DbCommand cmd = conn.CreateCommand())
{
Expand Down Expand Up @@ -459,7 +467,7 @@ public void TestWithMultipleStatementSetting()
{
conn.ConnectionString = ConnectionString;
conn.Open();
SessionParameterAlterer.SetResultFormat(conn, ResultFormat.JSON);
SessionParameterAlterer.SetResultFormat(conn, _resultFormat);

using (DbCommand cmd = conn.CreateCommand())
{
Expand Down Expand Up @@ -547,7 +555,7 @@ public void TestResultSetReturnedForAllQueryTypes()
{
conn.ConnectionString = ConnectionString;
conn.Open();
SessionParameterAlterer.SetResultFormat(conn, ResultFormat.JSON);
SessionParameterAlterer.SetResultFormat(conn, _resultFormat);

using (DbCommand cmd = conn.CreateCommand())
{
Expand Down
14 changes: 7 additions & 7 deletions Snowflake.Data/Core/ArrowResultSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

private void ReadChunk(QueryExecResponseData responseData)
{
if (responseData.rowsetBase64.Length > 0)
if (responseData.rowsetBase64?.Length > 0)
{
using (var stream = new MemoryStream(Convert.FromBase64String(responseData.rowsetBase64)))
{
Expand Down Expand Up @@ -297,7 +297,7 @@
case int ret: return ret;
case short ret: return ret;
case sbyte ret: return ret;
default: return (decimal)value;
default: return Convert.ToDecimal(value);
}
}

Expand All @@ -312,7 +312,7 @@
case int ret: return ret;
case short ret: return ret;
case sbyte ret: return ret;
default: return (double)value;
default: return Convert.ToDouble(value);
}
}

Expand All @@ -327,7 +327,7 @@
case int ret: return ret;
case short ret: return ret;
case sbyte ret: return ret;
default: return (float)value;
default: return Convert.ToSingle(value);

Check warning on line 330 in Snowflake.Data/Core/ArrowResultSet.cs

View check run for this annotation

Codecov / codecov/patch

Snowflake.Data/Core/ArrowResultSet.cs#L330

Added line #L330 was not covered by tests
}
}

Expand All @@ -347,7 +347,7 @@
case long ret: return (short)ret;
case int ret: return (short)ret;
case sbyte ret: return ret;
default: return (short)value;
default: return Convert.ToInt16(value);
}
}
}
Expand All @@ -363,7 +363,7 @@
case long ret: return (int)ret;
case short ret: return ret;
case sbyte ret: return ret;
default: return (int)value;
default: return Convert.ToInt32(value);
}
}
}
Expand All @@ -379,7 +379,7 @@
case int ret: return ret;
case short ret: return ret;
case sbyte ret: return ret;
default: return (long)value;
default: return Convert.ToInt64(value);
}
}
}
Expand Down