aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2016-04-27 21:24:21 +0200
committerMax <post@wickenrode.com>2016-04-27 21:24:21 +0200
commit242f07d397c95eecaa699e89550f75a31d77f753 (patch)
treeab99124866467b045803e7d7fd8671a2657d73d1 /Source
parentd81f88be1cdccb6dbdf27fd2022aa9d59c8fec2e (diff)
downloadsequelpro-242f07d397c95eecaa699e89550f75a31d77f753.tar.gz
sequelpro-242f07d397c95eecaa699e89550f75a31d77f753.tar.bz2
sequelpro-242f07d397c95eecaa699e89550f75a31d77f753.zip
Clarify what the execution time reported by Sequel Pro means (related to #264)
Diffstat (limited to 'Source')
-rw-r--r--Source/SPCustomQuery.m19
1 files changed, 13 insertions, 6 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index 2aeaacb6..822348be 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -876,17 +876,24 @@
}
} else {
if (totalAffectedRows==1) {
- statusString = [NSString stringWithFormat:NSLocalizedString(@"%@; 1 row affected, taking %@", @"text showing one row has been affected by a single query"),
- statusErrorString,
- [NSString stringForTimeInterval:executionTime]
+ statusString = [NSString stringWithFormat:NSLocalizedString(@"%@; 1 row affected", @"text showing one row has been affected by a single query"),
+ statusErrorString
];
} else {
- statusString = [NSString stringWithFormat:NSLocalizedString(@"%@; %ld rows affected, taking %@", @"text showing how many rows have been affected by a single query"),
+ statusString = [NSString stringWithFormat:NSLocalizedString(@"%@; %ld rows affected", @"text showing how many rows have been affected by a single query"),
statusErrorString,
- (long)totalAffectedRows,
- [NSString stringForTimeInterval:executionTime]
+ (long)totalAffectedRows
];
}
+ if(resultDataCount) {
+ // we were running a query that returns a result set (ie. SELECT).
+ // TODO: mysql_query() returns as soon as the first result row is found (which might be pretty soon when using indexes / not doing aggregations)
+ // and that makes our query time measurement pretty useless (see #264)
+ statusString = [statusString stringByAppendingFormat:NSLocalizedString(@", first row available after %1$@",@"Custom Query : text appended to the “x row(s) affected” messages. $1 is a time interval"),[NSString stringForTimeInterval:executionTime]];
+ }
+ else {
+ statusString = [statusString stringByAppendingFormat:NSLocalizedString(@", taking %1$@",@"Custom Query : text appended to the “x row(s) affected” messages (for update/delete queries). $1 is a time interval"),[NSString stringForTimeInterval:executionTime]];
+ }
}
[[affectedRowsText onMainThread] setStringValue:statusString];