aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-03-11 13:18:56 +0000
committerrowanbeentje <rowan@beent.je>2009-03-11 13:18:56 +0000
commitacc30a5c45ca9b2d1a8fa34c21785fcd4d98a38a (patch)
treedc2d576baa14a5270bfd33ec4e78fbf9d18f1b76 /Source
parent412199cb8c10dfb18834f7d89bfd72b6558540a5 (diff)
downloadsequelpro-acc30a5c45ca9b2d1a8fa34c21785fcd4d98a38a.tar.gz
sequelpro-acc30a5c45ca9b2d1a8fa34c21785fcd4d98a38a.tar.bz2
sequelpro-acc30a5c45ca9b2d1a8fa34c21785fcd4d98a38a.zip
- Fix an old bug where adding rows when "Reload table after adding a row" was switched off inserted the wrong value for autoincrement columns, throwing exceptions and breaking SP
- Fix a bug in the autoincrement check which exposed the bug above even when no autoincrement was set.
Diffstat (limited to 'Source')
-rw-r--r--Source/TableContent.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m
index 9548f191..18610c10 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -1265,8 +1265,8 @@
// Set the insertId for fields with auto_increment
for ( i = 0; i < [theColumns count] ; i++ ) {
- if ([[theColumns objectAtIndex:i] objectForKey:@"autoincrement"]) {
- [[filteredResult objectAtIndex:currentlyEditingRow] setObject:[NSNumber numberWithLong:[mySQLConnection insertId]]
+ if ([[[theColumns objectAtIndex:i] objectForKey:@"autoincrement"] intValue]) {
+ [[filteredResult objectAtIndex:currentlyEditingRow] setObject:[[NSNumber numberWithLong:[mySQLConnection insertId]] description]
forKey:[columnNames objectAtIndex:i]];
}
}