aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2013-01-15 21:50:30 +0000
committerstuconnolly <stuart02@gmail.com>2013-01-15 21:50:30 +0000
commitad016807a908e6bec3174f9e5eae9524e6243d57 (patch)
tree944a47c5e9c35ffa99fbfa424ee089ae85ea43d7 /Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m
parent4a5cc4d039152cea726e38af9ff72d617d584513 (diff)
downloadsequelpro-ad016807a908e6bec3174f9e5eae9524e6243d57.tar.gz
sequelpro-ad016807a908e6bec3174f9e5eae9524e6243d57.tar.bz2
sequelpro-ad016807a908e6bec3174f9e5eae9524e6243d57.zip
- When requesting the server vesion with no current connection, return -1 instead of zero.
- When executing a query, perform the query checks before the connection check to avoid performing unnecessary library calls.
Diffstat (limited to 'Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m')
-rw-r--r--Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m b/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m
index 4dec74a6..ee8853c7 100644
--- a/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m
+++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m
@@ -117,7 +117,13 @@ PGQueryParamData;
{
_lastQueryWasCancelled = NO;
- if (![self isConnected] || !query || ![query isKindOfClass:[NSString class]] || [query isKindOfClass:[PGPostgresStatement class]]) return nil;
+ if (!query ||
+ ![query isKindOfClass:[NSString class]] ||
+ ![query isKindOfClass:[PGPostgresStatement class]] ||
+ ![self isConnected])
+ {
+ return nil;
+ }
// Notify the delegate
if (_delegate && _delegateSupportsWillExecute) {