aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMMCPConnection.m
diff options
context:
space:
mode:
authorbamse16 <marius@marius.me.uk>2009-03-02 18:48:31 +0000
committerbamse16 <marius@marius.me.uk>2009-03-02 18:48:31 +0000
commit0bf8e6ff980425d16c4411f4b375a809940ae49b (patch)
treed48276333f47a2e8abbf7f09d4effed08a4526c0 /Source/CMMCPConnection.m
parent79156f6fccf7b49d02c95df0f43627b78584d80f (diff)
downloadsequelpro-0bf8e6ff980425d16c4411f4b375a809940ae49b.tar.gz
sequelpro-0bf8e6ff980425d16c4411f4b375a809940ae49b.tar.bz2
sequelpro-0bf8e6ff980425d16c4411f4b375a809940ae49b.zip
Better error handling of dump reading (checking for NSError object instead of content of read string)
Raising error when trying to import empty CSV file.
Diffstat (limited to 'Source/CMMCPConnection.m')
-rw-r--r--Source/CMMCPConnection.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/CMMCPConnection.m b/Source/CMMCPConnection.m
index 11f60b97..31efb4a1 100644
--- a/Source/CMMCPConnection.m
+++ b/Source/CMMCPConnection.m
@@ -328,6 +328,8 @@ WARNING : incomplete implementation. Please, send your fixes.
if (delegate && [delegate respondsToSelector:@selector(willQueryString:)]) {
[delegate willQueryString:query];
}
+
+ NSDate *startQueryDate = [NSDate date];
if (0 == (theQueryCode = mysql_query(mConnection, theCQuery))) {
if (mysql_field_count(mConnection) != 0) {
@@ -346,6 +348,13 @@ WARNING : incomplete implementation. Please, send your fixes.
return nil;
}
+
+ //Log how long the query took
+ if (delegate && [delegate respondsToSelector:@selector(willQueryString:)]) {
+ NSString *timedQuery = [NSString stringWithFormat:@"%@ /* %.2f */", query, [[NSDate date] timeIntervalSinceDate:startQueryDate]];
+ [delegate willQueryString:timedQuery];
+ }
+
[self startKeepAliveTimerResettingState:YES];