aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseStructure.m
diff options
context:
space:
mode:
authordmoagx <post@wickenrode.com>2013-04-24 21:53:21 +0000
committerdmoagx <post@wickenrode.com>2013-04-24 21:53:21 +0000
commit0d1d1108d3d7a4b191e5773357038c4354387ffb (patch)
tree4bea500c6edc7589f864aab0f825d83b50d38097 /Source/SPDatabaseStructure.m
parent974a17c6403e75eb23eef4a270ff0d70b37c91de (diff)
downloadsequelpro-0d1d1108d3d7a4b191e5773357038c4354387ffb.tar.gz
sequelpro-0d1d1108d3d7a4b191e5773357038c4354387ffb.tar.bz2
sequelpro-0d1d1108d3d7a4b191e5773357038c4354387ffb.zip
* Changed a query (addressing issue #1687)
* Make some strings localizable
Diffstat (limited to 'Source/SPDatabaseStructure.m')
-rw-r--r--Source/SPDatabaseStructure.m18
1 files changed, 9 insertions, 9 deletions
diff --git a/Source/SPDatabaseStructure.m b/Source/SPDatabaseStructure.m
index c342e2cb..399fe3f7 100644
--- a/Source/SPDatabaseStructure.m
+++ b/Source/SPDatabaseStructure.m
@@ -480,19 +480,19 @@
return;
}
- // Retrieve the column details
- theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT * FROM `information_schema`.`ROUTINES` WHERE `information_schema`.`ROUTINES`.`ROUTINE_SCHEMA` = '%@'", [currentDatabase stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"]]];
+ // Retrieve the column details (only those we need so we don't fetch the whole function body which might be huge)
+ theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT SPECIFIC_NAME, ROUTINE_TYPE, DTD_IDENTIFIER, IS_DETERMINISTIC, SQL_DATA_ACCESS, SECURITY_TYPE, DEFINER FROM `information_schema`.`ROUTINES` WHERE `ROUTINE_SCHEMA` = %@", [currentDatabase tickQuotedString]]];
[theResult setDefaultRowReturnType:SPMySQLResultRowAsArray];
// Loop through the rows and extract the function details
for (NSArray *row in theResult) {
- NSString *fname = [row objectAtIndex:0];
- NSString *type = ([[row objectAtIndex:4] isEqualToString:@"FUNCTION"]) ? @"3" : @"2";
- NSString *dtd = [row objectAtIndex:5];
- NSString *det = [row objectAtIndex:11];
- NSString *dataaccess = [row objectAtIndex:12];
- NSString *security_type = [row objectAtIndex:14];
- NSString *definer = [row objectAtIndex:19];
+ NSString *fname = [row objectAtIndex:0];
+ NSString *type = ([[row objectAtIndex:1] isEqualToString:@"FUNCTION"]) ? @"3" : @"2";
+ NSString *dtd = [row objectAtIndex:2];
+ NSString *det = [row objectAtIndex:3];
+ NSString *dataaccess = [row objectAtIndex:4];
+ NSString *security_type = [row objectAtIndex:5];
+ NSString *definer = [row objectAtIndex:6];
// Generate "table" and "field" names and add to structure key store
NSString *table_id = [NSString stringWithFormat:@"%@%@%@", db_id, SPUniqueSchemaDelimiter, fname];