Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning log spam correction and test exclusion #2377

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading