aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-01-14 01:04:22 +0000
committerrowanbeentje <rowan@beent.je>2011-01-14 01:04:22 +0000
commiteec292b2a6a348f061630bebc5bfd7d39aa57ea0 (patch)
treebab76a82233b0a2bf28bf013d5f8b03394bae6cf /Source/SPTableContent.m
parentae9a0c3c701429a6e0cd379245a4690e1933818a (diff)
downloadsequelpro-eec292b2a6a348f061630bebc5bfd7d39aa57ea0.tar.gz
sequelpro-eec292b2a6a348f061630bebc5bfd7d39aa57ea0.tar.bz2
sequelpro-eec292b2a6a348f061630bebc5bfd7d39aa57ea0.zip
- Fix problems correctly resetting state when a query affects no rows on creating new tables; this could be responsible for -release errors in SPDataStorage, as well as out-of-bounds errors in SPDataStorage or SPTableContent.
- Fix incorrect reporting of affected rows in MCPKit due to the use of meta/status queries; only track affected rows for framework-usage queries (already largely implemented in previous revisions)
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m13
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 6213549d..064b08f1 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -2498,10 +2498,19 @@
} else {
NSBeep();
}
- [tableValues replaceRowAtIndex:currentlyEditingRow withRowContents:oldRow];
+
+ // If creating a new row, remove the row; otherwise revert the row contents
+ if (isEditingNewRow) {
+ tableRowsCount--;
+ [tableValues removeRowAtIndex:currentlyEditingRow];
+ [self updateCountText];
+ isEditingNewRow = NO;
+ } else {
+ [tableValues replaceRowAtIndex:currentlyEditingRow withRowContents:oldRow];
+ }
isEditingRow = NO;
- isEditingNewRow = NO;
currentlyEditingRow = -1;
+ [tableContentView reloadData];
[[SPQueryController sharedQueryController] showErrorInConsole:NSLocalizedString(@"/* WARNING: No rows have been affected */\n", @"warning shown in the console when no rows have been affected after writing to the db") connection:[tableDocumentInstance name]];
return YES;