aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormltownsend <mltownsend@gmail.com>2010-05-24 18:29:56 +0000
committermltownsend <mltownsend@gmail.com>2010-05-24 18:29:56 +0000
commit152ae1b1479474f1c9a57d27e4d64f66ac7649a3 (patch)
tree4857a20fb8b85dacf9443f26af6e2ec3e0d3aafa
parentbbe0f861dd4e3ab99aa3d555d3fc5db5ee5ae39d (diff)
downloadsequelpro-152ae1b1479474f1c9a57d27e4d64f66ac7649a3.tar.gz
sequelpro-152ae1b1479474f1c9a57d27e4d64f66ac7649a3.tar.bz2
sequelpro-152ae1b1479474f1c9a57d27e4d64f66ac7649a3.zip
Addition fix for issue#699
-rw-r--r--Source/SPUserManager.m4
1 files changed, 3 insertions, 1 deletions
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) {