From 70dc76057c5e61497a5ef495df2a90c91335b44b Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 8 Dec 2010 00:56:08 +0000 Subject: - Don't specify DEFAULT '' when saving TEXT, BLOB or geometry field types; this avoids errors in strict mode --- Source/SPTableStructure.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Source/SPTableStructure.m') diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 79a0a0a2..f57a881f 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -1015,8 +1015,9 @@ else if ([[theRow objectForKey:@"default"] length] && [theRowType isEqualToString:@"BIT"]) { [queryString appendFormat:@"\n DEFAULT %@", [theRow objectForKey:@"default"]]; } - // Suppress appending DEFAULT clause for any numerics, date, time fields if default is empty to avoid error messages - else if (![[theRow objectForKey:@"default"] length] && ([fieldValidation isFieldTypeNumeric:theRowType] || [fieldValidation isFieldTypeDate:theRowType])) { + // Suppress appending DEFAULT clause for any numerics, date, time fields if default is empty to avoid error messages; + // also don't specify a default for TEXT/BLOB or geometry fields to avoid strict mode errors + else if (![[theRow objectForKey:@"default"] length] && ([fieldValidation isFieldTypeNumeric:theRowType] || [fieldValidation isFieldTypeDate:theRowType] || [theRowType hasSuffix:@"TEXT"] || [theRowType hasSuffix:@"BLOB"] || [fieldValidation isFieldTypeGeometry:theRowType])) { ; } // Otherwise, use the provided default -- cgit v1.2.3