Skip to content

Commit

Permalink
Incorporated review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
machavan committed Dec 19, 2024
1 parent 700153d commit 286367b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ boolean onDone(TDSReader tdsReader) throws SQLServerException {
return false;

//For Insert, we must fetch additional TDS_DONE token that comes with the actual update count
if (doneToken.cmdIsInsert() && (-1 != doneToken.getUpdateCount()) && EXECUTE == executeMethod) {
if ((StreamDone.CMD_INSERT == doneToken.getCurCmd()) && (-1 != doneToken.getUpdateCount()) && EXECUTE == executeMethod) {
return true;
}

Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/microsoft/sqlserver/jdbc/StreamDone.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ final long getUpdateCount() {
}
}

final boolean cmdIsInsert() {
return (CMD_INSERT == curCmd);
}

final boolean cmdIsDMLOrDDL() {
switch (curCmd) {
case CMD_INSERT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2713,15 +2713,12 @@ public void setup() throws Exception {
try (Statement stmt = con.createStatement()) {
TestUtils.dropTriggerIfExists(triggerName, stmt);
stmt.executeUpdate("CREATE TABLE " + tableName + " (ID int NOT NULL IDENTITY(1,1) PRIMARY KEY, NAME varchar(32));");

stmt.executeUpdate("CREATE TABLE " + idTableName + "(ID int NOT NULL IDENTITY(1,1) PRIMARY KEY);");

stmt.executeUpdate("CREATE TRIGGER " + triggerName + " ON " + tableName + " FOR INSERT AS INSERT INTO " + idTableName + " DEFAULT VALUES;");

stmt.executeUpdate("CREATE TRIGGER " + triggerName + " ON " + tableName +
" FOR INSERT AS INSERT INTO " + idTableName + " DEFAULT VALUES;");
for (int i = 0; i < NUM_ROWS; i++) {
stmt.executeUpdate("INSERT INTO " + tableName + " (NAME) VALUES ('test')");
}

}
con.commit();
}
Expand Down Expand Up @@ -3012,5 +3009,5 @@ public void terminate() throws Exception {
}
}
}

}

0 comments on commit 286367b

Please sign in to comment.