Skip to content
Permalink
Browse files
SQL export used the wrong syntax for view placeholders when the colum…
…ns contained a type with decimals (#2927)
  • Loading branch information
dmoagx committed Nov 17, 2017
1 parent b9a2d6c commit b04ca67
Showing 1 changed file with 6 additions and 1 deletion.
@@ -840,7 +840,12 @@ - (NSString *)_createViewPlaceholderSyntaxForView:(NSString *)viewName

// Add the type and length information as appropriate
if ([column objectForKey:@"length"]) {
[fieldString appendFormat:@" %@(%@)", [column objectForKey:@"type"], [column objectForKey:@"length"]];
NSString *length = [column objectForKey:@"length"];
NSString *decimals = [column objectForKey:@"decimals"];
if([decimals length]) {
length = [length stringByAppendingFormat:@",%@", decimals];
}
[fieldString appendFormat:@" %@(%@)", [column objectForKey:@"type"], length];
}
else if ([column objectForKey:@"values"]) {
[fieldString appendFormat:@" %@(", [column objectForKey:@"type"]];

0 comments on commit b04ca67

Please sign in to comment.