Use GCSSpecialQueries in sogo-tool rename-user

Fixes #1924
The SQL syntax used by the former query would only work
with postgresql and Oracle.
(cherry picked from commit 378eef4082)
This commit is contained in:
Jean Raby
2012-11-15 10:30:21 -05:00
committed by Francis Lachapelle
parent 0b5aaa045a
commit bee27444bc
2 changed files with 54 additions and 6 deletions
+41
View File
@@ -110,6 +110,14 @@
return nil;
}
- (NSString *) updateCPathInFolderInfo: (NSString *) tableName
withCPath2: (NSString *) c_path2
{
[self subclassResponsibility: _cmd];
return nil;
}
@end
@@ -205,6 +213,17 @@
return types;
}
- (NSString *) updateCPathInFolderInfo: (NSString *) tableName
withCPath2: (NSString *) c_path2
{
static NSString *sqlFolderFormat
= (@"UPDATE %@"
@" SET c_path = '/'||c_path1||'/'||c_path2||'/'||c_path3||'/'||c_path4"
@" WHERE c_path2 = '%@'");
return [NSString stringWithFormat: sqlFolderFormat, tableName, c_path2];
}
@end
//
@@ -299,6 +318,17 @@
return types;
}
- (NSString *) updateCPathInFolderInfo: (NSString *) tableName
withCPath2: (NSString *) c_path2
{
static NSString *sqlFolderFormat
= (@"UPDATE %@"
@" SET c_path = CONCAT('/', c_path1, '/', c_path2, '/', c_path3, '/', c_path4)"
@" WHERE c_path2 = '%@'");
return [NSString stringWithFormat: sqlFolderFormat, tableName, c_path2];
}
@end
//
@@ -392,4 +422,15 @@
return types;
}
- (NSString *) updateCPathInFolderInfo: (NSString *) tableName
withCPath2: (NSString *) c_path2
{
static NSString *sqlFolderFormat
= (@"UPDATE %@"
@" SET c_path = '/'||c_path1||'/'||c_path2||'/'||c_path3||'/'||c_path4"
@" WHERE c_path2 = '%@'");
return [NSString stringWithFormat: sqlFolderFormat, tableName, c_path2];
}
@end