aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m5
-rw-r--r--Source/SPNavigatorController.m7
2 files changed, 5 insertions, 7 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
index 6dac15b3..6b6ccc22 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
@@ -1931,6 +1931,7 @@ void performThreadedKeepAlive(void *ptr)
NSMutableArray *allDbNames = [NSMutableArray array];
NSMutableArray *allTableNames = [NSMutableArray array];
+ // id to make any key unique
NSString *connectionID;
if([delegate respondsToSelector:@selector(connectionID)])
connectionID = [NSString stringWithString:[[self delegate] connectionID]];
@@ -1938,10 +1939,12 @@ void performThreadedKeepAlive(void *ptr)
connectionID = @"_";
NSString *SPUniqueSchemaDelimiter = @"￸";
+ NSUInteger cnt = 0; // used to make field data unique
[structure setObject:[NSMutableDictionary dictionary] forKey:connectionID];
while(row = mysql_fetch_row(theResult)) {
+ cnt++;
NSString *db = [self stringWithUTF8CString:row[0]];
NSString *db_id = [NSString stringWithFormat:@"%@%@%@", connectionID, SPUniqueSchemaDelimiter, db];
NSString *table = [self stringWithUTF8CString:row[1]];
@@ -1968,7 +1971,7 @@ void performThreadedKeepAlive(void *ptr)
[[[structure valueForKey:connectionID] valueForKey:db_id] setObject:[NSMutableDictionary dictionary] forKey:table_id];
}
- [[[[structure valueForKey:connectionID] valueForKey:db_id] valueForKey:table_id] setObject:[NSArray arrayWithObjects:type, charset, key, extra, priv, nil] forKey:field_id];
+ [[[[structure valueForKey:connectionID] valueForKey:db_id] valueForKey:table_id] setObject:[NSArray arrayWithObjects:type, charset, key, extra, priv, [NSNumber numberWithUnsignedLongLong:cnt], nil] forKey:field_id];
[[[[structure valueForKey:connectionID] valueForKey:db_id] valueForKey:table_id] setObject:structtype forKey:@" struct_type "];
}
diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m
index 1dc53bcd..1520957b 100644
--- a/Source/SPNavigatorController.m
+++ b/Source/SPNavigatorController.m
@@ -142,8 +142,6 @@ static SPNavigatorController *sharedNavigatorController = nil;
if(selectedItem1) {
NSInteger itemIndex = [outlineSchema1 rowForItem:selectedItem1];
if (itemIndex < 0) {
- // You need to decide what happens if the item doesn't exist
- NSLog(@"1");
return;
}
@@ -152,8 +150,6 @@ static SPNavigatorController *sharedNavigatorController = nil;
if(selectedItem2) {
NSInteger itemIndex = [outlineSchema2 rowForItem:selectedItem2];
if (itemIndex < 0) {
- // You need to decide what happens if the item doesn't exist
- NSLog(@"2");
return;
}
@@ -178,8 +174,7 @@ static SPNavigatorController *sharedNavigatorController = nil;
NSSortDescriptor *desc = [[NSSortDescriptor alloc] initWithKey:nil ascending:YES selector:@selector(localizedCompare:)];
NSArray *sortedItems = [[item allKeys] sortedArrayUsingDescriptors:[NSArray arrayWithObject:desc]];
[desc release];
- // if(index < [sortedItems count])
- return [item objectForKey:[sortedItems objectAtIndex:index]];
+ return [item objectForKey:[sortedItems objectAtIndex:index]];
}
else if ([item isKindOfClass:[NSArray class]])
{