Fix for rowId not decrementing if reverting an create row (#1560)

* Decrement NextRowId if reverting addition of a row that is not committed yet.

* added test and message

* added fixed and extensive tests

* added assert messages
This commit is contained in:
Alex Ma
2022-06-27 14:47:46 -07:00
committed by GitHub
parent b24202a762
commit deae354f31
2 changed files with 72 additions and 0 deletions

View File

@@ -380,6 +380,12 @@ namespace Microsoft.SqlTools.ServiceLayer.EditData
{
throw new ArgumentOutOfRangeException(nameof(rowId), SR.EditDataUpdateNotPending);
}
// Remove the increment of the NextRow ID if we're reverting a CreateRow, as we are not actually adding a row.
if (typeof(RowCreate) == removedEdit.GetType())
{
NextRowId--;
}
}
/// <summary>