aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-09-16 12:09:35 +0000
committerBibiko <bibiko@eva.mpg.de>2010-09-16 12:09:35 +0000
commit902695800b7a760c138bc84ae982d5c5b826a437 (patch)
tree121268fec3959566785809c4e095a3b94fea8c53 /Source/SPTableContent.m
parent11f9f5a153ca055e4f104dc6494745e1c4f38518 (diff)
downloadsequelpro-902695800b7a760c138bc84ae982d5c5b826a437.tar.gz
sequelpro-902695800b7a760c138bc84ae982d5c5b826a437.tar.bz2
sequelpro-902695800b7a760c138bc84ae982d5c5b826a437.zip
• BIT Field Sheet Editor now can handle NULL values
• Field Editor Sheet field name label also displays NOT NULL if set
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 99e34af1..cff8a675 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -3522,12 +3522,16 @@
NSString *fieldType = nil;
NSUInteger *fieldLength = 0;
NSString *fieldEncoding = nil;
+ BOOL allowNULL = YES;
+
// Retrieve the column defintion
for(id c in cqColumnDefinition) {
if([[c objectForKey:@"datacolumnindex"] isEqualToNumber:[aTableColumn identifier]]) {
fieldType = [c objectForKey:@"type"];
if([c objectForKey:@"char_length"])
fieldLength = [[c objectForKey:@"char_length"] integerValue];
+ if([c objectForKey:@"null"])
+ allowNULL = (![[c objectForKey:@"null"] integerValue]);
if([c objectForKey:@"charset_name"] && ![[c objectForKey:@"charset_name"] isEqualToString:@"binary"])
fieldEncoding = [c objectForKey:@"charset_name"];
break;
@@ -3539,6 +3543,7 @@
[fieldEditor setTextMaxLength:fieldLength];
[fieldEditor setFieldType:(fieldType==nil) ? @"" : fieldType];
[fieldEditor setFieldEncoding:(fieldEncoding==nil) ? @"" : fieldEncoding];
+ [fieldEditor setAllowNULL:allowNULL];
id cellValue = [tableValues cellDataAtRow:rowIndex column:[[aTableColumn identifier] integerValue]];
if ([cellValue isNSNull]) cellValue = [NSString stringWithString:[prefs objectForKey:SPNullValue]];