From 81bb447b85556d3544fc3195cd2d40bae7200d39 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 7 Jul 2009 00:20:52 +0000 Subject: - Fix placeholder exports of views containing enums, improving on r959 --- Source/TableDump.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Source') diff --git a/Source/TableDump.m b/Source/TableDump.m index cf90eb1a..a902e17b 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -2027,7 +2027,7 @@ NSMutableString *placeholderSyntax, *fieldString; NSArray *viewColumns; NSDictionary *column; - int i; + int i, j; // Get structured information for the view via the SPTableData parsers viewInformation = [tableDataInstance informationForView:viewName]; @@ -2046,6 +2046,12 @@ // Add the type and length information as appropriate if ([column objectForKey:@"length"]) { [fieldString appendFormat:@" %@(%@)", [column objectForKey:@"type"], [column objectForKey:@"length"]]; + } else if ([column objectForKey:@"values"]) { + [fieldString appendFormat:@" %@(", [column objectForKey:@"type"]]; + for (j = 0; j < [[column objectForKey:@"values"] count]; j++) { + [fieldString appendFormat:@"'%@'%@", [mySQLConnection prepareString:[[column objectForKey:@"values"] objectAtIndex:j]], (j+1 == [[column objectForKey:@"values"] count])?@"":@","]; + } + [fieldString appendString:@")"]; } else { [fieldString appendFormat:@" %@", [column objectForKey:@"type"]]; } -- cgit v1.2.3