aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2017-11-17 23:28:41 +0100
committerMax <post@wickenrode.com>2017-11-17 23:28:41 +0100
commitb04ca67477ffa1bb3baa4de64c9ce9796e017f47 (patch)
tree99766d3cc5fd0f235876f3ce25f6eee5e4ce1896
parentb9a2d6c138a477092ea63b209ed00f8bf47e331b (diff)
downloadsequelpro-b04ca67477ffa1bb3baa4de64c9ce9796e017f47.tar.gz
sequelpro-b04ca67477ffa1bb3baa4de64c9ce9796e017f47.tar.bz2
sequelpro-b04ca67477ffa1bb3baa4de64c9ce9796e017f47.zip
SQL export used the wrong syntax for view placeholders when the columns contained a type with decimals (#2927)
-rw-r--r--Source/SPSQLExporter.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m
index cb085e39..c6f8f984 100644
--- a/Source/SPSQLExporter.m
+++ b/Source/SPSQLExporter.m
@@ -840,7 +840,12 @@
// 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"]];