Skip to content

Commit

Permalink
Fixes for review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-hx committed Oct 10, 2023
1 parent 41bd575 commit 0398550
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
29 changes: 17 additions & 12 deletions Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,21 +182,26 @@ public void TestDateOutputFormat()
conn.ConnectionString = ConnectionString;
conn.Open();

IDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "alter session set DATE_OUTPUT_FORMAT='MM/DD/YYYY'";
cmd.ExecuteNonQuery();

cmd.CommandText = $"select TO_DATE('2013-05-17')";
IDataReader reader = cmd.ExecuteReader();
try
{
IDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "alter session set DATE_OUTPUT_FORMAT='MM/DD/YYYY'";
cmd.ExecuteNonQuery();

Assert.IsTrue(reader.Read());
Assert.AreEqual("05/17/2013", reader.GetString(0));
cmd.CommandText = $"select TO_DATE('2013-05-17')";
IDataReader reader = cmd.ExecuteReader();

reader.Close();
Assert.IsTrue(reader.Read());
Assert.AreEqual("05/17/2013", reader.GetString(0));

// set format back to default to avoid impact other test cases
cmd.CommandText = "alter session set DATE_OUTPUT_FORMAT='YYYY-MM-DD'";
cmd.ExecuteNonQuery();
reader.Close();
}
finally
{
// set format back to default to avoid impact other test cases
cmd.CommandText = "alter session set DATE_OUTPUT_FORMAT='YYYY-MM-DD'";

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 202 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

The name 'cmd' does not exist in the current context
cmd.ExecuteNonQuery();

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Linux (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on MAC (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net6.0, AWS)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

The name 'cmd' does not exist in the current context

Check failure on line 203 in Snowflake.Data.Tests/IntegrationTests/SFDbDataReaderIT.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

The name 'cmd' does not exist in the current context
}

conn.Close();
}
Expand Down
4 changes: 2 additions & 2 deletions Snowflake.Data/Core/Session/SFSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,11 @@ internal void UpdateDatabaseAndSchema(string databaseName, string schemaName)
{
// with HTAP session metadata removal database/schema
// might be not returened in query result
if (databaseName != null)
if (!String.IsNullOrEmpty(databaseName))
{
this.database = databaseName;
}
if (schemaName != null)
if (!String.IsNullOrEmpty(schemaName))
{
this.schema = schemaName;
}
Expand Down

0 comments on commit 0398550

Please sign in to comment.