diff options
author | rowanbeentje <rowan@beent.je> | 2012-03-15 02:07:58 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-03-15 02:07:58 +0000 |
commit | d4baea934555c1b58eba34db68712fdb67c7871f (patch) | |
tree | 7dfb5148ae1e6740ce2031f43f7d2d6445f3ddbd /Source | |
parent | 76a070a62a076481dddfb5e5a7d8ca6de5ea64a4 (diff) | |
download | sequelpro-d4baea934555c1b58eba34db68712fdb67c7871f.tar.gz sequelpro-d4baea934555c1b58eba34db68712fdb67c7871f.tar.bz2 sequelpro-d4baea934555c1b58eba34db68712fdb67c7871f.zip |
More SPMySQLIntegration bugfixes:
- Return User Manager details as strings as some result types are marked as binary; fixes opening of user manager
- User manager schema list is now a list of databases instead of a list of database dictionaries with one key; simplify model to match
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPUserManager.m | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 3b3add1e..0e5f14cf 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -145,6 +145,7 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; // Select users from the mysql.user table SPMySQLResult *result = [self.mySqlConnection queryString:@"SELECT * FROM mysql.user ORDER BY user"]; + [result setReturnDataAsStrings:YES]; [usersResultArray addObjectsFromArray:[result getAllRows]]; [self _initializeTree:usersResultArray]; @@ -158,7 +159,6 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; if ([serverSupport supportsShowPrivileges]) { result = [self.mySqlConnection queryString:@"SHOW PRIVILEGES"]; - [result setReturnDataAsStrings:YES]; } @@ -178,8 +178,7 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; } // If that fails, base privilege support on the mysql.users columns else { - result = [self.mySqlConnection queryString:@"SHOW COLUMNS FROM mysql.user"]; - + result = [self.mySqlConnection queryString:@"SHOW COLUMNS FROM mysql.user"]; [result setReturnDataAsStrings:YES]; while ((privRow = [result getRowAsArray])) @@ -359,6 +358,7 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; [[[child parent] valueForKey:@"user"] tickQuotedString], [[child valueForKey:@"host"] tickQuotedString]]; SPMySQLResult *queryResults = [self.mySqlConnection queryString:queryString]; + [queryResults setReturnDataAsStrings:YES]; for (NSDictionary *rowDict in queryResults) { @@ -856,7 +856,7 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; // The passed in objects should be an array of NSDictionaries with a key // of "name". NSManagedObject *selectedHost = [[treeController selectedObjects] objectAtIndex:0]; - NSString *selectedDb = [[[schemaController selectedObjects] objectAtIndex:0] valueForKey:@"Database"]; + NSString *selectedDb = [[schemaController selectedObjects] objectAtIndex:0]; NSArray *selectedPrivs = [self _fetchPrivsWithUser:[selectedHost valueForKeyPath:@"parent.user"] schema:[selectedDb stringByReplacingOccurrencesOfString:@"_" withString:@"\\_"] host:[selectedHost valueForKey:@"host"]]; @@ -1535,7 +1535,7 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn"; // Check to see if the user host node was selected if ([user valueForKey:@"host"]) { - NSString *selectedSchema = [[[schemaController selectedObjects] objectAtIndex:0] valueForKey:@"Database"]; + NSString *selectedSchema = [[schemaController selectedObjects] objectAtIndex:0]; NSArray *results = [self _fetchPrivsWithUser:[[user parent] valueForKey:@"user"] schema:[selectedSchema stringByReplacingOccurrencesOfString:@"_" withString:@"\\_"] host:[user valueForKey:@"host"]]; |