Skip to content

Commit

Permalink
Warning log spam correction and test exclusion (#2377)
Browse files Browse the repository at this point in the history
* Removed warning message

* Excluded test from DW

* Excluded test from DW p2
  • Loading branch information
tkyc authored Apr 3, 2024
1 parent 1f0d85a commit 9de1a5d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6943,10 +6943,6 @@ final boolean readPacket() throws SQLServerException {

// if messageType is RPC or QUERY, then increment Counter's state
if (tdsChannel.getWriter().checkIfTdsMessageTypeIsBatchOrRPC() && null != command) {
if (logger.isLoggable(Level.FINER)) {
logger.warning(toString() + ": increasing state of counter for TDS Command: " + command.toString());
}

if (null == command.getCounter()) {
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_NullValue"));
Object[] msgArgs1 = {"TDS command counter"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,16 @@ public void testValidateColumnMetadata() throws SQLException {
}

@Test
@Tag(Constants.xAzureSQLDW)
public void shouldEscapeSchemaName() throws SQLException {
try (Statement stmt = connection.createStatement()) {
stmt.execute("CREATE SCHEMA " + schema);
stmt.execute("CREATE TABLE " + tableNameWithSchema + " (id UNIQUEIDENTIFIER, name NVARCHAR(400));");
stmt.execute("CREATE PROCEDURE " + sprocWithSchema + "(@id UNIQUEIDENTIFIER, @name VARCHAR(400)) AS " +
"BEGIN SET TRANSACTION ISOLATION LEVEL SERIALIZABLE BEGIN TRANSACTION UPDATE "
+ tableNameWithSchema + " SET name = @name WHERE id = @id COMMIT END");
}

try (Connection con = getConnection()) {
DatabaseMetaData md = con.getMetaData();
try (ResultSet procedures = md.getProcedures(
Expand All @@ -1013,6 +1022,12 @@ public void shouldEscapeSchemaName() throws SQLException {
}
}
}

try (Statement stmt = connection.createStatement()) {
TestUtils.dropTableWithSchemaIfExists(tableNameWithSchema, stmt);
TestUtils.dropProcedureWithSchemaIfExists(sprocWithSchema, stmt);
TestUtils.dropSchemaIfExists(schema, stmt);
}
}

@BeforeAll
Expand All @@ -1024,11 +1039,6 @@ public static void setupTable() throws Exception {
+ " ([col_1] int NOT NULL, [col%2] varchar(200), [col[3] decimal(15,2))");
stmt.execute("CREATE FUNCTION " + AbstractSQLGenerator.escapeIdentifier(functionName)
+ " (@p1 INT, @p2 INT) RETURNS INT AS BEGIN DECLARE @result INT; SET @result = @p1 + @p2; RETURN @result; END");
stmt.execute("CREATE SCHEMA " + schema);
stmt.execute("CREATE TABLE " + tableNameWithSchema + " (id UNIQUEIDENTIFIER, name NVARCHAR(400));");
stmt.execute("CREATE PROCEDURE " + sprocWithSchema + "(@id UNIQUEIDENTIFIER, @name VARCHAR(400)) AS " +
"BEGIN SET TRANSACTION ISOLATION LEVEL SERIALIZABLE BEGIN TRANSACTION UPDATE "
+ tableNameWithSchema + " SET name = @name WHERE id = @id COMMIT END");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ public void testMixColumns() throws Exception {
}

@Test
@Tag((Constants.xAzureSQLDW))
public void testNullGuid() throws Exception {
String valid = "insert into " + AbstractSQLGenerator.escapeIdentifier(tableName) + " (c24) values (?)";
try (Connection connection = PrepUtil.getConnection(connectionString + ";useBulkCopyForBatchInsert=true;");
Expand Down

0 comments on commit 9de1a5d

Please sign in to comment.