Skip to content

Commit b04ca67

Browse files
committed
SQL export used the wrong syntax for view placeholders when the columns contained a type with decimals (#2927)
1 parent b9a2d6c commit b04ca67

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Source/SPSQLExporter.m

+6-1
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,12 @@ - (NSString *)_createViewPlaceholderSyntaxForView:(NSString *)viewName
840840

841841
// Add the type and length information as appropriate
842842
if ([column objectForKey:@"length"]) {
843-
[fieldString appendFormat:@" %@(%@)", [column objectForKey:@"type"], [column objectForKey:@"length"]];
843+
NSString *length = [column objectForKey:@"length"];
844+
NSString *decimals = [column objectForKey:@"decimals"];
845+
if([decimals length]) {
846+
length = [length stringByAppendingFormat:@",%@", decimals];
847+
}
848+
[fieldString appendFormat:@" %@(%@)", [column objectForKey:@"type"], length];
844849
}
845850
else if ([column objectForKey:@"values"]) {
846851
[fieldString appendFormat:@" %@(", [column objectForKey:@"type"]];

0 commit comments

Comments
 (0)