From 152ae1b1479474f1c9a57d27e4d64f66ac7649a3 Mon Sep 17 00:00:00 2001 From: mltownsend Date: Mon, 24 May 2010 18:29:56 +0000 Subject: Addition fix for issue#699 --- Source/SPUserManager.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 4ed2675e..4e27b407 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -1226,7 +1226,8 @@ - (NSArray *)_fetchPrivsWithUser:(NSString *)username schema:(NSString *)selectedSchema host:(NSString *)host { NSManagedObjectContext *moc = [self managedObjectContext]; - NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(user.parent.user like[cd] %@) AND (user.host like[cd] %@) AND (db like[cd] %@)", username, host, selectedSchema]; + NSPredicate *predicate = + [NSPredicate predicateWithFormat:@"(user.parent.user like[cd] %@) AND (user.host like[cd] %@) AND (db like[cd] %@)", username, host, selectedSchema]; NSEntityDescription *privEntity = [NSEntityDescription entityForName:@"Privileges" inManagedObjectContext:moc]; NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease]; @@ -1376,6 +1377,7 @@ // Check to see if the user host node was selected if ([user valueForKey:@"host"]) { NSString *selectedSchema = [[[schemaController selectedObjects] objectAtIndex:0] valueForKey:@"Database"]; + selectedSchema = [selectedSchema stringByReplacingOccurrencesOfString:@"_" withString:@"\\\\_"]; NSArray *results = [self _fetchPrivsWithUser:[[user parent] valueForKey:@"user"] schema:selectedSchema host:[user valueForKey:@"host"]]; if ([results count] > 0) { -- cgit v1.2.3