aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-03-09 23:22:03 +0000
committerrowanbeentje <rowan@beent.je>2013-03-09 23:22:03 +0000
commit5f3881c0f03e6d103bb09a4fb8da525b761b40dc (patch)
tree73e424b2607d01025ed7673f12f6ee794f6ffe92 /Source/SPDatabaseDocument.m
parentc51d93d760b6ad47ac4256bdf564688cb9a5d2f8 (diff)
downloadsequelpro-5f3881c0f03e6d103bb09a4fb8da525b761b40dc.tar.gz
sequelpro-5f3881c0f03e6d103bb09a4fb8da525b761b40dc.tar.bz2
sequelpro-5f3881c0f03e6d103bb09a4fb8da525b761b40dc.zip
Tweak and improve the User Manager:
- Rework how data to populate the user manager is retrieved from the server, speeding up display of lots of users by a large factor - Fix support for schema permissions for the Anonymous user, and add support for '%' and '' hostnames (only showing if already set once), fixing Issue #1620 - Highlight databases in the user manager that have permissions set for the selected user - Switch to using the centrally provided database list to reduce queries and remove the information_schema and performance_schema "databases" - Speed up a number of operations by tweaking the logic and queries used
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index f8b673ff..8286167a 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -2382,16 +2382,17 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
*/
- (IBAction)showUserManager:(id)sender
{
- if (!userManagerInstance)
- {
- userManagerInstance = [[SPUserManager alloc] init];
+ if (!userManagerInstance)
+ {
+ userManagerInstance = [[SPUserManager alloc] init];
- [userManagerInstance setConnection:mySQLConnection];
+ [userManagerInstance setDatabaseDocument:self];
+ [userManagerInstance setConnection:mySQLConnection];
[userManagerInstance setServerSupport:serverSupport];
- }
-
+ }
+
// Before displaying the user manager make sure the current user has access to the mysql.user table.
- SPMySQLResult *result = [mySQLConnection queryString:@"SELECT * FROM `mysql`.`user` ORDER BY `user`"];
+ SPMySQLResult *result = [mySQLConnection queryString:@"SELECT user FROM mysql.user LIMIT 1"];
if ([mySQLConnection queryErrored] && ([result numberOfRows] == 0)) {
@@ -2417,7 +2418,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
- (void)userManagerSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void*)context
{
- [userManagerInstance release], userManagerInstance = nil;
+ [userManagerInstance release], userManagerInstance = nil;
}
/**