aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCustomQuery.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-05-14 17:26:18 +0000
committerstuconnolly <stuart02@gmail.com>2011-05-14 17:26:18 +0000
commit2dbae24c7735ead0524bd9847af6ea99d8654ec6 (patch)
tree87dbed4317214da2aa9e2aed493fd7b798b3e2bc /Source/SPCustomQuery.m
parent160728cd29519794b47b3a09b139ce9d604883f0 (diff)
downloadsequelpro-2dbae24c7735ead0524bd9847af6ea99d8654ec6.tar.gz
sequelpro-2dbae24c7735ead0524bd9847af6ea99d8654ec6.tar.bz2
sequelpro-2dbae24c7735ead0524bd9847af6ea99d8654ec6.zip
Bring outline view branch up to date with trunk (r3279:r3306).
Diffstat (limited to 'Source/SPCustomQuery.m')
-rw-r--r--Source/SPCustomQuery.m17
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index a67ec5f3..26810323 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -1980,11 +1980,13 @@
if (aTableView == customQueryView) {
NSDictionary *columnDefinition;
+ NSString *columnTypeGroup;
// Retrieve the column defintion
for(id c in cqColumnDefinition) {
if([[c objectForKey:@"datacolumnindex"] isEqualToNumber:[aTableColumn identifier]]) {
columnDefinition = [NSDictionary dictionaryWithDictionary:c];
+ columnTypeGroup = [columnDefinition objectForKey:@"typegrouping"];
break;
}
}
@@ -2018,13 +2020,16 @@
} else {
if ( [[anObject description] isEqualToString:@"CURRENT_TIMESTAMP"] ) {
newObject = @"CURRENT_TIMESTAMP";
- } else if([anObject isEqualToString:[prefs stringForKey:SPNullValue]]) {
+ } else if ([anObject isEqualToString:[prefs stringForKey:SPNullValue]]
+ || (([columnTypeGroup isEqualToString:@"float"] || [columnTypeGroup isEqualToString:@"integer"])
+ && [[anObject description] isEqualToString:@""]))
+ {
newObject = @"NULL";
- } else if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"geometry"]) {
+ } else if ([columnTypeGroup isEqualToString:@"geometry"]) {
newObject = [(NSString*)anObject getGeomFromTextString];
- } else if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"bit"]) {
+ } else if ([columnTypeGroup isEqualToString:@"bit"]) {
newObject = [NSString stringWithFormat:@"b'%@'", ((![[anObject description] length] || [[anObject description] isEqualToString:@"0"]) ? @"0" : [anObject description])];
- } else if ([[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"date"]
+ } else if ([columnTypeGroup isEqualToString:@"date"]
&& [[anObject description] isEqualToString:@"NOW()"]) {
newObject = @"NOW()";
} else {
@@ -3868,6 +3873,10 @@
// Call the field editor sheet
[self tableView:customQueryView shouldEditTableColumn:NSArrayObjectAtIndex([customQueryView tableColumns], column) row:row];
+ // send current event to field editor sheet
+ if([NSApp currentEvent])
+ [NSApp sendEvent:[NSApp currentEvent]];
+
return NO;
}