From acc30a5c45ca9b2d1a8fa34c21785fcd4d98a38a Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 11 Mar 2009 13:18:56 +0000 Subject: - 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. --- Source/TableContent.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/TableContent.m') 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]]; } } -- cgit v1.2.3