diff options
Diffstat (limited to 'Source/TableContent.m')
-rw-r--r-- | Source/TableContent.m | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m index dfe9b24c..2a359d07 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -50,6 +50,7 @@ sortField = nil; areShowingAllRows = false; currentlyEditingRow = -1; + usedQuery = [[NSString stringWithString:@""] retain]; return self; } @@ -297,6 +298,8 @@ [limitRowsField intValue]-1, [prefs integerForKey:@"LimitResultsValue"]]]; } + [self setUsedQuery:query]; + queryResult = [mySQLConnection queryString:query]; if ( queryResult == nil ) { NSLog(@"Loading table data for %@ failed, query string was: %@", aTable, query); @@ -393,6 +396,9 @@ [limitRowsField intValue]-1, [prefs integerForKey:@"LimitResultsValue"]]]; [limitRowsField selectText:self]; } + + [self setUsedQuery:queryString]; + queryResult = [mySQLConnection queryString:queryString]; // [fullResult setArray:[[self fetchResultAsArray:queryResult] retain]]; [fullResult setArray:[self fetchResultAsArray:queryResult]]; @@ -605,6 +611,8 @@ [limitRowsField intValue]-1, [prefs integerForKey:@"LimitResultsValue"]]; } + [self setUsedQuery:queryString]; + theResult = [mySQLConnection queryString:queryString]; [filteredResult setArray:[self fetchResultAsArray:theResult]]; @@ -654,6 +662,18 @@ [argumentField setEnabled:(![[[compareField selectedItem] title] hasSuffix:@"NULL"])]; } +- (NSString *)usedQuery +{ + return usedQuery; +} + +- (void)setUsedQuery:(NSString *)query +{ + if(usedQuery) + [usedQuery release]; + usedQuery = [[NSString stringWithString:query] retain]; +} + #pragma mark Edit methods @@ -1659,6 +1679,7 @@ [limitRowsField intValue]-1, [prefs integerForKey:@"LimitResultsValue"]]]; } + [self setUsedQuery:queryString]; queryResult = [mySQLConnection queryString:queryString]; // [fullResult setArray:[[self fetchResultAsArray:queryResult] retain]]; [fullResult setArray:[self fetchResultAsArray:queryResult]]; @@ -2189,6 +2210,7 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn [compareType release]; if (sortField) [sortField release]; [prefs release]; + [usedQuery release]; [super dealloc]; } |