-
- Notifications
You must be signed in to change notification settings - Fork 74
Correction of the return values of the DatabaseInfo methods for determining the insert, read and delete operations #1183
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
b492cce c39be07 1fd2464 9112e28 c00d785 124e5f3 c43a1bf 72ed318 aa0d9f7 2acda4a 7edc7ee 367af06 600fb37 3f1e72c a9311a0 cef7087 e720df4 bf09d5a fa0f53c 9470f22 187ab1c fe4c525 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -64,24 +64,24 @@ public void CompleteDatabaseInfoTest() | |
| } | ||
| | ||
| [Test] | ||
| public void PerformanceAnalysis_SELECT_Test() | ||
| public async Task PerformanceAnalysis_SELECT_Test() | ||
| { | ||
| IDictionary<string, short> tableNameList = GetTableNameList(); | ||
| short tableIdTest = tableNameList["TEST"]; | ||
| | ||
| var dbInfo = new FbDatabaseInfo(Connection); | ||
| IDictionary<short, ulong> insertCount = dbInfo.GetInsertCount(); | ||
| IDictionary<short, ulong> updateCount = dbInfo.GetUpdateCount(); | ||
| IDictionary<short, ulong> readSeqCount = dbInfo.GetReadSeqCount(); | ||
| IDictionary<short, ulong> readIdxCount = dbInfo.GetReadIdxCount(); | ||
| var insertCount = await dbInfo.GetInsertCountAsync(); | ||
| var updateCount = await dbInfo.GetUpdateCountAsync(); | ||
| var readSeqCount = await dbInfo.GetReadSeqCountAsync(); | ||
| var readIdxCount = await dbInfo.GetReadIdxCountAsync(); | ||
| | ||
| var fbCommand = new FbCommand("SELECT MAX(INT_FIELD) FROM TEST", Connection); | ||
| var maxIntField = fbCommand.ExecuteScalar() as int?; | ||
| var maxIntField = await fbCommand.ExecuteScalarAsync() as int?; | ||
| | ||
| insertCount = GetAffectedTables(insertCount, dbInfo.GetInsertCount()); | ||
| updateCount = GetAffectedTables(updateCount, dbInfo.GetUpdateCount()); | ||
| readSeqCount = GetAffectedTables(readSeqCount, dbInfo.GetReadSeqCount()); | ||
| readIdxCount = GetAffectedTables(readIdxCount, dbInfo.GetReadIdxCount()); | ||
| insertCount = GetAffectedTables(insertCount, await dbInfo.GetInsertCountAsync()); | ||
| updateCount = GetAffectedTables(updateCount, await dbInfo.GetUpdateCountAsync()); | ||
| readSeqCount = GetAffectedTables(readSeqCount, await dbInfo.GetReadSeqCountAsync()); | ||
| readIdxCount = GetAffectedTables(readIdxCount, await dbInfo.GetReadIdxCountAsync()); | ||
| | ||
| Assert.That(insertCount.ContainsKey(tableIdTest), Is.False); | ||
| Assert.That(updateCount.ContainsKey(tableIdTest), Is.False); | ||
| | @@ -91,24 +91,24 @@ public void PerformanceAnalysis_SELECT_Test() | |
| } | ||
| | ||
| [Test] | ||
| public void PerformanceAnalysis_INSERT_Test() | ||
| public async Task PerformanceAnalysis_INSERT_Test() | ||
| { | ||
| IDictionary<string, short> tableNameList = GetTableNameList(); | ||
| short tableIdTest = tableNameList["TEST"]; | ||
| | ||
| var dbInfo = new FbDatabaseInfo(Connection); | ||
| IDictionary<short, ulong> insertCount = dbInfo.GetInsertCount(); | ||
| IDictionary<short, ulong> updateCount = dbInfo.GetUpdateCount(); | ||
| IDictionary<short, ulong> readSeqCount = dbInfo.GetReadSeqCount(); | ||
| IDictionary<short, ulong> readIdxCount = dbInfo.GetReadIdxCount(); | ||
| var insertCount = await dbInfo.GetInsertCountAsync(); | ||
| var updateCount = await dbInfo.GetUpdateCountAsync(); | ||
| var readSeqCount = await dbInfo.GetReadSeqCountAsync(); | ||
| var readIdxCount = await dbInfo.GetReadIdxCountAsync(); | ||
| | ||
| var fbCommand = new FbCommand("INSERT INTO TEST (INT_FIELD) VALUES (900)", Connection); | ||
| Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not look like it's here. | ||
| fbCommand.ExecuteNonQuery(); | ||
| await fbCommand.ExecuteNonQueryAsync(); | ||
| | ||
| insertCount = GetAffectedTables(insertCount, dbInfo.GetInsertCount()); | ||
| updateCount = GetAffectedTables(updateCount, dbInfo.GetUpdateCount()); | ||
| readSeqCount = GetAffectedTables(readSeqCount, dbInfo.GetReadSeqCount()); | ||
| readIdxCount = GetAffectedTables(readIdxCount, dbInfo.GetReadIdxCount()); | ||
| insertCount = GetAffectedTables(insertCount, await dbInfo.GetInsertCountAsync()); | ||
| updateCount = GetAffectedTables(updateCount, await dbInfo.GetUpdateCountAsync()); | ||
| readSeqCount = GetAffectedTables(readSeqCount, await dbInfo.GetReadSeqCountAsync()); | ||
| readIdxCount = GetAffectedTables(readIdxCount, await dbInfo.GetReadIdxCountAsync()); | ||
| | ||
| Assert.That(insertCount.ContainsKey(tableIdTest), Is.True); | ||
| Assert.That(insertCount[tableIdTest], Is.EqualTo(1)); | ||
| | @@ -118,7 +118,7 @@ public void PerformanceAnalysis_INSERT_Test() | |
| } | ||
| | ||
| [Test] | ||
| public void PerformanceAnalysis_UPDATE_Test() | ||
| public async Task PerformanceAnalysis_UPDATE_Test() | ||
| { | ||
| IDictionary<string, short> tableNameList = GetTableNameList(); | ||
| short tableIdTest = tableNameList["TEST"]; | ||
| | @@ -127,18 +127,18 @@ public void PerformanceAnalysis_UPDATE_Test() | |
| fbCommand.ExecuteNonQuery(); | ||
| | ||
| var dbInfo = new FbDatabaseInfo(Connection); | ||
| IDictionary<short, ulong> insertCount = dbInfo.GetInsertCount(); | ||
| IDictionary<short, ulong> updateCount = dbInfo.GetUpdateCount(); | ||
| IDictionary<short, ulong> readSeqCount = dbInfo.GetReadSeqCount(); | ||
| IDictionary<short, ulong> readIdxCount = dbInfo.GetReadIdxCount(); | ||
| var insertCount = await dbInfo.GetInsertCountAsync(); | ||
| var updateCount = await dbInfo.GetUpdateCountAsync(); | ||
| var readSeqCount = await dbInfo.GetReadSeqCountAsync(); | ||
| var readIdxCount = await dbInfo.GetReadIdxCountAsync(); | ||
| | ||
| fbCommand.CommandText = "UPDATE TEST SET SMALLINT_FIELD = 900 WHERE (INT_FIELD = 900)"; | ||
| fbCommand.ExecuteNonQuery(); | ||
| await fbCommand.ExecuteNonQueryAsync(); | ||
| | ||
| insertCount = GetAffectedTables(insertCount, dbInfo.GetInsertCount()); | ||
| updateCount = GetAffectedTables(updateCount, dbInfo.GetUpdateCount()); | ||
| readSeqCount = GetAffectedTables(readSeqCount, dbInfo.GetReadSeqCount()); | ||
| readIdxCount = GetAffectedTables(readIdxCount, dbInfo.GetReadIdxCount()); | ||
| insertCount = GetAffectedTables(insertCount, await dbInfo.GetInsertCountAsync()); | ||
| updateCount = GetAffectedTables(updateCount, await dbInfo.GetUpdateCountAsync()); | ||
| readSeqCount = GetAffectedTables(readSeqCount, await dbInfo.GetReadSeqCountAsync()); | ||
| readIdxCount = GetAffectedTables(readIdxCount, await dbInfo.GetReadIdxCountAsync()); | ||
| | ||
| Assert.That(insertCount.ContainsKey(tableIdTest), Is.False); | ||
| Assert.That(updateCount.ContainsKey(tableIdTest), Is.True); | ||
| | @@ -157,7 +157,9 @@ private IDictionary<short, ulong> GetAffectedTables(IDictionary<short, ulong> aS | |
| { | ||
| ulong counter = keyValuePair.Value - value; | ||
cincuranet marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| if (counter > 0) | ||
| { | ||
| result.Add(keyValuePair.Key, counter); | ||
| } | ||
| } | ||
| else | ||
| Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add Contributor Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not look like it's here. | ||
| result.Add(keyValuePair.Key, keyValuePair.Value); | ||
| | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await usingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not look like it's here.